@@ -9,23 +9,25 @@ const runner = path.join(__dirname, '../../bin/codecept.js')
99const codeceptDir = path . join ( __dirname , '../data/sandbox/typescript-step-paths' )
1010
1111describe ( 'TypeScript step paths' , ( ) => {
12- it ( 'maps included page object steps back to their source file' , done => {
13- execFile (
14- process . execPath ,
15- [ runner , 'run' , '--config' , path . join ( codeceptDir , 'codecept.conf.js' ) ] ,
16- { cwd : codeceptDir , env : { ...process . env , FORCE_COLOR : '0' } } ,
17- ( err , stdout ) => {
18- try {
19- expect ( err ) . toBeTruthy ( )
20- expect ( stdout ) . toContain ( 'Scenario Steps:' )
21- expect ( stdout ) . toMatch ( / a t O b j e c t \. o p e n \( \. \/ p a g e s \/ f o o P a g e \. t s : \d + : \d + \) / )
22- expect ( stdout ) . not . toContain ( '.temp.mjs' )
23- expect ( stdout ) . not . toContain ( 'file://./pages/fooPage.ts' )
24- done ( )
25- } catch ( error ) {
26- done ( error )
27- }
28- } ,
29- )
30- } )
12+ for ( const configFile of [ 'codecept.conf.js' , 'codecept.esm.conf.js' ] ) {
13+ it ( `maps included page object steps back to their source file with ${ configFile } ` , done => {
14+ execFile (
15+ process . execPath ,
16+ [ runner , 'run' , '--config' , path . join ( codeceptDir , configFile ) ] ,
17+ { cwd : codeceptDir , env : { ...process . env , FORCE_COLOR : '0' } } ,
18+ ( err , stdout ) => {
19+ try {
20+ expect ( err ) . toBeTruthy ( )
21+ expect ( stdout ) . toContain ( 'Scenario Steps:' )
22+ expect ( stdout ) . toMatch ( / a t O b j e c t \. o p e n \( \. \/ p a g e s \/ f o o P a g e \. t s : \d + : \d + \) / )
23+ expect ( stdout ) . not . toContain ( '.temp.mjs' )
24+ expect ( stdout ) . not . toContain ( 'file://./pages/fooPage.ts' )
25+ done ( )
26+ } catch ( error ) {
27+ done ( error )
28+ }
29+ } ,
30+ )
31+ } )
32+ }
3133} )
0 commit comments