@@ -150,7 +150,7 @@ describe("wrangler workflows", () => {
150150
151151 COMMANDS
152152 wrangler workflows instances list <name> Instance related commands (list, describe, terminate, pause, resume)
153- wrangler workflows instances describe <name> <id> Describe a workflow instance - see its logs, retries and errors
153+ wrangler workflows instances describe <name> [id] Describe a workflow instance - see its logs, retries and errors
154154 wrangler workflows instances terminate <name> <id> Terminate a workflow instance
155155 wrangler workflows instances pause <name> <id> Pause a workflow instance
156156 wrangler workflows instances resume <name> <id> Resume a workflow instance
@@ -380,6 +380,18 @@ describe("wrangler workflows", () => {
380380 } ) ;
381381 } ,
382382 { once : true }
383+ ) ,
384+ http . get (
385+ `*/accounts/:accountId/workflows/some-workflow/instances` ,
386+ async ( ) => {
387+ return HttpResponse . json ( {
388+ success : true ,
389+ errors : [ ] ,
390+ messages : [ ] ,
391+ result : [ mockResponse ] ,
392+ } ) ;
393+ } ,
394+ { once : true }
383395 )
384396 ) ;
385397 } ;
@@ -410,6 +422,33 @@ describe("wrangler workflows", () => {
410422 └─┴─┴─┴─┴─┘"
411423 ` ) ;
412424 } ) ;
425+
426+ it ( "should describe the latest instance if none is given" , async ( ) => {
427+ writeWranglerConfig ( ) ;
428+ await mockDescribeInstances ( ) ;
429+
430+ await runWrangler ( `workflows instances describe some-workflow` ) ;
431+ expect ( std . out ) . toMatchInlineSnapshot ( `
432+ " Name: event
433+ Type: 👀 Waiting for event
434+ Start: [mock-start-date]
435+ End: [mock-end-date]
436+ Duration: 4 years
437+ Output: {}
438+ Name: string
439+ Type: 🎯 Step
440+ Start: [mock-start-date]
441+ End: [mock-end-date]
442+ Duration: 4 years
443+ Success: ✅ Yes
444+ Output: {}
445+ ┌─┬─┬─┬─┬─┐
446+ │ Start │ End │ Duration │ State │ Error │
447+ ├─┼─┼─┼─┼─┤
448+ │ [mock-start-date] │ [mock-end-date] │ 4 years │ ✅ Success │ string: string │
449+ └─┴─┴─┴─┴─┘"
450+ ` ) ;
451+ } ) ;
413452 } ) ;
414453
415454 describe ( "instances pause" , ( ) => {
0 commit comments