Updating NPM dependencies
This commit is contained in:
52
node_modules/jest-worker/README.md
generated
vendored
52
node_modules/jest-worker/README.md
generated
vendored
@@ -21,10 +21,10 @@ This example covers the minimal usage:
|
||||
### File `parent.js`
|
||||
|
||||
```javascript
|
||||
import Worker from 'jest-worker';
|
||||
import JestWorker from 'jest-worker';
|
||||
|
||||
async function main() {
|
||||
const worker = new Worker(require.resolve('./Worker'));
|
||||
const worker = new JestWorker(require.resolve('./Worker'));
|
||||
const result = await worker.hello('Alice'); // "Hello, Alice"
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ Since `worker_threads` are considered experimental in Node, you have to opt-in t
|
||||
|
||||
## API
|
||||
|
||||
The only exposed method is a constructor (`Worker`) that is initialized by passing the worker path, plus an options object.
|
||||
The only exposed method is a constructor (`JestWorker`) that is initialized by passing the worker path, plus an options object.
|
||||
|
||||
### `workerPath: string` (required)
|
||||
|
||||
@@ -83,33 +83,43 @@ By default, no process is bound to any worker.
|
||||
|
||||
The arguments that will be passed to the `setup` method during initialization.
|
||||
|
||||
#### `workerPool: (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface` (optional)
|
||||
#### `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.
|
||||
|
||||
#### `enableWorkerThreads: boolean` (optional)
|
||||
|
||||
`jest-worker` will automatically detect if `worker_threads` are available, but will not use them unless passed `enableWorkerThreads: true`.
|
||||
|
||||
## Worker
|
||||
## JestWorker
|
||||
|
||||
The returned `Worker` instance has all the exposed methods, plus some additional ones to interact with the workers itself:
|
||||
### Methods
|
||||
|
||||
### `getStdout(): Readable`
|
||||
The returned `JestWorker` instance has all the exposed methods, plus some additional ones to interact with the workers itself:
|
||||
|
||||
#### `getStdout(): Readable`
|
||||
|
||||
Returns a `ReadableStream` where the standard output of all workers is piped. Note that the `silent` option of the child workers must be set to `true` to make it work. This is the default set by `jest-worker`, but keep it in mind when overriding options through `forkOptions`.
|
||||
|
||||
### `getStderr(): Readable`
|
||||
#### `getStderr(): Readable`
|
||||
|
||||
Returns a `ReadableStream` where the standard error of all workers is piped. Note that the `silent` option of the child workers must be set to `true` to make it work. This is the default set by `jest-worker`, but keep it in mind when overriding options through `forkOptions`.
|
||||
|
||||
### `end()`
|
||||
#### `end()`
|
||||
|
||||
Finishes the workers by killing all workers. No further calls can be done to the `Worker` instance.
|
||||
|
||||
**Note:** Each worker has a unique id (index that starts with `1`) which is available on `process.env.JEST_WORKER_ID`
|
||||
Returns a Promise that resolves with `{ forceExited: boolean }` once all workers are dead. If `forceExited` is `true`, at least one of the workers did not exit gracefully, which likely happened because it executed a leaky task that left handles open. This should be avoided, force exiting workers is a last resort to prevent creating lots of orphans.
|
||||
|
||||
**Note:**
|
||||
|
||||
`await`ing the `end()` Promise immediately after the workers are no longer needed before proceeding to do other useful things in your program may not be a good idea. If workers have to be force exited, `jest-worker` may go through multiple stages of force exiting (e.g. SIGTERM, later SIGKILL) and give the worker overall around 1 second time to exit on its own. During this time, your program will wait, even though it may not be necessary that all workers are dead before continuing execution.
|
||||
|
||||
Consider deliberately leaving this Promise floating (unhandled resolution). After your program has done the rest of its work and is about to exit, the Node process will wait for the Promise to resolve after all workers are dead as the last event loop task. That way you parallelized computation time of your program and waiting time and you didn't delay the outputs of your program unnecessarily.
|
||||
|
||||
### Worker IDs
|
||||
|
||||
Each worker has a unique id (index that starts with `1`), which is available inside the worker as `process.env.JEST_WORKER_ID`.
|
||||
|
||||
## Setting up and tearing down the child process
|
||||
|
||||
@@ -127,10 +137,10 @@ This example covers the standard usage:
|
||||
### File `parent.js`
|
||||
|
||||
```javascript
|
||||
import Worker from 'jest-worker';
|
||||
import JestWorker from 'jest-worker';
|
||||
|
||||
async function main() {
|
||||
const myWorker = new Worker(require.resolve('./Worker'), {
|
||||
const myWorker = new JestWorker(require.resolve('./Worker'), {
|
||||
exposedMethods: ['foo', 'bar', 'getWorkerId'],
|
||||
numWorkers: 4,
|
||||
});
|
||||
@@ -139,7 +149,10 @@ async function main() {
|
||||
console.log(await myWorker.bar('Bob')); // "Hello from bar: Bob"
|
||||
console.log(await myWorker.getWorkerId()); // "3" -> this message has sent from the 3rd worker
|
||||
|
||||
myWorker.end();
|
||||
const {forceExited} = await myWorker.end();
|
||||
if (forceExited) {
|
||||
console.error('Workers failed to exit gracefully');
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -168,10 +181,10 @@ This example covers the usage with a `computeWorkerKey` method:
|
||||
### File `parent.js`
|
||||
|
||||
```javascript
|
||||
import Worker from 'jest-worker';
|
||||
import JestWorker from 'jest-worker';
|
||||
|
||||
async function main() {
|
||||
const myWorker = new Worker(require.resolve('./Worker'), {
|
||||
const myWorker = new JestWorker(require.resolve('./Worker'), {
|
||||
computeWorkerKey: (method, filename) => filename,
|
||||
});
|
||||
|
||||
@@ -186,7 +199,10 @@ async function main() {
|
||||
// the same worker that processed the file the first time will process it now.
|
||||
console.log(await myWorker.transform('/tmp/foo.js'));
|
||||
|
||||
myWorker.end();
|
||||
const {forceExited} = await myWorker.end();
|
||||
if (forceExited) {
|
||||
console.error('Workers failed to exit gracefully');
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
5
node_modules/jest-worker/build/Farm.d.ts
generated
vendored
5
node_modules/jest-worker/build/Farm.d.ts
generated
vendored
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { FarmOptions } from './types';
|
||||
import { FarmOptions, PromiseWithCustomMessage } from './types';
|
||||
export default class Farm {
|
||||
private _computeWorkerKey;
|
||||
private _cacheKeys;
|
||||
@@ -15,7 +15,7 @@ export default class Farm {
|
||||
private _offset;
|
||||
private _queue;
|
||||
constructor(numOfWorkers: number, callback: Function, computeWorkerKey?: FarmOptions['computeWorkerKey']);
|
||||
doWork(method: string, ...args: Array<any>): Promise<unknown>;
|
||||
doWork(method: string, ...args: Array<unknown>): PromiseWithCustomMessage<unknown>;
|
||||
private _getNextTask;
|
||||
private _process;
|
||||
private _enqueue;
|
||||
@@ -24,4 +24,3 @@ export default class Farm {
|
||||
private _unlock;
|
||||
private _isLocked;
|
||||
}
|
||||
//# sourceMappingURL=Farm.d.ts.map
|
||||
1
node_modules/jest-worker/build/Farm.d.ts.map
generated
vendored
1
node_modules/jest-worker/build/Farm.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"Farm.d.ts","sourceRoot":"","sources":["../src/Farm.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,WAAW,EAOZ,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,OAAO,CAAC,iBAAiB,CAAkC;IAC3D,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAA0B;gBAGtC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC;IAepD,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAqC7D,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,QAAQ;IA0BhB,OAAO,CAAC,QAAQ;IAmBhB,OAAO,CAAC,KAAK;IAUb,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,SAAS;CAGlB"}
|
||||
28
node_modules/jest-worker/build/Farm.js
generated
vendored
28
node_modules/jest-worker/build/Farm.js
generated
vendored
@@ -53,7 +53,20 @@ class Farm {
|
||||
}
|
||||
|
||||
doWork(method, ...args) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const customMessageListeners = new Set();
|
||||
|
||||
const addCustomMessageListener = listener => {
|
||||
customMessageListeners.add(listener);
|
||||
return () => {
|
||||
customMessageListeners.delete(listener);
|
||||
};
|
||||
};
|
||||
|
||||
const onCustomMessage = message => {
|
||||
customMessageListeners.forEach(listener => listener(message));
|
||||
};
|
||||
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
const computeWorkerKey = this._computeWorkerKey;
|
||||
const request = [_types.CHILD_MESSAGE_CALL, false, method, args];
|
||||
let worker = null;
|
||||
@@ -71,6 +84,8 @@ class Farm {
|
||||
};
|
||||
|
||||
const onEnd = (error, result) => {
|
||||
customMessageListeners.clear();
|
||||
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
@@ -79,6 +94,7 @@ class Farm {
|
||||
};
|
||||
|
||||
const task = {
|
||||
onCustomMessage,
|
||||
onEnd,
|
||||
onStart,
|
||||
request
|
||||
@@ -90,6 +106,8 @@ class Farm {
|
||||
this._push(task);
|
||||
}
|
||||
});
|
||||
promise.UNSTABLE_onCustomMessage = addCustomMessageListener;
|
||||
return promise;
|
||||
}
|
||||
|
||||
_getNextTask(workerId) {
|
||||
@@ -126,7 +144,13 @@ class Farm {
|
||||
|
||||
this._lock(workerId);
|
||||
|
||||
this._callback(workerId, task.request, task.onStart, onEnd);
|
||||
this._callback(
|
||||
workerId,
|
||||
task.request,
|
||||
task.onStart,
|
||||
onEnd,
|
||||
task.onCustomMessage
|
||||
);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
5
node_modules/jest-worker/build/WorkerPool.d.ts
generated
vendored
5
node_modules/jest-worker/build/WorkerPool.d.ts
generated
vendored
@@ -5,10 +5,9 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import BaseWorkerPool from './base/BaseWorkerPool';
|
||||
import { ChildMessage, WorkerOptions, OnStart, OnEnd, WorkerPoolInterface, WorkerInterface } from './types';
|
||||
import type { ChildMessage, OnCustomMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions, WorkerPoolInterface } from './types';
|
||||
declare class WorkerPool extends BaseWorkerPool implements WorkerPoolInterface {
|
||||
send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd): void;
|
||||
send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd, onCustomMessage: OnCustomMessage): void;
|
||||
createWorker(workerOptions: WorkerOptions): WorkerInterface;
|
||||
}
|
||||
export default WorkerPool;
|
||||
//# sourceMappingURL=WorkerPool.d.ts.map
|
||||
1
node_modules/jest-worker/build/WorkerPool.d.ts.map
generated
vendored
1
node_modules/jest-worker/build/WorkerPool.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"WorkerPool.d.ts","sourceRoot":"","sources":["../src/WorkerPool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EACL,YAAY,EACZ,aAAa,EACb,OAAO,EACP,KAAK,EACL,mBAAmB,EACnB,eAAe,EAChB,MAAM,SAAS,CAAC;AAWjB,cAAM,UAAW,SAAQ,cAAe,YAAW,mBAAmB;IACpE,IAAI,CACF,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,IAAI;IAIP,YAAY,CAAC,aAAa,EAAE,aAAa,GAAG,eAAe;CAU5D;AAED,eAAe,UAAU,CAAC"}
|
||||
6
node_modules/jest-worker/build/WorkerPool.js
generated
vendored
6
node_modules/jest-worker/build/WorkerPool.js
generated
vendored
@@ -22,14 +22,14 @@ const canUseWorkerThreads = () => {
|
||||
require('worker_threads');
|
||||
|
||||
return true;
|
||||
} catch (_) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class WorkerPool extends _BaseWorkerPool.default {
|
||||
send(workerId, request, onStart, onEnd) {
|
||||
this.getWorkerById(workerId).send(request, onStart, onEnd);
|
||||
send(workerId, request, onStart, onEnd, onCustomMessage) {
|
||||
this.getWorkerById(workerId).send(request, onStart, onEnd, onCustomMessage);
|
||||
}
|
||||
|
||||
createWorker(workerOptions) {
|
||||
|
||||
5
node_modules/jest-worker/build/base/BaseWorkerPool.d.ts
generated
vendored
5
node_modules/jest-worker/build/base/BaseWorkerPool.d.ts
generated
vendored
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { WorkerPoolOptions, WorkerOptions, WorkerInterface } from '../types';
|
||||
import { PoolExitResult, WorkerInterface, WorkerOptions, WorkerPoolOptions } from '../types';
|
||||
export default class BaseWorkerPool {
|
||||
private readonly _stderr;
|
||||
private readonly _stdout;
|
||||
@@ -17,6 +17,5 @@ export default class BaseWorkerPool {
|
||||
getWorkers(): Array<WorkerInterface>;
|
||||
getWorkerById(workerId: number): WorkerInterface;
|
||||
createWorker(_workerOptions: WorkerOptions): WorkerInterface;
|
||||
end(): void;
|
||||
end(): Promise<PoolExitResult>;
|
||||
}
|
||||
//# sourceMappingURL=BaseWorkerPool.d.ts.map
|
||||
1
node_modules/jest-worker/build/base/BaseWorkerPool.d.ts.map
generated
vendored
1
node_modules/jest-worker/build/base/BaseWorkerPool.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"BaseWorkerPool.d.ts","sourceRoot":"","sources":["../../src/base/BaseWorkerPool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAKH,OAAO,EAEL,iBAAiB,EACjB,aAAa,EACb,eAAe,EAChB,MAAM,UAAU,CAAC;AAKlB,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyB;gBAEtC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB;IAyC1D,SAAS,IAAI,MAAM,CAAC,cAAc;IAIlC,SAAS,IAAI,MAAM,CAAC,cAAc;IAIlC,UAAU,IAAI,KAAK,CAAC,eAAe,CAAC;IAIpC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe;IAIhD,YAAY,CAAC,cAAc,EAAE,aAAa,GAAG,eAAe;IAI5D,GAAG,IAAI,IAAI;CAWZ"}
|
||||
105
node_modules/jest-worker/build/base/BaseWorkerPool.js
generated
vendored
105
node_modules/jest-worker/build/base/BaseWorkerPool.js
generated
vendored
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', {
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -18,19 +18,69 @@ function _path() {
|
||||
function _mergeStream() {
|
||||
const data = _interopRequireDefault(require('merge-stream'));
|
||||
|
||||
_mergeStream = function _mergeStream() {
|
||||
_mergeStream = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _types = require('../types');
|
||||
function _types() {
|
||||
const data = require('../types');
|
||||
|
||||
_types = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function () {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
@@ -45,7 +95,11 @@ function _defineProperty(obj, key, value) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
// How long to wait for the child process to terminate
|
||||
// after CHILD_MESSAGE_END before sending force exiting.
|
||||
const FORCE_EXIT_DELAY = 500;
|
||||
/* istanbul ignore next */
|
||||
|
||||
const emptyMethod = () => {};
|
||||
|
||||
class BaseWorkerPool {
|
||||
@@ -61,20 +115,19 @@ class BaseWorkerPool {
|
||||
this._options = options;
|
||||
this._workers = new Array(options.numWorkers);
|
||||
|
||||
if (!_path().default.isAbsolute(workerPath)) {
|
||||
if (!path().isAbsolute(workerPath)) {
|
||||
workerPath = require.resolve(workerPath);
|
||||
}
|
||||
|
||||
const stdout = (0, _mergeStream().default)();
|
||||
const stderr = (0, _mergeStream().default)();
|
||||
const forkOptions = options.forkOptions,
|
||||
maxRetries = options.maxRetries,
|
||||
setupArgs = options.setupArgs;
|
||||
const {forkOptions, maxRetries, resourceLimits, setupArgs} = options;
|
||||
|
||||
for (let i = 0; i < options.numWorkers; i++) {
|
||||
const workerOptions = {
|
||||
forkOptions,
|
||||
maxRetries,
|
||||
resourceLimits,
|
||||
setupArgs,
|
||||
workerId: i,
|
||||
workerPath
|
||||
@@ -118,16 +171,38 @@ class BaseWorkerPool {
|
||||
throw Error('Missing method createWorker in WorkerPool');
|
||||
}
|
||||
|
||||
end() {
|
||||
async end() {
|
||||
// We do not cache the request object here. If so, it would only be only
|
||||
// processed by one of the workers, and we want them all to close.
|
||||
for (let i = 0; i < this._workers.length; i++) {
|
||||
this._workers[i].send(
|
||||
[_types.CHILD_MESSAGE_END, false],
|
||||
const workerExitPromises = this._workers.map(async worker => {
|
||||
worker.send(
|
||||
[_types().CHILD_MESSAGE_END, false],
|
||||
emptyMethod,
|
||||
emptyMethod,
|
||||
emptyMethod
|
||||
);
|
||||
}
|
||||
); // Schedule a force exit in case worker fails to exit gracefully so
|
||||
// await worker.waitForExit() never takes longer than FORCE_EXIT_DELAY
|
||||
|
||||
let forceExited = false;
|
||||
const forceExitTimeout = setTimeout(() => {
|
||||
worker.forceExit();
|
||||
forceExited = true;
|
||||
}, FORCE_EXIT_DELAY);
|
||||
await worker.waitForExit(); // Worker ideally exited gracefully, don't send force exit then
|
||||
|
||||
clearTimeout(forceExitTimeout);
|
||||
return forceExited;
|
||||
});
|
||||
|
||||
const workerExits = await Promise.all(workerExitPromises);
|
||||
return workerExits.reduce(
|
||||
(result, forceExited) => ({
|
||||
forceExited: result.forceExited || forceExited
|
||||
}),
|
||||
{
|
||||
forceExited: false
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
7
node_modules/jest-worker/build/index.d.ts
generated
vendored
7
node_modules/jest-worker/build/index.d.ts
generated
vendored
@@ -5,7 +5,8 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { FarmOptions } from './types';
|
||||
import type { FarmOptions, PoolExitResult, PromiseWithCustomMessage } from './types';
|
||||
export { default as messageParent } from './workers/messageParent';
|
||||
/**
|
||||
* The Jest farm (publicly called "Worker") is a class that allows you to queue
|
||||
* methods across multiple child processes, in order to parallelize work. This
|
||||
@@ -41,6 +42,6 @@ export default class JestWorker {
|
||||
private _callFunctionWithArgs;
|
||||
getStderr(): NodeJS.ReadableStream;
|
||||
getStdout(): NodeJS.ReadableStream;
|
||||
end(): void;
|
||||
end(): Promise<PoolExitResult>;
|
||||
}
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
export type { PromiseWithCustomMessage };
|
||||
|
||||
1
node_modules/jest-worker/build/index.d.ts.map
generated
vendored
1
node_modules/jest-worker/build/index.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAKH,OAAO,EAAyC,WAAW,EAAC,MAAM,SAAS,CAAC;AAyB5E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,KAAK,CAAO;IACpB,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,WAAW,CAAsB;gBAE7B,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW;IA+BrD,OAAO,CAAC,yBAAyB;IAkBjC,OAAO,CAAC,qBAAqB;IAW7B,SAAS,IAAI,MAAM,CAAC,cAAc;IAIlC,SAAS,IAAI,MAAM,CAAC,cAAc;IAIlC,GAAG,IAAI,IAAI;CASZ"}
|
||||
87
node_modules/jest-worker/build/index.js
generated
vendored
87
node_modules/jest-worker/build/index.js
generated
vendored
@@ -3,44 +3,34 @@
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'messageParent', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _messageParent.default;
|
||||
}
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _os() {
|
||||
const data = _interopRequireDefault(require('os'));
|
||||
const data = require('os');
|
||||
|
||||
_os = function _os() {
|
||||
_os = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _Farm = _interopRequireDefault(require('./Farm'));
|
||||
|
||||
var _WorkerPool = _interopRequireDefault(require('./WorkerPool'));
|
||||
|
||||
var _Farm = _interopRequireDefault(require('./Farm'));
|
||||
var _messageParent = _interopRequireDefault(require('./workers/messageParent'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(
|
||||
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
})
|
||||
);
|
||||
}
|
||||
ownKeys.forEach(function(key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
@@ -62,7 +52,7 @@ function getExposedMethods(workerPath, options) {
|
||||
const module = require(workerPath);
|
||||
|
||||
exposedMethods = Object.keys(module).filter(
|
||||
// @ts-ignore: no index
|
||||
// @ts-expect-error: no index
|
||||
name => typeof module[name] === 'function'
|
||||
);
|
||||
|
||||
@@ -101,6 +91,13 @@ function getExposedMethods(workerPath, options) {
|
||||
|
||||
class JestWorker {
|
||||
constructor(workerPath, options) {
|
||||
var _this$_options$enable,
|
||||
_this$_options$forkOp,
|
||||
_this$_options$maxRet,
|
||||
_this$_options$numWor,
|
||||
_this$_options$resour,
|
||||
_this$_options$setupA;
|
||||
|
||||
_defineProperty(this, '_ending', void 0);
|
||||
|
||||
_defineProperty(this, '_farm', void 0);
|
||||
@@ -109,20 +106,43 @@ class JestWorker {
|
||||
|
||||
_defineProperty(this, '_workerPool', void 0);
|
||||
|
||||
this._options = _objectSpread({}, options);
|
||||
this._options = {...options};
|
||||
this._ending = false;
|
||||
const workerPoolOptions = {
|
||||
enableWorkerThreads: this._options.enableWorkerThreads || false,
|
||||
forkOptions: this._options.forkOptions || {},
|
||||
maxRetries: this._options.maxRetries || 3,
|
||||
enableWorkerThreads:
|
||||
(_this$_options$enable = this._options.enableWorkerThreads) !== null &&
|
||||
_this$_options$enable !== void 0
|
||||
? _this$_options$enable
|
||||
: false,
|
||||
forkOptions:
|
||||
(_this$_options$forkOp = this._options.forkOptions) !== null &&
|
||||
_this$_options$forkOp !== void 0
|
||||
? _this$_options$forkOp
|
||||
: {},
|
||||
maxRetries:
|
||||
(_this$_options$maxRet = this._options.maxRetries) !== null &&
|
||||
_this$_options$maxRet !== void 0
|
||||
? _this$_options$maxRet
|
||||
: 3,
|
||||
numWorkers:
|
||||
this._options.numWorkers ||
|
||||
Math.max(_os().default.cpus().length - 1, 1),
|
||||
setupArgs: this._options.setupArgs || []
|
||||
(_this$_options$numWor = this._options.numWorkers) !== null &&
|
||||
_this$_options$numWor !== void 0
|
||||
? _this$_options$numWor
|
||||
: Math.max((0, _os().cpus)().length - 1, 1),
|
||||
resourceLimits:
|
||||
(_this$_options$resour = this._options.resourceLimits) !== null &&
|
||||
_this$_options$resour !== void 0
|
||||
? _this$_options$resour
|
||||
: {},
|
||||
setupArgs:
|
||||
(_this$_options$setupA = this._options.setupArgs) !== null &&
|
||||
_this$_options$setupA !== void 0
|
||||
? _this$_options$setupA
|
||||
: []
|
||||
};
|
||||
|
||||
if (this._options.WorkerPool) {
|
||||
// @ts-ignore: constructor target any?
|
||||
// @ts-expect-error: constructor target any?
|
||||
this._workerPool = new this._options.WorkerPool(
|
||||
workerPath,
|
||||
workerPoolOptions
|
||||
@@ -148,7 +168,7 @@ class JestWorker {
|
||||
|
||||
if (this.constructor.prototype.hasOwnProperty(name)) {
|
||||
throw new TypeError('Cannot define a method called ' + name);
|
||||
} // @ts-ignore: dynamic extension of the class instance is expected.
|
||||
} // @ts-expect-error: dynamic extension of the class instance is expected.
|
||||
|
||||
this[name] = this._callFunctionWithArgs.bind(this, name);
|
||||
});
|
||||
@@ -170,14 +190,13 @@ class JestWorker {
|
||||
return this._workerPool.getStdout();
|
||||
}
|
||||
|
||||
end() {
|
||||
async end() {
|
||||
if (this._ending) {
|
||||
throw new Error('Farm is ended, no more calls can be done to it');
|
||||
}
|
||||
|
||||
this._workerPool.end();
|
||||
|
||||
this._ending = true;
|
||||
return this._workerPool.end();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
90
node_modules/jest-worker/build/types.d.ts
generated
vendored
90
node_modules/jest-worker/build/types.d.ts
generated
vendored
@@ -5,36 +5,49 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { EventEmitter } from 'events';
|
||||
import { ForkOptions } from 'child_process';
|
||||
import type { ForkOptions } from 'child_process';
|
||||
import type { EventEmitter } from 'events';
|
||||
export interface ResourceLimits {
|
||||
maxYoungGenerationSizeMb?: number;
|
||||
maxOldGenerationSizeMb?: number;
|
||||
codeRangeSizeMb?: number;
|
||||
}
|
||||
export declare const CHILD_MESSAGE_INITIALIZE: 0;
|
||||
export declare const CHILD_MESSAGE_CALL: 1;
|
||||
export declare const CHILD_MESSAGE_END: 2;
|
||||
export declare const PARENT_MESSAGE_OK: 0;
|
||||
export declare const PARENT_MESSAGE_CLIENT_ERROR: 1;
|
||||
export declare const PARENT_MESSAGE_SETUP_ERROR: 2;
|
||||
export declare const PARENT_MESSAGE_CUSTOM: 3;
|
||||
export declare type PARENT_MESSAGE_ERROR = typeof PARENT_MESSAGE_CLIENT_ERROR | typeof PARENT_MESSAGE_SETUP_ERROR;
|
||||
export { ForkOptions };
|
||||
export interface WorkerPoolInterface {
|
||||
getStderr(): NodeJS.ReadableStream;
|
||||
getStdout(): NodeJS.ReadableStream;
|
||||
getWorkers(): Array<WorkerInterface>;
|
||||
createWorker(options: WorkerOptions): WorkerInterface;
|
||||
send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd): void;
|
||||
end(): void;
|
||||
send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd, onCustomMessage: OnCustomMessage): void;
|
||||
end(): Promise<PoolExitResult>;
|
||||
}
|
||||
export interface WorkerInterface {
|
||||
send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd): void;
|
||||
send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage): void;
|
||||
waitForExit(): Promise<void>;
|
||||
forceExit(): void;
|
||||
getWorkerId(): number;
|
||||
getStderr(): NodeJS.ReadableStream | null;
|
||||
getStdout(): NodeJS.ReadableStream | null;
|
||||
onExit(exitCode: number): void;
|
||||
onMessage(message: ParentMessage): void;
|
||||
}
|
||||
export declare type PoolExitResult = {
|
||||
forceExited: boolean;
|
||||
};
|
||||
export interface PromiseWithCustomMessage<T> extends Promise<T> {
|
||||
UNSTABLE_onCustomMessage?: (listener: OnCustomMessage) => () => void;
|
||||
}
|
||||
export type { ForkOptions };
|
||||
export declare type FarmOptions = {
|
||||
computeWorkerKey?: (method: string, ...args: Array<unknown>) => string | null;
|
||||
exposedMethods?: ReadonlyArray<string>;
|
||||
forkOptions?: ForkOptions;
|
||||
resourceLimits?: ResourceLimits;
|
||||
setupArgs?: Array<unknown>;
|
||||
maxRetries?: number;
|
||||
numWorkers?: number;
|
||||
@@ -44,12 +57,14 @@ export declare type FarmOptions = {
|
||||
export declare type WorkerPoolOptions = {
|
||||
setupArgs: Array<unknown>;
|
||||
forkOptions: ForkOptions;
|
||||
resourceLimits: ResourceLimits;
|
||||
maxRetries: number;
|
||||
numWorkers: number;
|
||||
enableWorkerThreads: boolean;
|
||||
};
|
||||
export declare type WorkerOptions = {
|
||||
forkOptions: ForkOptions;
|
||||
resourceLimits: ResourceLimits;
|
||||
setupArgs: Array<unknown>;
|
||||
maxRetries: number;
|
||||
workerId: number;
|
||||
@@ -62,37 +77,52 @@ export declare type MessageChannel = {
|
||||
port1: MessagePort;
|
||||
port2: MessagePort;
|
||||
};
|
||||
export declare type ChildMessageInitialize = [typeof CHILD_MESSAGE_INITIALIZE, // type
|
||||
boolean, // processed
|
||||
string, // file
|
||||
// file
|
||||
Array<unknown> | undefined, // setupArgs
|
||||
// setupArgs
|
||||
MessagePort | undefined];
|
||||
export declare type ChildMessageCall = [typeof CHILD_MESSAGE_CALL, // type
|
||||
boolean, // processed
|
||||
string, // method
|
||||
Array<unknown>];
|
||||
export declare type ChildMessageEnd = [typeof CHILD_MESSAGE_END, // type
|
||||
boolean];
|
||||
export declare type ChildMessageInitialize = [
|
||||
typeof CHILD_MESSAGE_INITIALIZE,
|
||||
boolean,
|
||||
string,
|
||||
// file
|
||||
Array<unknown> | undefined,
|
||||
// setupArgs
|
||||
MessagePort | undefined
|
||||
];
|
||||
export declare type ChildMessageCall = [
|
||||
typeof CHILD_MESSAGE_CALL,
|
||||
boolean,
|
||||
string,
|
||||
Array<unknown>
|
||||
];
|
||||
export declare type ChildMessageEnd = [
|
||||
typeof CHILD_MESSAGE_END,
|
||||
boolean
|
||||
];
|
||||
export declare type ChildMessage = ChildMessageInitialize | ChildMessageCall | ChildMessageEnd;
|
||||
export declare type ParentMessageOk = [typeof PARENT_MESSAGE_OK, // type
|
||||
unknown];
|
||||
export declare type ParentMessageError = [PARENT_MESSAGE_ERROR, // type
|
||||
string, // constructor
|
||||
string, // message
|
||||
string, // stack
|
||||
unknown];
|
||||
export declare type ParentMessage = ParentMessageOk | ParentMessageError;
|
||||
export declare type ParentMessageCustom = [
|
||||
typeof PARENT_MESSAGE_CUSTOM,
|
||||
unknown
|
||||
];
|
||||
export declare type ParentMessageOk = [
|
||||
typeof PARENT_MESSAGE_OK,
|
||||
unknown
|
||||
];
|
||||
export declare type ParentMessageError = [
|
||||
PARENT_MESSAGE_ERROR,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
unknown
|
||||
];
|
||||
export declare type ParentMessage = ParentMessageOk | ParentMessageError | ParentMessageCustom;
|
||||
export declare type OnStart = (worker: WorkerInterface) => void;
|
||||
export declare type OnEnd = (err: Error | null, result: unknown) => void;
|
||||
export declare type OnCustomMessage = (message: Array<unknown> | unknown) => void;
|
||||
export declare type QueueChildMessage = {
|
||||
request: ChildMessage;
|
||||
onStart: OnStart;
|
||||
onEnd: OnEnd;
|
||||
onCustomMessage: OnCustomMessage;
|
||||
};
|
||||
export declare type QueueItem = {
|
||||
task: QueueChildMessage;
|
||||
next: QueueItem | null;
|
||||
};
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
node_modules/jest-worker/build/types.d.ts.map
generated
vendored
1
node_modules/jest-worker/build/types.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAM1C,eAAO,MAAM,wBAAwB,EAAE,CAAK,CAAC;AAC7C,eAAO,MAAM,kBAAkB,EAAE,CAAK,CAAC;AACvC,eAAO,MAAM,iBAAiB,EAAE,CAAK,CAAC;AAEtC,eAAO,MAAM,iBAAiB,EAAE,CAAK,CAAC;AACtC,eAAO,MAAM,2BAA2B,EAAE,CAAK,CAAC;AAChD,eAAO,MAAM,0BAA0B,EAAE,CAAK,CAAC;AAE/C,oBAAY,oBAAoB,GAC5B,OAAO,2BAA2B,GAClC,OAAO,0BAA0B,CAAC;AAItC,OAAO,EAAC,WAAW,EAAC,CAAC;AAErB,MAAM,WAAW,mBAAmB;IAClC,SAAS,IAAI,MAAM,CAAC,cAAc,CAAC;IACnC,SAAS,IAAI,MAAM,CAAC,cAAc,CAAC;IACnC,UAAU,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;IACrC,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,CAAC;IACtD,IAAI,CACF,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,IAAI,CAAC;IACR,GAAG,IAAI,IAAI,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CACF,OAAO,EAAE,YAAY,EACrB,cAAc,EAAE,OAAO,EACvB,YAAY,EAAE,KAAK,GAClB,IAAI,CAAC;IACR,WAAW,IAAI,MAAM,CAAC;IACtB,SAAS,IAAI,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;IAC1C,SAAS,IAAI,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;IAC1C,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;CACzC;AAED,oBAAY,WAAW,GAAG;IACxB,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC;IAC9E,cAAc,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,CACX,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,iBAAiB,KACxB,mBAAmB,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1B,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF,oBAAY,WAAW,GAAG,OAAO,YAAY,GAAG;IAC9C,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,oBAAY,sBAAsB,GAAG,CACnC,OAAO,wBAAwB,EAAE,OAAO;AACxC,OAAO,EAAE,YAAY;AACrB,MAAM,EAAE,OAAO;AACf,AADQ,OAAO;AACf,KAAK,CAAC,OAAO,CAAC,GAAG,SAAS,EAAE,YAAY;AACxC,AAD4B,YAAY;AACxC,WAAW,GAAG,SAAS,CACxB,CAAC;AAEF,oBAAY,gBAAgB,GAAG,CAC7B,OAAO,kBAAkB,EAAE,OAAO;AAClC,OAAO,EAAE,YAAY;AACrB,MAAM,EAAE,SAAS;AACjB,KAAK,CAAC,OAAO,CAAC,CACf,CAAC;AAEF,oBAAY,eAAe,GAAG,CAC5B,OAAO,iBAAiB,EAAE,OAAO;AACjC,OAAO,CACR,CAAC;AAEF,oBAAY,YAAY,GACpB,sBAAsB,GACtB,gBAAgB,GAChB,eAAe,CAAC;AAIpB,oBAAY,eAAe,GAAG,CAC5B,OAAO,iBAAiB,EAAE,OAAO;AACjC,OAAO,CACR,CAAC;AAEF,oBAAY,kBAAkB,GAAG,CAC/B,oBAAoB,EAAE,OAAO;AAC7B,MAAM,EAAE,cAAc;AACtB,MAAM,EAAE,UAAU;AAClB,MAAM,EAAE,QAAQ;AAChB,OAAO,CACR,CAAC;AAEF,oBAAY,aAAa,GAAG,eAAe,GAAG,kBAAkB,CAAC;AAIjE,oBAAY,OAAO,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;AACxD,oBAAY,KAAK,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;AAEjE,oBAAY,iBAAiB,GAAG;IAC9B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;CACxB,CAAC"}
|
||||
23
node_modules/jest-worker/build/types.js
generated
vendored
23
node_modules/jest-worker/build/types.js
generated
vendored
@@ -3,23 +3,7 @@
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'ForkOptions', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _child_process().ForkOptions;
|
||||
}
|
||||
});
|
||||
exports.PARENT_MESSAGE_SETUP_ERROR = exports.PARENT_MESSAGE_CLIENT_ERROR = exports.PARENT_MESSAGE_OK = exports.CHILD_MESSAGE_END = exports.CHILD_MESSAGE_CALL = exports.CHILD_MESSAGE_INITIALIZE = void 0;
|
||||
|
||||
function _child_process() {
|
||||
const data = require('child_process');
|
||||
|
||||
_child_process = function _child_process() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
exports.PARENT_MESSAGE_CUSTOM = exports.PARENT_MESSAGE_SETUP_ERROR = exports.PARENT_MESSAGE_CLIENT_ERROR = exports.PARENT_MESSAGE_OK = exports.CHILD_MESSAGE_END = exports.CHILD_MESSAGE_CALL = exports.CHILD_MESSAGE_INITIALIZE = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
@@ -27,8 +11,11 @@ function _child_process() {
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
// import type {ResourceLimits} from 'worker_threads';
|
||||
// This is not present in the Node 12 typings
|
||||
// Because of the dynamic nature of a worker communication process, all messages
|
||||
// coming from any of the other processes cannot be typed. Thus, many types
|
||||
// include "unknown" as a TS type, which is (unfortunately) correct here.
|
||||
const CHILD_MESSAGE_INITIALIZE = 0;
|
||||
exports.CHILD_MESSAGE_INITIALIZE = CHILD_MESSAGE_INITIALIZE;
|
||||
const CHILD_MESSAGE_CALL = 1;
|
||||
@@ -41,3 +28,5 @@ const PARENT_MESSAGE_CLIENT_ERROR = 1;
|
||||
exports.PARENT_MESSAGE_CLIENT_ERROR = PARENT_MESSAGE_CLIENT_ERROR;
|
||||
const PARENT_MESSAGE_SETUP_ERROR = 2;
|
||||
exports.PARENT_MESSAGE_SETUP_ERROR = PARENT_MESSAGE_SETUP_ERROR;
|
||||
const PARENT_MESSAGE_CUSTOM = 3;
|
||||
exports.PARENT_MESSAGE_CUSTOM = PARENT_MESSAGE_CUSTOM;
|
||||
|
||||
20
node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts
generated
vendored
20
node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts
generated
vendored
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { WorkerInterface, ChildMessage, OnEnd, OnStart, WorkerOptions, ParentMessage } from '../types';
|
||||
import { ChildMessage, OnCustomMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions } from '../types';
|
||||
/**
|
||||
* This class wraps the child process and provides a nice interface to
|
||||
* communicate with. It takes care of:
|
||||
@@ -27,21 +27,25 @@ import { WorkerInterface, ChildMessage, OnEnd, OnStart, WorkerOptions, ParentMes
|
||||
export default class ChildProcessWorker implements WorkerInterface {
|
||||
private _child;
|
||||
private _options;
|
||||
private _onProcessEnd;
|
||||
private _fakeStream;
|
||||
private _request;
|
||||
private _retries;
|
||||
private _stderr;
|
||||
private _onProcessEnd;
|
||||
private _onCustomMessage;
|
||||
private _fakeStream;
|
||||
private _stdout;
|
||||
private _stderr;
|
||||
private _exitPromise;
|
||||
private _resolveExitPromise;
|
||||
constructor(options: WorkerOptions);
|
||||
initialize(): void;
|
||||
private _shutdown;
|
||||
onMessage(response: ParentMessage): void;
|
||||
onExit(exitCode: number): void;
|
||||
send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd): void;
|
||||
private _onMessage;
|
||||
private _onExit;
|
||||
send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage): void;
|
||||
waitForExit(): Promise<void>;
|
||||
forceExit(): void;
|
||||
getWorkerId(): number;
|
||||
getStdout(): NodeJS.ReadableStream | null;
|
||||
getStderr(): NodeJS.ReadableStream | null;
|
||||
private _getFakeStream;
|
||||
}
|
||||
//# sourceMappingURL=ChildProcessWorker.d.ts.map
|
||||
1
node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts.map
generated
vendored
1
node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"ChildProcessWorker.d.ts","sourceRoot":"","sources":["../../src/workers/ChildProcessWorker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAOH,OAAO,EAKL,eAAe,EACf,YAAY,EACZ,KAAK,EACL,OAAO,EACP,aAAa,EACb,aAAa,EACd,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,eAAe;IAChE,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,OAAO,CAAwC;gBAE3C,OAAO,EAAE,aAAa;IAUlC,UAAU;IAiEV,OAAO,CAAC,SAAS;IAQjB,SAAS,CAAC,QAAQ,EAAE,aAAa;IA6CjC,MAAM,CAAC,QAAQ,EAAE,MAAM;IAYvB,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK;IAcxE,WAAW;IAIX,SAAS,IAAI,MAAM,CAAC,cAAc,GAAG,IAAI;IAIzC,SAAS,IAAI,MAAM,CAAC,cAAc,GAAG,IAAI;IAIzC,OAAO,CAAC,cAAc;CAMvB"}
|
||||
164
node_modules/jest-worker/build/workers/ChildProcessWorker.js
generated
vendored
164
node_modules/jest-worker/build/workers/ChildProcessWorker.js
generated
vendored
@@ -6,9 +6,9 @@ Object.defineProperty(exports, '__esModule', {
|
||||
exports.default = void 0;
|
||||
|
||||
function _child_process() {
|
||||
const data = _interopRequireDefault(require('child_process'));
|
||||
const data = require('child_process');
|
||||
|
||||
_child_process = function _child_process() {
|
||||
_child_process = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ function _child_process() {
|
||||
function _stream() {
|
||||
const data = require('stream');
|
||||
|
||||
_stream = function _stream() {
|
||||
_stream = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ function _stream() {
|
||||
function _mergeStream() {
|
||||
const data = _interopRequireDefault(require('merge-stream'));
|
||||
|
||||
_mergeStream = function _mergeStream() {
|
||||
_mergeStream = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -36,39 +36,29 @@ function _mergeStream() {
|
||||
}
|
||||
|
||||
function _supportsColor() {
|
||||
const data = _interopRequireDefault(require('supports-color'));
|
||||
const data = require('supports-color');
|
||||
|
||||
_supportsColor = function _supportsColor() {
|
||||
_supportsColor = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _types = require('../types');
|
||||
function _types() {
|
||||
const data = require('../types');
|
||||
|
||||
_types = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(
|
||||
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
})
|
||||
);
|
||||
}
|
||||
ownKeys.forEach(function(key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
@@ -83,6 +73,11 @@ function _defineProperty(obj, key, value) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
const SIGNAL_BASE_EXIT_CODE = 128;
|
||||
const SIGKILL_EXIT_CODE = SIGNAL_BASE_EXIT_CODE + 9;
|
||||
const SIGTERM_EXIT_CODE = SIGNAL_BASE_EXIT_CODE + 15; // How long to wait after SIGTERM before sending SIGKILL
|
||||
|
||||
const SIGKILL_DELAY = 500;
|
||||
/**
|
||||
* This class wraps the child process and provides a nice interface to
|
||||
* communicate with. It takes care of:
|
||||
@@ -101,59 +96,64 @@ function _defineProperty(obj, key, value) {
|
||||
* field is changed to "true", so that other workers which might encounter the
|
||||
* same call skip it.
|
||||
*/
|
||||
|
||||
class ChildProcessWorker {
|
||||
constructor(options) {
|
||||
_defineProperty(this, '_child', void 0);
|
||||
|
||||
_defineProperty(this, '_options', void 0);
|
||||
|
||||
_defineProperty(this, '_onProcessEnd', void 0);
|
||||
|
||||
_defineProperty(this, '_fakeStream', void 0);
|
||||
|
||||
_defineProperty(this, '_request', void 0);
|
||||
|
||||
_defineProperty(this, '_retries', void 0);
|
||||
|
||||
_defineProperty(this, '_stderr', void 0);
|
||||
_defineProperty(this, '_onProcessEnd', void 0);
|
||||
|
||||
_defineProperty(this, '_onCustomMessage', void 0);
|
||||
|
||||
_defineProperty(this, '_fakeStream', void 0);
|
||||
|
||||
_defineProperty(this, '_stdout', void 0);
|
||||
|
||||
_defineProperty(this, '_stderr', void 0);
|
||||
|
||||
_defineProperty(this, '_exitPromise', void 0);
|
||||
|
||||
_defineProperty(this, '_resolveExitPromise', void 0);
|
||||
|
||||
this._options = options;
|
||||
this._fakeStream = null;
|
||||
this._request = null;
|
||||
this._stderr = null;
|
||||
this._fakeStream = null;
|
||||
this._stdout = null;
|
||||
this._stderr = null;
|
||||
this._exitPromise = new Promise(resolve => {
|
||||
this._resolveExitPromise = resolve;
|
||||
});
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
initialize() {
|
||||
const forceColor = _supportsColor().default.stdout
|
||||
const forceColor = _supportsColor().stdout
|
||||
? {
|
||||
FORCE_COLOR: '1'
|
||||
}
|
||||
: {};
|
||||
|
||||
const child = _child_process().default.fork(
|
||||
const child = (0, _child_process().fork)(
|
||||
require.resolve('./processChild'),
|
||||
[],
|
||||
_objectSpread(
|
||||
{
|
||||
cwd: process.cwd(),
|
||||
env: _objectSpread(
|
||||
{},
|
||||
process.env,
|
||||
{
|
||||
JEST_WORKER_ID: String(this._options.workerId + 1)
|
||||
},
|
||||
forceColor
|
||||
),
|
||||
// Suppress --debug / --inspect flags while preserving others (like --harmony).
|
||||
execArgv: process.execArgv.filter(v => !/^--(debug|inspect)/.test(v)),
|
||||
silent: true
|
||||
{
|
||||
cwd: process.cwd(),
|
||||
env: {
|
||||
...process.env,
|
||||
JEST_WORKER_ID: String(this._options.workerId + 1),
|
||||
// 0-indexed workerId, 1-indexed JEST_WORKER_ID
|
||||
...forceColor
|
||||
},
|
||||
this._options.forkOptions
|
||||
)
|
||||
// Suppress --debug / --inspect flags while preserving others (like --harmony).
|
||||
execArgv: process.execArgv.filter(v => !/^--(debug|inspect)/.test(v)),
|
||||
silent: true,
|
||||
...this._options.forkOptions
|
||||
}
|
||||
);
|
||||
|
||||
if (child.stdout) {
|
||||
@@ -176,10 +176,10 @@ class ChildProcessWorker {
|
||||
this._stderr.add(child.stderr);
|
||||
}
|
||||
|
||||
child.on('message', this.onMessage.bind(this));
|
||||
child.on('exit', this.onExit.bind(this));
|
||||
child.on('message', this._onMessage.bind(this));
|
||||
child.on('exit', this._onExit.bind(this));
|
||||
child.send([
|
||||
_types.CHILD_MESSAGE_INITIALIZE,
|
||||
_types().CHILD_MESSAGE_INITIALIZE,
|
||||
false,
|
||||
this._options.workerPath,
|
||||
this._options.setupArgs
|
||||
@@ -191,8 +191,9 @@ class ChildProcessWorker {
|
||||
|
||||
if (this._retries > this._options.maxRetries) {
|
||||
const error = new Error('Call retries were exceeded');
|
||||
this.onMessage([
|
||||
_types.PARENT_MESSAGE_CLIENT_ERROR,
|
||||
|
||||
this._onMessage([
|
||||
_types().PARENT_MESSAGE_CLIENT_ERROR,
|
||||
error.name,
|
||||
error.message,
|
||||
error.stack,
|
||||
@@ -210,22 +211,25 @@ class ChildProcessWorker {
|
||||
|
||||
this._fakeStream = null;
|
||||
}
|
||||
|
||||
this._resolveExitPromise();
|
||||
}
|
||||
|
||||
onMessage(response) {
|
||||
_onMessage(response) {
|
||||
// TODO: Add appropriate type check
|
||||
let error;
|
||||
|
||||
switch (response[0]) {
|
||||
case _types.PARENT_MESSAGE_OK:
|
||||
case _types().PARENT_MESSAGE_OK:
|
||||
this._onProcessEnd(null, response[1]);
|
||||
|
||||
break;
|
||||
|
||||
case _types.PARENT_MESSAGE_CLIENT_ERROR:
|
||||
case _types().PARENT_MESSAGE_CLIENT_ERROR:
|
||||
error = response[4];
|
||||
|
||||
if (error != null && typeof error === 'object') {
|
||||
const extra = error; // @ts-ignore: no index
|
||||
const extra = error; // @ts-expect-error: no index
|
||||
|
||||
const NativeCtor = global[response[1]];
|
||||
const Ctor = typeof NativeCtor === 'function' ? NativeCtor : Error;
|
||||
@@ -234,7 +238,6 @@ class ChildProcessWorker {
|
||||
error.stack = response[3];
|
||||
|
||||
for (const key in extra) {
|
||||
// @ts-ignore: adding custom properties to errors.
|
||||
error[key] = extra[key];
|
||||
}
|
||||
}
|
||||
@@ -243,9 +246,8 @@ class ChildProcessWorker {
|
||||
|
||||
break;
|
||||
|
||||
case _types.PARENT_MESSAGE_SETUP_ERROR:
|
||||
error = new Error('Error when calling setup: ' + response[2]); // @ts-ignore: adding custom properties to errors.
|
||||
|
||||
case _types().PARENT_MESSAGE_SETUP_ERROR:
|
||||
error = new Error('Error when calling setup: ' + response[2]);
|
||||
error.type = response[1];
|
||||
error.stack = response[3];
|
||||
|
||||
@@ -253,13 +255,22 @@ class ChildProcessWorker {
|
||||
|
||||
break;
|
||||
|
||||
case _types().PARENT_MESSAGE_CUSTOM:
|
||||
this._onCustomMessage(response[1]);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new TypeError('Unexpected response from worker: ' + response[0]);
|
||||
}
|
||||
}
|
||||
|
||||
onExit(exitCode) {
|
||||
if (exitCode !== 0) {
|
||||
_onExit(exitCode) {
|
||||
if (
|
||||
exitCode !== 0 &&
|
||||
exitCode !== SIGTERM_EXIT_CODE &&
|
||||
exitCode !== SIGKILL_EXIT_CODE
|
||||
) {
|
||||
this.initialize();
|
||||
|
||||
if (this._request) {
|
||||
@@ -270,7 +281,7 @@ class ChildProcessWorker {
|
||||
}
|
||||
}
|
||||
|
||||
send(request, onProcessStart, onProcessEnd) {
|
||||
send(request, onProcessStart, onProcessEnd, onCustomMessage) {
|
||||
onProcessStart(this);
|
||||
|
||||
this._onProcessEnd = (...args) => {
|
||||
@@ -280,12 +291,29 @@ class ChildProcessWorker {
|
||||
return onProcessEnd(...args);
|
||||
};
|
||||
|
||||
this._onCustomMessage = (...arg) => onCustomMessage(...arg);
|
||||
|
||||
this._request = request;
|
||||
this._retries = 0;
|
||||
|
||||
this._child.send(request);
|
||||
}
|
||||
|
||||
waitForExit() {
|
||||
return this._exitPromise;
|
||||
}
|
||||
|
||||
forceExit() {
|
||||
this._child.kill('SIGTERM');
|
||||
|
||||
const sigkillTimeout = setTimeout(
|
||||
() => this._child.kill('SIGKILL'),
|
||||
SIGKILL_DELAY
|
||||
);
|
||||
|
||||
this._exitPromise.then(() => clearTimeout(sigkillTimeout));
|
||||
}
|
||||
|
||||
getWorkerId() {
|
||||
return this._options.workerId;
|
||||
}
|
||||
@@ -300,7 +328,7 @@ class ChildProcessWorker {
|
||||
|
||||
_getFakeStream() {
|
||||
if (!this._fakeStream) {
|
||||
this._fakeStream = new (_stream()).PassThrough();
|
||||
this._fakeStream = new (_stream().PassThrough)();
|
||||
}
|
||||
|
||||
return this._fakeStream;
|
||||
|
||||
21
node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts
generated
vendored
21
node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts
generated
vendored
@@ -5,25 +5,30 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { ChildMessage, OnEnd, OnStart, WorkerOptions, WorkerInterface, ParentMessage } from '../types';
|
||||
import { ChildMessage, OnCustomMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions } from '../types';
|
||||
export default class ExperimentalWorker implements WorkerInterface {
|
||||
private _worker;
|
||||
private _options;
|
||||
private _onProcessEnd;
|
||||
private _request;
|
||||
private _retries;
|
||||
private _stderr;
|
||||
private _stdout;
|
||||
private _onProcessEnd;
|
||||
private _onCustomMessage;
|
||||
private _fakeStream;
|
||||
private _stdout;
|
||||
private _stderr;
|
||||
private _exitPromise;
|
||||
private _resolveExitPromise;
|
||||
private _forceExited;
|
||||
constructor(options: WorkerOptions);
|
||||
initialize(): void;
|
||||
private _shutdown;
|
||||
onMessage(response: ParentMessage): void;
|
||||
onExit(exitCode: number): void;
|
||||
send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd): void;
|
||||
private _onMessage;
|
||||
private _onExit;
|
||||
waitForExit(): Promise<void>;
|
||||
forceExit(): void;
|
||||
send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage): void;
|
||||
getWorkerId(): number;
|
||||
getStdout(): NodeJS.ReadableStream | null;
|
||||
getStderr(): NodeJS.ReadableStream | null;
|
||||
private _getFakeStream;
|
||||
}
|
||||
//# sourceMappingURL=NodeThreadsWorker.d.ts.map
|
||||
1
node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts.map
generated
vendored
1
node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"NodeThreadsWorker.d.ts","sourceRoot":"","sources":["../../src/workers/NodeThreadsWorker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AASH,OAAO,EAKL,YAAY,EACZ,KAAK,EACL,OAAO,EACP,aAAa,EACb,eAAe,EACf,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,eAAe;IAChE,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,WAAW,CAAqB;gBAE5B,OAAO,EAAE,aAAa;IAUlC,UAAU;IAkEV,OAAO,CAAC,SAAS;IAQjB,SAAS,CAAC,QAAQ,EAAE,aAAa;IA2CjC,MAAM,CAAC,QAAQ,EAAE,MAAM;IAYvB,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK;IAexE,WAAW;IAIX,SAAS,IAAI,MAAM,CAAC,cAAc,GAAG,IAAI;IAIzC,SAAS,IAAI,MAAM,CAAC,cAAc,GAAG,IAAI;IAIzC,OAAO,CAAC,cAAc;CAMvB"}
|
||||
181
node_modules/jest-worker/build/workers/NodeThreadsWorker.js
generated
vendored
181
node_modules/jest-worker/build/workers/NodeThreadsWorker.js
generated
vendored
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', {
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ function _path() {
|
||||
function _stream() {
|
||||
const data = require('stream');
|
||||
|
||||
_stream = function _stream() {
|
||||
_stream = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ function _stream() {
|
||||
function _worker_threads() {
|
||||
const data = require('worker_threads');
|
||||
|
||||
_worker_threads = function _worker_threads() {
|
||||
_worker_threads = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -38,35 +38,67 @@ function _worker_threads() {
|
||||
function _mergeStream() {
|
||||
const data = _interopRequireDefault(require('merge-stream'));
|
||||
|
||||
_mergeStream = function _mergeStream() {
|
||||
_mergeStream = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _types = require('../types');
|
||||
function _types() {
|
||||
const data = require('../types');
|
||||
|
||||
_types = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(
|
||||
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
})
|
||||
);
|
||||
}
|
||||
ownKeys.forEach(function(key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function () {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
return target;
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
@@ -89,47 +121,58 @@ class ExperimentalWorker {
|
||||
|
||||
_defineProperty(this, '_options', void 0);
|
||||
|
||||
_defineProperty(this, '_onProcessEnd', void 0);
|
||||
|
||||
_defineProperty(this, '_request', void 0);
|
||||
|
||||
_defineProperty(this, '_retries', void 0);
|
||||
|
||||
_defineProperty(this, '_stderr', void 0);
|
||||
_defineProperty(this, '_onProcessEnd', void 0);
|
||||
|
||||
_defineProperty(this, '_stdout', void 0);
|
||||
_defineProperty(this, '_onCustomMessage', void 0);
|
||||
|
||||
_defineProperty(this, '_fakeStream', void 0);
|
||||
|
||||
_defineProperty(this, '_stdout', void 0);
|
||||
|
||||
_defineProperty(this, '_stderr', void 0);
|
||||
|
||||
_defineProperty(this, '_exitPromise', void 0);
|
||||
|
||||
_defineProperty(this, '_resolveExitPromise', void 0);
|
||||
|
||||
_defineProperty(this, '_forceExited', void 0);
|
||||
|
||||
this._options = options;
|
||||
this._request = null;
|
||||
this._stderr = null;
|
||||
this._stdout = null;
|
||||
this._fakeStream = null;
|
||||
this._stdout = null;
|
||||
this._stderr = null;
|
||||
this._exitPromise = new Promise(resolve => {
|
||||
this._resolveExitPromise = resolve;
|
||||
});
|
||||
this._forceExited = false;
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this._worker = new (_worker_threads()).Worker(
|
||||
_path().default.resolve(__dirname, './threadChild.js'),
|
||||
this._worker = new (_worker_threads().Worker)(
|
||||
path().resolve(__dirname, './threadChild.js'),
|
||||
{
|
||||
eval: false,
|
||||
// @ts-expect-error: added in newer versions
|
||||
resourceLimits: this._options.resourceLimits,
|
||||
stderr: true,
|
||||
stdout: true,
|
||||
workerData: _objectSpread(
|
||||
{
|
||||
cwd: process.cwd(),
|
||||
env: _objectSpread({}, process.env, {
|
||||
JEST_WORKER_ID: String(this._options.workerId + 1) // 0-indexed workerId, 1-indexed JEST_WORKER_ID
|
||||
}),
|
||||
// Suppress --debug / --inspect flags while preserving others (like --harmony).
|
||||
execArgv: process.execArgv.filter(
|
||||
v => !/^--(debug|inspect)/.test(v)
|
||||
),
|
||||
silent: true
|
||||
workerData: {
|
||||
cwd: process.cwd(),
|
||||
env: {
|
||||
...process.env,
|
||||
JEST_WORKER_ID: String(this._options.workerId + 1) // 0-indexed workerId, 1-indexed JEST_WORKER_ID
|
||||
},
|
||||
this._options.forkOptions
|
||||
)
|
||||
// Suppress --debug / --inspect flags while preserving others (like --harmony).
|
||||
execArgv: process.execArgv.filter(v => !/^--(debug|inspect)/.test(v)),
|
||||
silent: true,
|
||||
...this._options.forkOptions
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -153,12 +196,12 @@ class ExperimentalWorker {
|
||||
this._stderr.add(this._worker.stderr);
|
||||
}
|
||||
|
||||
this._worker.on('message', this.onMessage.bind(this));
|
||||
this._worker.on('message', this._onMessage.bind(this));
|
||||
|
||||
this._worker.on('exit', this.onExit.bind(this));
|
||||
this._worker.on('exit', this._onExit.bind(this));
|
||||
|
||||
this._worker.postMessage([
|
||||
_types.CHILD_MESSAGE_INITIALIZE,
|
||||
_types().CHILD_MESSAGE_INITIALIZE,
|
||||
false,
|
||||
this._options.workerPath,
|
||||
this._options.setupArgs
|
||||
@@ -170,8 +213,9 @@ class ExperimentalWorker {
|
||||
|
||||
if (this._retries > this._options.maxRetries) {
|
||||
const error = new Error('Call retries were exceeded');
|
||||
this.onMessage([
|
||||
_types.PARENT_MESSAGE_CLIENT_ERROR,
|
||||
|
||||
this._onMessage([
|
||||
_types().PARENT_MESSAGE_CLIENT_ERROR,
|
||||
error.name,
|
||||
error.message,
|
||||
error.stack,
|
||||
@@ -189,22 +233,24 @@ class ExperimentalWorker {
|
||||
|
||||
this._fakeStream = null;
|
||||
}
|
||||
|
||||
this._resolveExitPromise();
|
||||
}
|
||||
|
||||
onMessage(response) {
|
||||
_onMessage(response) {
|
||||
let error;
|
||||
|
||||
switch (response[0]) {
|
||||
case _types.PARENT_MESSAGE_OK:
|
||||
case _types().PARENT_MESSAGE_OK:
|
||||
this._onProcessEnd(null, response[1]);
|
||||
|
||||
break;
|
||||
|
||||
case _types.PARENT_MESSAGE_CLIENT_ERROR:
|
||||
case _types().PARENT_MESSAGE_CLIENT_ERROR:
|
||||
error = response[4];
|
||||
|
||||
if (error != null && typeof error === 'object') {
|
||||
const extra = error; // @ts-ignore: no index
|
||||
const extra = error; // @ts-expect-error: no index
|
||||
|
||||
const NativeCtor = global[response[1]];
|
||||
const Ctor = typeof NativeCtor === 'function' ? NativeCtor : Error;
|
||||
@@ -213,7 +259,7 @@ class ExperimentalWorker {
|
||||
error.stack = response[3];
|
||||
|
||||
for (const key in extra) {
|
||||
// @ts-ignore: no index
|
||||
// @ts-expect-error: no index
|
||||
error[key] = extra[key];
|
||||
}
|
||||
}
|
||||
@@ -222,8 +268,8 @@ class ExperimentalWorker {
|
||||
|
||||
break;
|
||||
|
||||
case _types.PARENT_MESSAGE_SETUP_ERROR:
|
||||
error = new Error('Error when calling setup: ' + response[2]); // @ts-ignore: adding custom properties to errors.
|
||||
case _types().PARENT_MESSAGE_SETUP_ERROR:
|
||||
error = new Error('Error when calling setup: ' + response[2]); // @ts-expect-error: adding custom properties to errors.
|
||||
|
||||
error.type = response[1];
|
||||
error.stack = response[3];
|
||||
@@ -232,13 +278,18 @@ class ExperimentalWorker {
|
||||
|
||||
break;
|
||||
|
||||
case _types().PARENT_MESSAGE_CUSTOM:
|
||||
this._onCustomMessage(response[1]);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new TypeError('Unexpected response from worker: ' + response[0]);
|
||||
}
|
||||
}
|
||||
|
||||
onExit(exitCode) {
|
||||
if (exitCode !== 0) {
|
||||
_onExit(exitCode) {
|
||||
if (exitCode !== 0 && !this._forceExited) {
|
||||
this.initialize();
|
||||
|
||||
if (this._request) {
|
||||
@@ -249,7 +300,17 @@ class ExperimentalWorker {
|
||||
}
|
||||
}
|
||||
|
||||
send(request, onProcessStart, onProcessEnd) {
|
||||
waitForExit() {
|
||||
return this._exitPromise;
|
||||
}
|
||||
|
||||
forceExit() {
|
||||
this._forceExited = true;
|
||||
|
||||
this._worker.terminate();
|
||||
}
|
||||
|
||||
send(request, onProcessStart, onProcessEnd, onCustomMessage) {
|
||||
onProcessStart(this);
|
||||
|
||||
this._onProcessEnd = (...args) => {
|
||||
@@ -259,6 +320,8 @@ class ExperimentalWorker {
|
||||
return onProcessEnd(...args);
|
||||
};
|
||||
|
||||
this._onCustomMessage = (...arg) => onCustomMessage(...arg);
|
||||
|
||||
this._request = request;
|
||||
this._retries = 0;
|
||||
|
||||
@@ -279,7 +342,7 @@ class ExperimentalWorker {
|
||||
|
||||
_getFakeStream() {
|
||||
if (!this._fakeStream) {
|
||||
this._fakeStream = new (_stream()).PassThrough();
|
||||
this._fakeStream = new (_stream().PassThrough)();
|
||||
}
|
||||
|
||||
return this._fakeStream;
|
||||
|
||||
9
node_modules/jest-worker/build/workers/messageParent.d.ts
generated
vendored
Normal file
9
node_modules/jest-worker/build/workers/messageParent.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
declare const messageParent: (message: unknown, parentProcess?: NodeJS.Process) => void;
|
||||
export default messageParent;
|
||||
51
node_modules/jest-worker/build/workers/messageParent.js
generated
vendored
Normal file
51
node_modules/jest-worker/build/workers/messageParent.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _types() {
|
||||
const data = require('../types');
|
||||
|
||||
_types = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
const isWorkerThread = () => {
|
||||
try {
|
||||
// `Require` here to support Node v10
|
||||
const {isMainThread, parentPort} = require('worker_threads');
|
||||
|
||||
return !isMainThread && parentPort;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const messageParent = (message, parentProcess = process) => {
|
||||
try {
|
||||
if (isWorkerThread()) {
|
||||
// `Require` here to support Node v10
|
||||
const {parentPort} = require('worker_threads');
|
||||
|
||||
parentPort.postMessage([_types().PARENT_MESSAGE_CUSTOM, message]);
|
||||
} else if (typeof parentProcess.send === 'function') {
|
||||
parentProcess.send([_types().PARENT_MESSAGE_CUSTOM, message]);
|
||||
}
|
||||
} catch {
|
||||
throw new Error('"messageParent" can only be used inside a worker');
|
||||
}
|
||||
};
|
||||
|
||||
var _default = messageParent;
|
||||
exports.default = _default;
|
||||
1
node_modules/jest-worker/build/workers/processChild.d.ts
generated
vendored
1
node_modules/jest-worker/build/workers/processChild.d.ts
generated
vendored
@@ -5,4 +5,3 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=processChild.d.ts.map
|
||||
1
node_modules/jest-worker/build/workers/processChild.d.ts.map
generated
vendored
1
node_modules/jest-worker/build/workers/processChild.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"processChild.d.ts","sourceRoot":"","sources":["../../src/workers/processChild.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
||||
74
node_modules/jest-worker/build/workers/processChild.js
generated
vendored
74
node_modules/jest-worker/build/workers/processChild.js
generated
vendored
@@ -1,39 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var _types = require('../types');
|
||||
function _types() {
|
||||
const data = require('../types');
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(
|
||||
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
})
|
||||
);
|
||||
}
|
||||
ownKeys.forEach(function(key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
_types = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
let file = null;
|
||||
let setupArgs = [];
|
||||
let initialized = false;
|
||||
@@ -51,20 +33,20 @@ let initialized = false;
|
||||
* non-zero exit code.
|
||||
*/
|
||||
|
||||
process.on('message', request => {
|
||||
const messageListener = request => {
|
||||
switch (request[0]) {
|
||||
case _types.CHILD_MESSAGE_INITIALIZE:
|
||||
case _types().CHILD_MESSAGE_INITIALIZE:
|
||||
const init = request;
|
||||
file = init[2];
|
||||
setupArgs = request[3];
|
||||
break;
|
||||
|
||||
case _types.CHILD_MESSAGE_CALL:
|
||||
case _types().CHILD_MESSAGE_CALL:
|
||||
const call = request;
|
||||
execMethod(call[2], call[3]);
|
||||
break;
|
||||
|
||||
case _types.CHILD_MESSAGE_END:
|
||||
case _types().CHILD_MESSAGE_END:
|
||||
end();
|
||||
break;
|
||||
|
||||
@@ -73,22 +55,24 @@ process.on('message', request => {
|
||||
'Unexpected request from parent process: ' + request[0]
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
process.on('message', messageListener);
|
||||
|
||||
function reportSuccess(result) {
|
||||
if (!process || !process.send) {
|
||||
throw new Error('Child can only be used on a forked process');
|
||||
}
|
||||
|
||||
process.send([_types.PARENT_MESSAGE_OK, result]);
|
||||
process.send([_types().PARENT_MESSAGE_OK, result]);
|
||||
}
|
||||
|
||||
function reportClientError(error) {
|
||||
return reportError(error, _types.PARENT_MESSAGE_CLIENT_ERROR);
|
||||
return reportError(error, _types().PARENT_MESSAGE_CLIENT_ERROR);
|
||||
}
|
||||
|
||||
function reportInitializeError(error) {
|
||||
return reportError(error, _types.PARENT_MESSAGE_SETUP_ERROR);
|
||||
return reportError(error, _types().PARENT_MESSAGE_SETUP_ERROR);
|
||||
}
|
||||
|
||||
function reportError(error, type) {
|
||||
@@ -105,7 +89,7 @@ function reportError(error, type) {
|
||||
error.constructor && error.constructor.name,
|
||||
error.message,
|
||||
error.stack,
|
||||
typeof error === 'object' ? _objectSpread({}, error) : error
|
||||
typeof error === 'object' ? {...error} : error
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -121,7 +105,8 @@ function end() {
|
||||
}
|
||||
|
||||
function exitProcess() {
|
||||
process.exit(0);
|
||||
// Clean up open handles so the process ideally exits gracefully
|
||||
process.removeListener('message', messageListener);
|
||||
}
|
||||
|
||||
function execMethod(method, args) {
|
||||
@@ -148,6 +133,11 @@ function execMethod(method, args) {
|
||||
execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError);
|
||||
}
|
||||
|
||||
const isPromise = obj =>
|
||||
!!obj &&
|
||||
(typeof obj === 'object' || typeof obj === 'function') &&
|
||||
typeof obj.then === 'function';
|
||||
|
||||
function execFunction(fn, ctx, args, onResult, onError) {
|
||||
let result;
|
||||
|
||||
@@ -158,7 +148,7 @@ function execFunction(fn, ctx, args, onResult, onError) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (result && typeof result.then === 'function') {
|
||||
if (isPromise(result)) {
|
||||
result.then(onResult, onError);
|
||||
} else {
|
||||
onResult(result);
|
||||
|
||||
1
node_modules/jest-worker/build/workers/threadChild.d.ts
generated
vendored
1
node_modules/jest-worker/build/workers/threadChild.d.ts
generated
vendored
@@ -5,4 +5,3 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=threadChild.d.ts.map
|
||||
1
node_modules/jest-worker/build/workers/threadChild.d.ts.map
generated
vendored
1
node_modules/jest-worker/build/workers/threadChild.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"threadChild.d.ts","sourceRoot":"","sources":["../../src/workers/threadChild.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
||||
79
node_modules/jest-worker/build/workers/threadChild.js
generated
vendored
79
node_modules/jest-worker/build/workers/threadChild.js
generated
vendored
@@ -3,47 +3,29 @@
|
||||
function _worker_threads() {
|
||||
const data = require('worker_threads');
|
||||
|
||||
_worker_threads = function _worker_threads() {
|
||||
_worker_threads = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _types = require('../types');
|
||||
function _types() {
|
||||
const data = require('../types');
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(
|
||||
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
})
|
||||
);
|
||||
}
|
||||
ownKeys.forEach(function(key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
_types = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
let file = null;
|
||||
let setupArgs = [];
|
||||
let initialized = false;
|
||||
@@ -61,20 +43,20 @@ let initialized = false;
|
||||
* non-zero exit code.
|
||||
*/
|
||||
|
||||
_worker_threads().parentPort.on('message', request => {
|
||||
const messageListener = request => {
|
||||
switch (request[0]) {
|
||||
case _types.CHILD_MESSAGE_INITIALIZE:
|
||||
case _types().CHILD_MESSAGE_INITIALIZE:
|
||||
const init = request;
|
||||
file = init[2];
|
||||
setupArgs = request[3];
|
||||
break;
|
||||
|
||||
case _types.CHILD_MESSAGE_CALL:
|
||||
case _types().CHILD_MESSAGE_CALL:
|
||||
const call = request;
|
||||
execMethod(call[2], call[3]);
|
||||
break;
|
||||
|
||||
case _types.CHILD_MESSAGE_END:
|
||||
case _types().CHILD_MESSAGE_END:
|
||||
end();
|
||||
break;
|
||||
|
||||
@@ -83,22 +65,27 @@ _worker_threads().parentPort.on('message', request => {
|
||||
'Unexpected request from parent process: ' + request[0]
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
_worker_threads().parentPort.on('message', messageListener);
|
||||
|
||||
function reportSuccess(result) {
|
||||
if (_worker_threads().isMainThread) {
|
||||
throw new Error('Child can only be used on a forked process');
|
||||
}
|
||||
|
||||
_worker_threads().parentPort.postMessage([_types.PARENT_MESSAGE_OK, result]);
|
||||
_worker_threads().parentPort.postMessage([
|
||||
_types().PARENT_MESSAGE_OK,
|
||||
result
|
||||
]);
|
||||
}
|
||||
|
||||
function reportClientError(error) {
|
||||
return reportError(error, _types.PARENT_MESSAGE_CLIENT_ERROR);
|
||||
return reportError(error, _types().PARENT_MESSAGE_CLIENT_ERROR);
|
||||
}
|
||||
|
||||
function reportInitializeError(error) {
|
||||
return reportError(error, _types.PARENT_MESSAGE_SETUP_ERROR);
|
||||
return reportError(error, _types().PARENT_MESSAGE_SETUP_ERROR);
|
||||
}
|
||||
|
||||
function reportError(error, type) {
|
||||
@@ -115,7 +102,7 @@ function reportError(error, type) {
|
||||
error.constructor && error.constructor.name,
|
||||
error.message,
|
||||
error.stack,
|
||||
typeof error === 'object' ? _objectSpread({}, error) : error
|
||||
typeof error === 'object' ? {...error} : error
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -131,7 +118,8 @@ function end() {
|
||||
}
|
||||
|
||||
function exitProcess() {
|
||||
process.exit(0);
|
||||
// Clean up open handles so the worker ideally exits gracefully
|
||||
_worker_threads().parentPort.removeListener('message', messageListener);
|
||||
}
|
||||
|
||||
function execMethod(method, args) {
|
||||
@@ -158,6 +146,11 @@ function execMethod(method, args) {
|
||||
execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError);
|
||||
}
|
||||
|
||||
const isPromise = obj =>
|
||||
!!obj &&
|
||||
(typeof obj === 'object' || typeof obj === 'function') &&
|
||||
typeof obj.then === 'function';
|
||||
|
||||
function execFunction(fn, ctx, args, onResult, onError) {
|
||||
let result;
|
||||
|
||||
@@ -168,7 +161,7 @@ function execFunction(fn, ctx, args, onResult, onError) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (result && typeof result.then === 'function') {
|
||||
if (isPromise(result)) {
|
||||
result.then(onResult, onError);
|
||||
} else {
|
||||
onResult(result);
|
||||
|
||||
39
node_modules/jest-worker/node_modules/has-flag/index.d.ts
generated
vendored
Normal file
39
node_modules/jest-worker/node_modules/has-flag/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag.
|
||||
|
||||
@param flag - CLI flag to look for. The `--` prefix is optional.
|
||||
@param argv - CLI arguments. Default: `process.argv`.
|
||||
@returns Whether the flag exists.
|
||||
|
||||
@example
|
||||
```
|
||||
// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow
|
||||
|
||||
// foo.ts
|
||||
import hasFlag = require('has-flag');
|
||||
|
||||
hasFlag('unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('--unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('f');
|
||||
//=> true
|
||||
|
||||
hasFlag('-f');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo=bar');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo');
|
||||
//=> false
|
||||
|
||||
hasFlag('rainbow');
|
||||
//=> false
|
||||
```
|
||||
*/
|
||||
declare function hasFlag(flag: string, argv?: string[]): boolean;
|
||||
|
||||
export = hasFlag;
|
||||
8
node_modules/jest-worker/node_modules/has-flag/index.js
generated
vendored
Normal file
8
node_modules/jest-worker/node_modules/has-flag/index.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (flag, argv = process.argv) => {
|
||||
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
||||
const position = argv.indexOf(prefix + flag);
|
||||
const terminatorPosition = argv.indexOf('--');
|
||||
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
||||
};
|
||||
9
node_modules/jest-worker/node_modules/has-flag/license
generated
vendored
Normal file
9
node_modules/jest-worker/node_modules/has-flag/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
78
node_modules/jest-worker/node_modules/has-flag/package.json
generated
vendored
Normal file
78
node_modules/jest-worker/node_modules/has-flag/package.json
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"_from": "has-flag@^4.0.0",
|
||||
"_id": "has-flag@4.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"_location": "/jest-worker/has-flag",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "has-flag@^4.0.0",
|
||||
"name": "has-flag",
|
||||
"escapedName": "has-flag",
|
||||
"rawSpec": "^4.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^4.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/jest-worker/supports-color"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"_shasum": "944771fd9c81c81265c4d6941860da06bb59479b",
|
||||
"_spec": "has-flag@^4.0.0",
|
||||
"_where": "/home/codespace/workspace/upload-google-play/node_modules/jest-worker/node_modules/supports-color",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/has-flag/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Check if argv has a specific flag",
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/has-flag#readme",
|
||||
"keywords": [
|
||||
"has",
|
||||
"check",
|
||||
"detect",
|
||||
"contains",
|
||||
"find",
|
||||
"flag",
|
||||
"cli",
|
||||
"command-line",
|
||||
"argv",
|
||||
"process",
|
||||
"arg",
|
||||
"args",
|
||||
"argument",
|
||||
"arguments",
|
||||
"getopt",
|
||||
"minimist",
|
||||
"optimist"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "has-flag",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/has-flag.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"version": "4.0.0"
|
||||
}
|
||||
89
node_modules/jest-worker/node_modules/has-flag/readme.md
generated
vendored
Normal file
89
node_modules/jest-worker/node_modules/has-flag/readme.md
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
# has-flag [](https://travis-ci.org/sindresorhus/has-flag)
|
||||
|
||||
> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
|
||||
|
||||
Correctly stops looking after an `--` argument terminator.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-has-flag?utm_source=npm-has-flag&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install has-flag
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
const hasFlag = require('has-flag');
|
||||
|
||||
hasFlag('unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('--unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('f');
|
||||
//=> true
|
||||
|
||||
hasFlag('-f');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo=bar');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo');
|
||||
//=> false
|
||||
|
||||
hasFlag('rainbow');
|
||||
//=> false
|
||||
```
|
||||
|
||||
```
|
||||
$ node foo.js -f --unicorn --foo=bar -- --rainbow
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### hasFlag(flag, [argv])
|
||||
|
||||
Returns a boolean for whether the flag exists.
|
||||
|
||||
#### flag
|
||||
|
||||
Type: `string`
|
||||
|
||||
CLI flag to look for. The `--` prefix is optional.
|
||||
|
||||
#### argv
|
||||
|
||||
Type: `string[]`<br>
|
||||
Default: `process.argv`
|
||||
|
||||
CLI arguments.
|
||||
|
||||
|
||||
## Security
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
27
node_modules/jest-worker/node_modules/supports-color/index.js
generated
vendored
27
node_modules/jest-worker/node_modules/supports-color/index.js
generated
vendored
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
const os = require('os');
|
||||
const tty = require('tty');
|
||||
const hasFlag = require('has-flag');
|
||||
|
||||
const {env} = process;
|
||||
@@ -16,10 +17,11 @@ if (hasFlag('no-color') ||
|
||||
hasFlag('color=always')) {
|
||||
forceColor = 1;
|
||||
}
|
||||
|
||||
if ('FORCE_COLOR' in env) {
|
||||
if (env.FORCE_COLOR === true || env.FORCE_COLOR === 'true') {
|
||||
if (env.FORCE_COLOR === 'true') {
|
||||
forceColor = 1;
|
||||
} else if (env.FORCE_COLOR === false || env.FORCE_COLOR === 'false') {
|
||||
} else if (env.FORCE_COLOR === 'false') {
|
||||
forceColor = 0;
|
||||
} else {
|
||||
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
||||
@@ -39,7 +41,7 @@ function translateLevel(level) {
|
||||
};
|
||||
}
|
||||
|
||||
function supportsColor(stream) {
|
||||
function supportsColor(haveStream, streamIsTTY) {
|
||||
if (forceColor === 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -54,7 +56,7 @@ function supportsColor(stream) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (stream && !stream.isTTY && forceColor === undefined) {
|
||||
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -65,15 +67,10 @@ function supportsColor(stream) {
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
// Node.js 7.5.0 is the first version of Node.js to include a patch to
|
||||
// libuv that enables 256 color output on Windows. Anything earlier and it
|
||||
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
|
||||
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
|
||||
// release that supports 256 colors. Windows 10 build 14931 is the first release
|
||||
// that supports 16m/TrueColor.
|
||||
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
||||
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
||||
const osRelease = os.release().split('.');
|
||||
if (
|
||||
Number(process.versions.node.split('.')[0]) >= 8 &&
|
||||
Number(osRelease[0]) >= 10 &&
|
||||
Number(osRelease[2]) >= 10586
|
||||
) {
|
||||
@@ -84,7 +81,7 @@ function supportsColor(stream) {
|
||||
}
|
||||
|
||||
if ('CI' in env) {
|
||||
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
||||
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -127,12 +124,12 @@ function supportsColor(stream) {
|
||||
}
|
||||
|
||||
function getSupportLevel(stream) {
|
||||
const level = supportsColor(stream);
|
||||
const level = supportsColor(stream, stream && stream.isTTY);
|
||||
return translateLevel(level);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
supportsColor: getSupportLevel,
|
||||
stdout: getSupportLevel(process.stdout),
|
||||
stderr: getSupportLevel(process.stderr)
|
||||
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
||||
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
||||
};
|
||||
|
||||
42
node_modules/jest-worker/node_modules/supports-color/package.json
generated
vendored
42
node_modules/jest-worker/node_modules/supports-color/package.json
generated
vendored
@@ -1,33 +1,27 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"supports-color@6.1.0",
|
||||
"/Users/drew.heavner/Documents/Github/upload-google-play"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "supports-color@6.1.0",
|
||||
"_id": "supports-color@6.1.0",
|
||||
"_from": "supports-color@^7.0.0",
|
||||
"_id": "supports-color@7.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
|
||||
"_integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"_location": "/jest-worker/supports-color",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "supports-color@6.1.0",
|
||||
"raw": "supports-color@^7.0.0",
|
||||
"name": "supports-color",
|
||||
"escapedName": "supports-color",
|
||||
"rawSpec": "6.1.0",
|
||||
"rawSpec": "^7.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "6.1.0"
|
||||
"fetchSpec": "^7.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/jest-worker"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
|
||||
"_spec": "6.1.0",
|
||||
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play",
|
||||
"_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"_shasum": "1b7dcdcb32b8138801b3e478ba6a51caa89648da",
|
||||
"_spec": "supports-color@^7.0.0",
|
||||
"_where": "/home/codespace/workspace/upload-google-play/node_modules/jest-worker",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
@@ -37,17 +31,19 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/supports-color/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"has-flag": "^3.0.0"
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Detect whether a terminal supports color",
|
||||
"devDependencies": {
|
||||
"ava": "^0.25.0",
|
||||
"import-fresh": "^2.0.0",
|
||||
"xo": "^0.23.0"
|
||||
"ava": "^1.4.1",
|
||||
"import-fresh": "^3.0.0",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
"node": ">=8"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
@@ -85,5 +81,5 @@
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "6.1.0"
|
||||
"version": "7.2.0"
|
||||
}
|
||||
|
||||
33
node_modules/jest-worker/node_modules/supports-color/readme.md
generated
vendored
33
node_modules/jest-worker/node_modules/supports-color/readme.md
generated
vendored
@@ -2,20 +2,6 @@
|
||||
|
||||
> Detect whether a terminal supports color
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-supports-color?utm_source=npm-supports-color&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
@@ -63,11 +49,6 @@ For situations where using `--color` is not possible, use the environment variab
|
||||
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
|
||||
|
||||
|
||||
## Security
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
|
||||
@@ -80,6 +61,16 @@ To report a security vulnerability, please use the [Tidelift security contact](h
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
## License
|
||||
---
|
||||
|
||||
MIT
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-supports-color?utm_source=npm-supports-color&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
37
node_modules/jest-worker/package.json
generated
vendored
37
node_modules/jest-worker/package.json
generated
vendored
@@ -1,51 +1,50 @@
|
||||
{
|
||||
"_from": "jest-worker@^24.6.0",
|
||||
"_id": "jest-worker@24.9.0",
|
||||
"_from": "jest-worker@^26.6.2",
|
||||
"_id": "jest-worker@26.6.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==",
|
||||
"_integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==",
|
||||
"_location": "/jest-worker",
|
||||
"_phantomChildren": {
|
||||
"has-flag": "3.0.0"
|
||||
},
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "jest-worker@^24.6.0",
|
||||
"raw": "jest-worker@^26.6.2",
|
||||
"name": "jest-worker",
|
||||
"escapedName": "jest-worker",
|
||||
"rawSpec": "^24.6.0",
|
||||
"rawSpec": "^26.6.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^24.6.0"
|
||||
"fetchSpec": "^26.6.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@jest/reporters",
|
||||
"/jest-haste-map",
|
||||
"/jest-runner"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz",
|
||||
"_shasum": "5dbfdb5b2d322e98567898238a9697bcce67b3e5",
|
||||
"_spec": "jest-worker@^24.6.0",
|
||||
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play/node_modules/@jest/reporters",
|
||||
"_resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz",
|
||||
"_shasum": "7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed",
|
||||
"_spec": "jest-worker@^26.6.2",
|
||||
"_where": "/home/codespace/workspace/upload-google-play/node_modules/@jest/reporters",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"merge-stream": "^2.0.0",
|
||||
"supports-color": "^6.1.0"
|
||||
"supports-color": "^7.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Module for executing heavy tasks under forked processes in parallel, by providing a `Promise` based interface, minimum overhead, and bound workers.",
|
||||
"devDependencies": {
|
||||
"@types/merge-stream": "^1.1.2",
|
||||
"@types/supports-color": "^5.3.0",
|
||||
"get-stream": "^4.1.0",
|
||||
"@types/supports-color": "^7.2.0",
|
||||
"get-stream": "^6.0.0",
|
||||
"worker-farm": "^1.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"gitHead": "9ad0f4bc6b8bdd94989804226c28c9960d9da7d1",
|
||||
"gitHead": "4c46930615602cbf983fb7e8e82884c282a624d5",
|
||||
"homepage": "https://github.com/facebook/jest#readme",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
@@ -59,5 +58,5 @@
|
||||
"directory": "packages/jest-worker"
|
||||
},
|
||||
"types": "build/index.d.ts",
|
||||
"version": "24.9.0"
|
||||
"version": "26.6.2"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user