@@ -5,6 +5,7 @@ import { join } from 'node:path';
55import { CliTest , DEFAULT_RC , USER_FLOW_MOCKS } from '../../utils/setup' ;
66
77const DUMMY_USER_FLOW_NAME = 'Basic Navigation Example' ;
8+ const MOCK_MD_REPORT_HEADER = '| Gather Mode | Performance | Accessibility | Best Practices | Seo |' ;
89
910describe ( 'collect format' , ( ) => {
1011 [ 'html' , 'json' , 'md' ] . forEach ( ( format ) => {
@@ -33,7 +34,7 @@ describe('collect format', () => {
3334
3435 const { code, stdout, stderr } = await cli . run ( 'user-flow' , [ 'collect' ] ) ;
3536
36- expect ( stdout ) . toContain ( `| Gather Mode | Performance | Accessibility | Best Practices | Seo | Pwa |` )
37+ expect ( stdout ) . toContain ( MOCK_MD_REPORT_HEADER )
3738 expect ( stdout ) . toContain ( DUMMY_USER_FLOW_NAME ) ;
3839 expect ( stderr ) . toBe ( '' ) ;
3940 expect ( code ) . toBe ( 0 ) ;
@@ -54,7 +55,7 @@ describe('collect format', () => {
5455 expect ( isValidFormatedResult ( format , content ) ) . toBeTruthy ( ) ;
5556 } ) ;
5657
57- expect ( stdout ) . toContain ( `| Gather Mode | Performance | Accessibility | Best Practices | Seo | Pwa |` )
58+ expect ( stdout ) . toContain ( MOCK_MD_REPORT_HEADER )
5859 expect ( stdout ) . toContain ( DUMMY_USER_FLOW_NAME ) ;
5960 expect ( stderr ) . toBe ( '' ) ;
6061 expect ( code ) . toBe ( 0 ) ;
@@ -66,7 +67,7 @@ function isValidFormatedResult(format: string, result: string) {
6667 const isValidFile = {
6768 'html' : ( report : string ) => report . includes ( DUMMY_USER_FLOW_NAME ) ,
6869 'json' : ( report : string ) => ! ! ( JSON . parse ( report ) ?. name || '' ) . includes ( DUMMY_USER_FLOW_NAME ) ,
69- 'md' : ( report : string ) => report . includes ( `| Gather Mode | Performance | Accessibility | Best Practices | Seo | Pwa |` )
70+ 'md' : ( report : string ) => report . includes ( MOCK_MD_REPORT_HEADER )
7071 } ;
7172 // @ts -ignore
7273 return isValidFile [ format ] ( result ) ;
0 commit comments