@@ -72,25 +72,37 @@ for (const packageManager of ['npm', 'yarn'] as ('npm' | 'yarn')[]) {
72
72
} ) ;
73
73
74
74
test ( 'should generate be able to run TS examples successfully' , async ( { run } ) => {
75
+ test . slow ( ) ;
75
76
const { exitCode, dir, exec } = await run ( [ ] , { installGitHubActions : false , testDir : 'tests' , language : 'TypeScript' , installPlaywrightDependencies : false } ) ;
76
77
expect ( exitCode ) . toBe ( 0 ) ;
77
78
expect ( fs . existsSync ( path . join ( dir , 'tests/example.spec.ts' ) ) ) . toBeTruthy ( ) ;
78
79
expect ( fs . existsSync ( path . join ( dir , 'package.json' ) ) ) . toBeTruthy ( ) ;
79
80
expect ( fs . existsSync ( path . join ( dir , 'playwright.config.ts' ) ) ) . toBeTruthy ( ) ;
80
81
81
- const result = await exec ( packageManager === 'npm' ? 'npx' : 'yarn' , [ 'playwright' , 'test' ] ) ;
82
- expect ( result . code ) . toBe ( 0 ) ;
82
+ {
83
+ const { code } = await exec ( packageManager === 'npm' ? 'npx' : 'yarn' , [ 'playwright' , 'install-deps' ] ) ;
84
+ expect ( code ) . toBe ( 0 ) ;
85
+ }
86
+
87
+ const { code } = await exec ( packageManager === 'npm' ? 'npx' : 'yarn' , [ 'playwright' , 'test' ] ) ;
88
+ expect ( code ) . toBe ( 0 ) ;
83
89
} ) ;
84
90
85
91
test ( 'should generate be able to run JS examples successfully' , async ( { run } ) => {
92
+ test . slow ( ) ;
86
93
const { exitCode, dir, exec } = await run ( [ ] , { installGitHubActions : false , testDir : 'tests' , language : 'JavaScript' , installPlaywrightDependencies : false } ) ;
87
94
expect ( exitCode ) . toBe ( 0 ) ;
88
95
expect ( fs . existsSync ( path . join ( dir , 'tests/example.spec.js' ) ) ) . toBeTruthy ( ) ;
89
96
expect ( fs . existsSync ( path . join ( dir , 'package.json' ) ) ) . toBeTruthy ( ) ;
90
97
expect ( fs . existsSync ( path . join ( dir , 'playwright.config.js' ) ) ) . toBeTruthy ( ) ;
91
98
92
- const result = await exec ( packageManager === 'npm' ? 'npx' : 'yarn' , [ 'playwright' , 'test' ] ) ;
93
- expect ( result . code ) . toBe ( 0 ) ;
99
+ {
100
+ const { code } = await exec ( packageManager === 'npm' ? 'npx' : 'yarn' , [ 'playwright' , 'install-deps' ] ) ;
101
+ expect ( code ) . toBe ( 0 ) ;
102
+ }
103
+
104
+ const { code } = await exec ( packageManager === 'npm' ? 'npx' : 'yarn' , [ 'playwright' , 'test' ] ) ;
105
+ expect ( code ) . toBe ( 0 ) ;
94
106
} ) ;
95
107
} ) ;
96
108
}
0 commit comments