@@ -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
@@ -314,6 +314,18 @@ describe("wrangler workflows", () => {
314314 } ) ;
315315 } ,
316316 { once : true }
317+ ) ,
318+ http . get (
319+ `*/accounts/:accountId/workflows/some-workflow/instances` ,
320+ async ( ) => {
321+ return HttpResponse . json ( {
322+ success : true ,
323+ errors : [ ] ,
324+ messages : [ ] ,
325+ result : [ mockResponse ] ,
326+ } ) ;
327+ } ,
328+ { once : true }
317329 )
318330 ) ;
319331 } ;
@@ -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` ) ;
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