@@ -112,6 +112,31 @@ test('should generate in the root of pnpm workspace', async ({ run, packageManag
112
112
expect ( fs . existsSync ( path . join ( dir , 'playwright.config.ts' ) ) ) . toBeTruthy ( ) ;
113
113
} ) ;
114
114
115
+ test ( 'should generate in the root of yarn workspaces' , async ( { run, packageManager } ) => {
116
+ test . skip ( packageManager !== 'yarn' ) ;
117
+
118
+ const dir = test . info ( ) . outputDir ;
119
+ fs . mkdirSync ( dir , { recursive : true } ) ;
120
+ fs . writeFileSync ( path . join ( dir , 'package.json' ) , `{
121
+ "name": "yarn-monorepo",
122
+ "version": "1.0.0",
123
+ "private": true,
124
+ "workspaces": ["packages/*"]
125
+ }` ) ;
126
+ for ( const pkg of [ 'foo' , 'bar' ] ) {
127
+ const packageDir = path . join ( dir , 'packages' , pkg ) ;
128
+ fs . mkdirSync ( packageDir , { recursive : true } ) ;
129
+ childProcess . execSync ( 'yarn init -y' , { cwd : packageDir } ) ;
130
+ }
131
+ childProcess . execSync ( 'yarn install' , { cwd : dir } ) ;
132
+
133
+ await run ( [ ] , { installGitHubActions : false , testDir : 'tests' , language : 'TypeScript' , installPlaywrightDependencies : false , installPlaywrightBrowsers : false } ) ;
134
+ assertLockFilesExist ( dir , packageManager ) ;
135
+ expect ( fs . existsSync ( path . join ( dir , 'tests/example.spec.ts' ) ) ) . toBeTruthy ( ) ;
136
+ expect ( fs . existsSync ( path . join ( dir , 'node_modules/playwright' ) ) ) . toBeTruthy ( ) ;
137
+ expect ( fs . existsSync ( path . join ( dir , 'playwright.config.ts' ) ) ) . toBeTruthy ( ) ;
138
+ } ) ;
139
+
115
140
test ( 'should not duplicate gitignore entries' , async ( { run, dir } ) => {
116
141
fs . writeFileSync ( path . join ( dir , '.gitignore' ) , validGitignore ) ;
117
142
0 commit comments