Skip to content

Commit

Permalink
docs: Update github-actions-cpu-cores recommendation as unnecessary…
Browse files Browse the repository at this point in the history
… with Node 18 or newer
  • Loading branch information
blimmer committed Aug 17, 2023
1 parent a5cdc86 commit 92551e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 8 additions & 10 deletions docs/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 92551e8

Please sign in to comment.