jest-worker
Advanced tools
Comparing version 24.0.0-alpha.7 to 24.0.0-alpha.8
{ | ||
"name": "jest-worker", | ||
"version": "24.0.0-alpha.7", | ||
"version": "24.0.0-alpha.8", | ||
"repository": { | ||
@@ -13,3 +13,6 @@ "type": "git", | ||
}, | ||
"gitHead": "4954f46708415174c48a58f296a605fbe1244a31" | ||
"engines": { | ||
"node": ">= 6" | ||
}, | ||
"gitHead": "700e0dadb85f5dc8ff5dac6c7e98956690049734" | ||
} |
@@ -27,3 +27,3 @@ # jest-worker | ||
async function main() { | ||
const worker = new Worker(require.resolve('./worker')); | ||
const worker = new Worker(require.resolve('./Worker')); | ||
const result = await worker.hello('Alice'); // "Hello, Alice" | ||
@@ -43,2 +43,8 @@ } | ||
## Experimental worker | ||
Node 10 shipped with [worker-threads](https://nodejs.org/api/worker_threads.html), a "threading API" that uses SharedArrayBuffers to communicate between the main process and its child threads. This experimental Node feature can significantly improve the communication time between parent and child processes in `jest-worker`. | ||
We will use worker threads where available. To enable in Node 10+, run the Node process with the `--experimental-worker` flag. | ||
## API | ||
@@ -82,2 +88,8 @@ | ||
#### `workerPool: (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface` (optional) | ||
Provide a custom worker pool to be used for spawning child processes. By default, Jest will use a node thread pool if available and fall back to child process threads. | ||
The arguments that will be passed to the `setup` method during initialization. | ||
## Worker | ||
@@ -120,3 +132,3 @@ | ||
async function main() { | ||
const myWorker = new Worker(require.resolve('./worker'), { | ||
const myWorker = new Worker(require.resolve('./Worker'), { | ||
exposedMethods: ['foo', 'bar', 'getWorkerId'], | ||
@@ -162,3 +174,3 @@ numWorkers: 4, | ||
async function main() { | ||
const myWorker = new Worker(require.resolve('./worker'), { | ||
const myWorker = new Worker(require.resolve('./Worker'), { | ||
computeWorkerKey: (method, filename) => filename, | ||
@@ -165,0 +177,0 @@ }); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
49795
13
977
216
8