Socket
Socket
Sign inDemoInstall

jest-worker

Package Overview
Dependencies
Maintainers
2
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-worker - npm Package Compare versions

Comparing version 23.0.0-alpha.7 to 23.0.0-alpha.3r

17

build/index.js

@@ -176,2 +176,3 @@ /**

[(_types || _load_types()).CHILD_MESSAGE_END, false],
emptyMethod,
emptyMethod

@@ -223,7 +224,9 @@ );

// the worker that executed the call.
function callback(error, result) {
const onProcessStart = worker => {
if (hash != null) {
cacheKeys[hash] = this;
cacheKeys[hash] = worker;
}
};
const onProcessEnd = (error, result) => {
if (error) {

@@ -234,7 +237,7 @@ reject(error);

}
}
};
// If a worker is pre-selected, use it...
if (worker) {
worker.send(request, callback);
worker.send(request, onProcessStart, onProcessEnd);
return;

@@ -245,3 +248,7 @@ }

for (let i = 0; i < length; i++) {
workers[(i + this._offset) % length].send(request, callback);
workers[(i + this._offset) % length].send(
request,
onProcessStart,
onProcessEnd
);
}

@@ -248,0 +255,0 @@

@@ -66,4 +66,4 @@ /**

send(request, callback) {
const item = {callback, next: null, request};
send(request, onProcessStart, onProcessEnd) {
const item = {next: null, onProcessEnd, onProcessStart, request};

@@ -148,2 +148,5 @@ if (this._last) {

// Tell the parent that this item is starting to be processed.
item.onProcessStart(this);
this._retries = 0;

@@ -166,3 +169,3 @@ this._busy = true;

const callback = item.callback;
const onProcessEnd = item.onProcessEnd;

@@ -174,3 +177,3 @@ this._busy = false;

case (_types || _load_types()).PARENT_MESSAGE_OK:
callback.call(this, null, response[1]);
onProcessEnd(null, response[1]);
break;

@@ -197,3 +200,3 @@

callback.call(this, error, null);
onProcessEnd(error, null);
break;

@@ -200,0 +203,0 @@

{
"name": "jest-worker",
"version": "23.0.0-alpha.7",
"version": "23.0.0-alpha.3r",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc