File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
packages/jest-environment-puppeteer/src Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -80,14 +80,19 @@ export const startBrowsers = async ({
8080 config : JestPuppeteerConfig ;
8181 jestConfig : JestConfig ;
8282} ) : Promise < Browser [ ] > => {
83+ const workersCount = getWorkersCount ( jestConfig ) ;
84+ saveWorkersCount ( workersCount ) ;
85+
8386 if ( config . connect ?. browserWSEndpoint ) {
87+ if ( workersCount > 1 ) {
88+ throw new Error (
89+ "Cannot use `connect.browserWSEndpoint` with multiple workers. Set Jest `maxWorkers` to 1." ,
90+ ) ;
91+ }
8492 saveWsEndpoints ( [ config . connect . browserWSEndpoint ] ) ;
8593 return [ ] ;
8694 }
8795
88- const workersCount = getWorkersCount ( jestConfig ) ;
89- saveWorkersCount ( workersCount ) ;
90-
9196 const browsers = await Promise . all (
9297 Array . from ( { length : workersCount } ) . map ( ( ) => openBrowser ( config ) ) ,
9398 ) ;
You can’t perform that action at this time.
0 commit comments