@@ -354,6 +354,66 @@ describe("Jest integration", () => {
354354 } ) ;
355355 } ) ;
356356 } ) ;
357+
358+ describe ( "List all fuzz tests" , ( ) => {
359+ const listFuzzTestNamesTestBuilder = new FuzzTestBuilder ( )
360+ . dir ( projectDir )
361+ . listFuzzTestNames ( )
362+ . jestTestFile ( jestTestFile + ".js" ) ;
363+
364+ it ( "lists fuzz tests" , ( ) => {
365+ const listFuzzTestNames = listFuzzTestNamesTestBuilder . build ( ) ;
366+
367+ listFuzzTestNames . execute ( ) ;
368+
369+ expect ( listFuzzTestNames . stdout ) . toContain (
370+ "Jest Integration execute sync test" ,
371+ ) ;
372+ expect ( listFuzzTestNames . stdout ) . toContain (
373+ "Run mode skip and standard standard test" ,
374+ ) ;
375+ } ) ;
376+
377+ it ( "filters fuzz tests by name" , ( ) => {
378+ const listFuzzTestNames = listFuzzTestNamesTestBuilder
379+ . listFuzzTestNamesPattern ( "sync test" )
380+ . build ( ) ;
381+
382+ listFuzzTestNames . execute ( ) ;
383+
384+ expect ( listFuzzTestNames . stdout ) . toContain (
385+ "Jest Integration execute sync test" ,
386+ ) ;
387+ expect ( listFuzzTestNames . stdout ) . not . toContain (
388+ "Run mode skip and standard standard test" ,
389+ ) ;
390+ } ) ;
391+
392+ it ( "filters fuzz tests by describe name" , ( ) => {
393+ const listFuzzTestNames = listFuzzTestNamesTestBuilder
394+ . listFuzzTestNamesPattern ( "Jest" )
395+ . build ( ) ;
396+
397+ listFuzzTestNames . execute ( ) ;
398+
399+ expect ( listFuzzTestNames . stdout ) . toContain (
400+ "Jest Integration execute sync test" ,
401+ ) ;
402+ expect ( listFuzzTestNames . stdout ) . not . toContain (
403+ "Run mode skip and standard standard test" ,
404+ ) ;
405+ } ) ;
406+
407+ it ( "prints nothing else on stdout" , ( ) => {
408+ const listFuzzTestNames = listFuzzTestNamesTestBuilder
409+ . listFuzzTestNamesPattern ( "__NOT_AN_ACTUAL_TESTNAME__" )
410+ . build ( ) ;
411+
412+ listFuzzTestNames . execute ( ) ;
413+
414+ expect ( listFuzzTestNames . stdout ) . toBe ( "" ) ;
415+ } ) ;
416+ } ) ;
357417} ) ;
358418
359419// Deflake the "timeout after N seconds" test to be more tolerant to small variations of N (+-1).
0 commit comments