diff --git a/CHANGELOG.md b/CHANGELOG.md index e15bad622f72..9cd993d60b6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ ### Chore & Maintenance +- `[docs]` Update `github-actions-cpu-cores` recommendation as unnecessary with Node 18 or newer ([#14421](https://github.com/jestjs/jest/pull/14421)) + ### Performance ## 29.6.2 diff --git a/docs/Troubleshooting.md b/docs/Troubleshooting.md index ffa30a558854..60b3c643f61a 100644 --- a/docs/Troubleshooting.md +++ b/docs/Troubleshooting.md @@ -185,18 +185,16 @@ jest --maxWorkers=4 npm test -- --maxWorkers=4 ``` -If you use GitHub Actions, you can use [`github-actions-cpu-cores`](https://github.com/SimenB/github-actions-cpu-cores) to detect number of CPUs, and pass that to Jest. - -```yaml -- name: Get number of CPU cores - id: cpu-cores - uses: SimenB/github-actions-cpu-cores@v1 -- name: run tests - run: yarn jest --max-workers ${{ steps.cpu-cores.outputs.count }} -``` - Another thing you can do is use the [`shard`](CLI.md#--shard) flag to parallelize the test run across multiple machines. +:::info + +If your project uses Node 14 or 16, you can use you can use [`github-actions-cpu-cores`](https://github.com/SimenB/github-actions-cpu-cores) to accurately detect the number of CPUs to use. + +Refer to [`github-actions-cpu-cores` README](https://github.com/SimenB/github-actions-cpu-cores#readme) for more information. + +::: + ## `coveragePathIgnorePatterns` seems to not have any effect. Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by `coveragePathIgnorePatterns`.