@@ -142,7 +142,7 @@ describe("wrangler workflows", () => {
142142
143143 COMMANDS
144144 wrangler workflows instances list <name> Instance related commands (list, describe, terminate, pause, resume)
145- wrangler workflows instances describe <name> <id> Describe a workflow instance - see its logs, retries and errors
145+ wrangler workflows instances describe <name> [id] Describe a workflow instance - see its logs, retries and errors
146146 wrangler workflows instances terminate <name> <id> Terminate a workflow instance
147147 wrangler workflows instances pause <name> <id> Pause a workflow instance
148148 wrangler workflows instances resume <name> <id> Resume a workflow instance
@@ -316,6 +316,18 @@ describe("wrangler workflows", () => {
316316 { once : true }
317317 )
318318 ) ;
319+ http . get (
320+ `*/accounts/:accountId/workflows/some-workflow/instances` ,
321+ async ( ) => {
322+ return HttpResponse . json ( {
323+ success : true ,
324+ errors : [ ] ,
325+ messages : [ ] ,
326+ result : [ mockResponse ] ,
327+ } ) ;
328+ } ,
329+ { once : true }
330+ ) ;
319331 } ;
320332
321333 it ( "should describe the bar instance given a name" , async ( ) => {
@@ -328,6 +340,20 @@ describe("wrangler workflows", () => {
328340│ Start │ End │ Duration │ State │ Error │
329341├───────────────────────┼───────────────────────┼───────────┼────────────┼────────────────┤
330342│ 1/1/2021, 12:00:00 AM │ 1/1/2021, 12:00:00 AM │ 0 seconds │ ✅ Success │ string: string │
343+ └───────────────────────┴───────────────────────┴───────────┴────────────┴────────────────┘"
344+ ` ) ;
345+ } ) ;
346+
347+ it ( "should describe the latest instance if none is given" , async ( ) => {
348+ writeWranglerConfig ( ) ;
349+ await mockDescribeInstances ( ) ;
350+
351+ await runWrangler ( `workflows instances describe some-workflow bar` ) ;
352+ expect ( std . out ) . toMatchInlineSnapshot ( `
353+ "┌───────────────────────┬───────────────────────┬───────────┬────────────┬────────────────┐
354+ │ Start │ End │ Duration │ State │ Error │
355+ ├───────────────────────┼───────────────────────┼───────────┼────────────┼────────────────┤
356+ │ 1/1/2021, 12:00:00 AM │ 1/1/2021, 12:00:00 AM │ 0 seconds │ ✅ Success │ string: string │
331357└───────────────────────┴───────────────────────┴───────────┴────────────┴────────────────┘"
332358 ` ) ;
333359 } ) ;
0 commit comments