Socket
Socket
Sign inDemoInstall

jest-worker

Package Overview
Dependencies
1
Maintainers
4
Versions
170
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 24.0.0-alpha.7 to 24.0.0-alpha.8

build/base/BaseWorkerPool.js

7

package.json
{
"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 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc