Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 25afe3f

Browse files
committed
docs
1 parent 5037420 commit 25afe3f

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

docs/CLI.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,10 @@ Use `--no-watchAll` (or `--watchAll=false`) to explicitly disable the watch mode
571571

572572
Whether to use [`watchman`](https://facebook.github.io/watchman/) for file crawling. Defaults to `true`. Disable using `--no-watchman`.
573573

574+
### `--workerGracefulExitTimeout=<number>`
575+
576+
Timeout in milliseconds for worker processes to exit gracefully after tests complete. Workers that do not exit in time are force-killed. Default: `500`.
577+
574578
### `--workerThreads`
575579

576580
Whether to use [worker threads](https://nodejs.org/dist/latest/docs/api/worker_threads.html) for parallelization. [Child processes](https://nodejs.org/dist/latest/docs/api/child_process.html) are used by default.

docs/Configuration.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2483,6 +2483,30 @@ Default: `true`
24832483

24842484
Whether to use [`watchman`](https://facebook.github.io/watchman/) for file crawling.
24852485

2486+
### `workerGracefulExitTimeout` \[number]
2487+
2488+
Default: `500`
2489+
2490+
Timeout in milliseconds for a worker process to exit gracefully after all tests have completed. If a worker does not exit within this timeout, it is force-killed.
2491+
2492+
Increase this value if your test environment requires more time to tear down (for example, when using `--detectOpenHandles` or when workers hold onto long-lived resources).
2493+
2494+
```js tab title="jest.config.js"
2495+
const {defineConfig} = require('jest');
2496+
2497+
module.exports = defineConfig({
2498+
workerGracefulExitTimeout: 2000,
2499+
});
2500+
```
2501+
2502+
```ts tab title="jest.config.ts"
2503+
import {defineConfig} from 'jest';
2504+
2505+
export default defineConfig({
2506+
workerGracefulExitTimeout: 2000,
2507+
});
2508+
```
2509+
24862510
### `workerIdleMemoryLimit` \[number|string]
24872511

24882512
Default: `undefined`

0 commit comments

Comments
 (0)