diff --git a/.vscode/settings.json b/.vscode/settings.json index c4951686b125..69015dbad6d0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,9 +5,7 @@ "**/node_modules": true, "**/build": true }, - "editor.formatOnSave": true, - "flow.useNPMPackagedFlow": true, + "eslint.autoFixOnSave": true, "javascript.validate.enable": false, - "jest.pathToJest": "yarn jest --", - "prettier.eslintIntegration": true + "jest.pathToJest": "yarn jest --" } diff --git a/CHANGELOG.md b/CHANGELOG.md index fa564953b57a..6dc41106eef2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ - `[jest-config]` Fix Jest multi project runner still cannot handle exactly one project ([#8894](https://github.com/facebook/jest/pull/8894)) - `[jest-console]` Add missing `console.group` calls to `NullConsole` ([#9024](https://github.com/facebook/jest/pull/9024)) - `[jest-core]` Don't include unref'd timers in --detectOpenHandles results ([#8941](https://github.com/facebook/jest/pull/8941)) +- `[jest-core]` Limit number of workers when creating haste maps in projects ([#9259](https://github.com/facebook/jest/pull/9259)) - `[jest-diff]` Do not inverse format if line consists of one change ([#8903](https://github.com/facebook/jest/pull/8903)) - `[jest-diff]` Rename some new options and change their default values ([#9077](https://github.com/facebook/jest/pull/9077)) - `[jest-fake-timers]` `getTimerCount` will not include cancelled immediates ([#8764](https://github.com/facebook/jest/pull/8764)) diff --git a/packages/jest-core/src/cli/index.ts b/packages/jest-core/src/cli/index.ts index ad2f2e2bea73..da079919a161 100644 --- a/packages/jest-core/src/cli/index.ts +++ b/packages/jest-core/src/cli/index.ts @@ -122,7 +122,10 @@ const buildContextsAndHasteMaps = async ( createDirectory(config.cacheDirectory); const hasteMapInstance = Runtime.createHasteMap(config, { console: new CustomConsole(outputStream, outputStream), - maxWorkers: globalConfig.maxWorkers, + maxWorkers: Math.max( + 1, + Math.floor(globalConfig.maxWorkers / configs.length), + ), resetCache: !config.cache, watch: globalConfig.watch || globalConfig.watchAll, watchman: globalConfig.watchman, diff --git a/packages/jest-runtime/src/cli/index.ts b/packages/jest-runtime/src/cli/index.ts index a70cf4ac3ead..22ed107ffb99 100644 --- a/packages/jest-runtime/src/cli/index.ts +++ b/packages/jest-runtime/src/cli/index.ts @@ -35,7 +35,6 @@ export function run(cliArgv?: Config.Argv, cliInfo?: Array) { .version(false) .options(args.options).argv; - // @ts-ignore: fix this at some point validateCLIOptions(argv, {...args.options, deprecationEntries}); } @@ -63,8 +62,6 @@ export function run(cliArgv?: Config.Argv, cliInfo?: Array) { const info = cliInfo ? ', ' + cliInfo.join(', ') : ''; console.log(`Using Jest Runtime v${VERSION}${info}`); } - // TODO: Figure this out - // @ts-ignore: this might not have the correct arguments const options = readConfig(argv, root); const globalConfig = options.globalConfig; // Always disable automocking in scripts. diff --git a/packages/jest-worker/README.md b/packages/jest-worker/README.md index 932326202edb..247b68b748e9 100644 --- a/packages/jest-worker/README.md +++ b/packages/jest-worker/README.md @@ -83,7 +83,7 @@ By default, no process is bound to any worker. The arguments that will be passed to the `setup` method during initialization. -#### `workerPool: (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface` (optional) +#### `WorkerPool: (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface` (optional) Provide a custom worker pool to be used for spawning child processes. By default, Jest will use a node thread pool if available and fall back to child process threads.