jest-worker
Advanced tools
Comparing version 24.0.0-alpha.13 to 24.0.0-alpha.14
@@ -114,3 +114,3 @@ /** | ||
const workerPoolOptions = { | ||
disableWorkerThreads: this._options.disableWorkerThreads || false, | ||
enableWorkerThreads: this._options.enableWorkerThreads || false, | ||
forkOptions: this._options.forkOptions || {}, | ||
@@ -117,0 +117,0 @@ maxRetries: this._options.maxRetries || 3, |
@@ -41,3 +41,3 @@ /** | ||
if (!this._options.disableWorkerThreads && canUseWorkerThreads()) { | ||
if (this._options.enableWorkerThreads && canUseWorkerThreads()) { | ||
Worker = require('./workers/NodeThreadsWorker').default; | ||
@@ -44,0 +44,0 @@ } else { |
{ | ||
"name": "jest-worker", | ||
"version": "24.0.0-alpha.13", | ||
"version": "24.0.0-alpha.14", | ||
"repository": { | ||
@@ -21,3 +21,3 @@ "type": "git", | ||
}, | ||
"gitHead": "6de22dde9a10f775adc7b6f80080bdd224f6ae31" | ||
"gitHead": "28971c5f794330e8acc6861288e6daafcd32238e" | ||
} |
@@ -46,6 +46,4 @@ # jest-worker | ||
We will use worker threads where available. To enable in Node 10+, run the Node process with the `--experimental-worker` flag. | ||
Since `worker_threads` are considered experimental in Node, you have to opt-in to this behavior by passing `enableWorkerThreads: true` when instantiating the worker. While the feature was unflagged in Node 11.7.0, you'll need to run the Node process with the `--experimental-worker` flag for Node 10. | ||
You can explicitly opt-out of this by passing `disableWorkerThreads: true`. | ||
## API | ||
@@ -95,5 +93,5 @@ | ||
#### `disableWorkerThreads: boolean` (optional) | ||
#### `enableWorkerThreads: boolean` (optional) | ||
`jest-worker` will automatically detect if `worker_threads` are available and use them. However, running under threads comes with [some caveats](https://nodejs.org/api/worker_threads.html#worker_threads_class_worker), and is still experimental, so you can `opt-out` of this and use `disableWorkerThreads: true`. | ||
`jest-worker` will automatically detect if `worker_threads` are available, but will not use them unless passed `enableWorkerThreads: true`. | ||
@@ -100,0 +98,0 @@ ## Worker |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43027
216