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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add default value
  • Loading branch information
mrazauskas committed Feb 21, 2023
commit 94f8baa20e9a412b917fc902fadda024ec53c168
2 changes: 2 additions & 0 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2378,4 +2378,6 @@ This option allows comments in `package.json`. Include the comment text as the v

### `workerThreads`
Copy link
Contributor Author

@mrazauskas mrazauskas Feb 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively could be named: threads, useThreads, useWorkerThreads. Or it could implemented similar to coverageProvider or testRunner, e.g. parallelization: 'childProcesses' | 'workerThreads'.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine. there won't ever be any other alternatives


Default: `false`

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.
3 changes: 2 additions & 1 deletion e2e/__tests__/__snapshots__/showConfig.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ exports[`--showConfig outputs config info and exits 1`] = `
"useStderr": false,
"watch": false,
"watchAll": false,
"watchman": true
"watchman": true,
"workerThreads": false
},
"version": "[version]"
}"
Expand Down
1 change: 1 addition & 0 deletions packages/jest-config/src/Defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const defaultOptions: Config.DefaultOptions = {
watch: false,
watchPathIgnorePatterns: [],
watchman: true,
workerThreads: false,
};

export default defaultOptions;
1 change: 1 addition & 0 deletions packages/jest-types/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export type DefaultOptions = {
watch: boolean;
watchPathIgnorePatterns: Array<string>;
watchman: boolean;
workerThreads: boolean;
};

export type DisplayName = {
Expand Down