Set up comprehensive frontend testing infrastructure
- Install Jest for unit testing with React Testing Library - Install Playwright for end-to-end testing - Configure Jest with proper TypeScript support and module mapping - Create test setup files and utilities for both unit and e2e tests Components: * Jest configuration with coverage thresholds * Playwright configuration with browser automation * Unit tests for LoginForm, AuthContext, and useSocketIO hook * E2E tests for authentication, dashboard, and agents workflows * GitHub Actions workflow for automated testing * Mock data and API utilities for consistent testing * Test documentation with best practices Testing features: - Unit tests with 70% coverage threshold - E2E tests with API mocking and user journey testing - CI/CD integration for automated test runs - Cross-browser testing support with Playwright - Authentication system testing end-to-end 🚀 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
22
frontend/node_modules/jest-worker/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/jest-worker/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
Copyright Contributors to the Jest project.
|
||||
|
||||
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.
|
||||
272
frontend/node_modules/jest-worker/README.md
generated
vendored
Normal file
272
frontend/node_modules/jest-worker/README.md
generated
vendored
Normal file
@@ -0,0 +1,272 @@
|
||||
# jest-worker
|
||||
|
||||
Module for executing heavy tasks under forked processes in parallel, by providing a `Promise` based interface, minimum overhead, and bound workers.
|
||||
|
||||
The module works by providing an absolute path of the module to be loaded in all forked processes. All methods are exposed on the parent process as promises, so they can be `await`'ed. Child (worker) methods can either be synchronous or asynchronous.
|
||||
|
||||
The module also implements support for bound workers. Binding a worker means that, based on certain parameters, the same task will always be executed by the same worker. The way bound workers work is by using the returned string of the `computeWorkerKey` method. If the string was used before for a task, the call will be queued to the related worker that processed the task earlier; if not, it will be executed by the first available worker, then sticked to the worker that executed it; so the next time it will be processed by the same worker. If you have no preference on the worker executing the task, but you have defined a `computeWorkerKey` method because you want _some_ of the tasks to be sticked, you can return `null` from it.
|
||||
|
||||
The list of exposed methods can be explicitly provided via the `exposedMethods` option. If it is not provided, it will be obtained by requiring the child module into the main process, and analyzed via reflection. Check the "minimal example" section for a valid one.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
yarn add jest-worker
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
This example covers the minimal usage:
|
||||
|
||||
### File `parent.js`
|
||||
|
||||
```js
|
||||
import {Worker as JestWorker} from 'jest-worker';
|
||||
|
||||
async function main() {
|
||||
const worker = new JestWorker(require.resolve('./worker'));
|
||||
const result = await worker.hello('Alice'); // "Hello, Alice"
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
||||
### File `worker.js`
|
||||
|
||||
```js
|
||||
export function hello(param) {
|
||||
return `Hello, ${param}`;
|
||||
}
|
||||
```
|
||||
|
||||
## Experimental worker
|
||||
|
||||
Node shipped with [`worker_threads`](https://nodejs.org/api/worker_threads.html), a "threading API" that uses `SharedArrayBuffers` to communicate between the main process and its child threads. This feature can significantly improve the communication time between parent and child processes in `jest-worker`.
|
||||
|
||||
To use `worker_threads` instead of default `child_process` you have to pass `enableWorkerThreads: true` when instantiating the worker.
|
||||
|
||||
## API
|
||||
|
||||
The `Worker` export is a constructor that is initialized by passing the worker path, plus an options object.
|
||||
|
||||
### `workerPath: string | URL` (required)
|
||||
|
||||
Node module name or absolute path or file URL of the file to be loaded in the child processes. You can use `require.resolve` to transform a relative path into an absolute one.
|
||||
|
||||
### `options: Object` (optional)
|
||||
|
||||
#### `computeWorkerKey: (method: string, ...args: Array<unknown>) => string | null` (optional)
|
||||
|
||||
Every time a method exposed via the API is called, `computeWorkerKey` is also called in order to bound the call to a worker. This is useful for workers that are able to cache the result or part of it. You bound calls to a worker by making `computeWorkerKey` return the same identifier for all different calls. If you do not want to bind the call to any worker, return `null`.
|
||||
|
||||
The callback you provide is called with the method name, plus all the rest of the arguments of the call. Thus, you have full control to decide what to return. Check a practical example on bound workers under the "bound worker usage" section.
|
||||
|
||||
By default, no process is bound to any worker.
|
||||
|
||||
#### `enableWorkerThreads: boolean` (optional)
|
||||
|
||||
By default, `jest-worker` will use `child_process` threads to spawn new Node.js processes. If you prefer [`worker_threads`](https://nodejs.org/api/worker_threads.html) instead, pass `enableWorkerThreads: true`.
|
||||
|
||||
#### `exposedMethods: ReadonlyArray<string>` (optional)
|
||||
|
||||
List of method names that can be called on the child processes from the parent process. You cannot expose any method named like a public `Worker` method, or starting with `_`. If you use method auto-discovery, then these methods will not be exposed, even if they exist.
|
||||
|
||||
#### `forkOptions: ForkOptions` (optional)
|
||||
|
||||
Allow customizing all options passed to `child_process.fork`. By default, some values are set (`cwd`, `env`, `execArgv` and `serialization`), but you can override them and customize the rest. For a list of valid values, check [the Node documentation](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options).
|
||||
|
||||
#### `idleMemoryLimit: number` (optional)
|
||||
|
||||
Specifies the memory limit for workers before they are recycled and is primarily a work-around for [this issue](https://github.com/jestjs/jest/issues/11956);
|
||||
|
||||
After the worker has executed a task the memory usage of it is checked. If it exceeds the value specified the worker is killed and restarted. If no limit is set this process does not occur. The limit can be specified in 2 ways:
|
||||
|
||||
- `<= 1` - The value is assumed to be a percentage of system memory. So 0.5 sets the memory limit of the worker to half of the total system memory
|
||||
- `\> 1` - Assumed to be a fixed byte value. Because of the previous rule if you wanted a value of 1 byte (I don't know why) you could use `1.1`.
|
||||
|
||||
#### `maxRetries: number` (optional)
|
||||
|
||||
Maximum amount of times that a dead child can be re-spawned, per call. Defaults to `3`, pass `Infinity` to allow endless retries.
|
||||
|
||||
#### `numWorkers: number` (optional)
|
||||
|
||||
Amount of workers to spawn. Defaults to the number of CPUs minus 1.
|
||||
|
||||
#### `resourceLimits: ResourceLimits` (optional)
|
||||
|
||||
The `resourceLimits` option which will be passed to `worker_threads` workers.
|
||||
|
||||
#### `silent: Boolean` (optional)
|
||||
|
||||
Set to false for `stdout` and `stderr` to be logged to console.
|
||||
|
||||
By default this is true.
|
||||
|
||||
#### `setupArgs: Array<unknown>` (optional)
|
||||
|
||||
The arguments that will be passed to the `setup` method during initialization.
|
||||
|
||||
#### `taskQueue: TaskQueue` (optional)
|
||||
|
||||
The task queue defines in which order tasks (method calls) are processed by the workers. `jest-worker` ships with a `FifoQueue` and `PriorityQueue`:
|
||||
|
||||
- `FifoQueue` (default): Processes the method calls (tasks) in the call order.
|
||||
- `PriorityQueue`: Processes the method calls by a computed priority in natural ordering (lower priorities first). Tasks with the same priority are processed in any order (FIFO not guaranteed). The constructor accepts a single argument, the function that is passed the name of the called function and the arguments and returns a numerical value for the priority: `new require('jest-worker').PriorityQueue((method, filename) => filename.length)`.
|
||||
|
||||
#### `WorkerPool: new (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface` (optional)
|
||||
|
||||
Provide a custom WorkerPool class to be used for spawning child processes.
|
||||
|
||||
#### `workerSchedulingPolicy: 'round-robin' | 'in-order'` (optional)
|
||||
|
||||
Specifies the policy how tasks are assigned to workers if multiple workers are _idle_:
|
||||
|
||||
- `round-robin` (default): The task will be sequentially distributed onto the workers. The first task is assigned to the worker 1, the second to the worker 2, to ensure that the work is distributed across workers.
|
||||
- `in-order`: The task will be assigned to the first free worker starting with worker 1 and only assign the work to worker 2 if the worker 1 is busy.
|
||||
|
||||
Tasks are always assigned to the first free worker as soon as tasks start to queue up. The scheduling policy does not define the task scheduling which is always first-in, first-out.
|
||||
|
||||
## JestWorker
|
||||
|
||||
### Methods
|
||||
|
||||
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`
|
||||
|
||||
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`.
|
||||
|
||||
#### `start()`
|
||||
|
||||
Starts up every worker and calls their `setup` function, if it exists. Returns a `Promise` which resolves when all workers are running and have completed their `setup`.
|
||||
|
||||
This is useful if you want to start up all your workers eagerly before they are used to call any other functions.
|
||||
|
||||
#### `end()`
|
||||
|
||||
Finishes the workers by killing all workers. No further calls can be done to the `Worker` instance.
|
||||
|
||||
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
|
||||
|
||||
The child process can define two special methods (both of them can be asynchronous):
|
||||
|
||||
- `setup()`: If defined, it's executed before the first call to any method in the child.
|
||||
- `teardown()`: If defined, it's executed when the farm ends.
|
||||
|
||||
# More examples
|
||||
|
||||
## Standard usage
|
||||
|
||||
This example covers the standard usage:
|
||||
|
||||
### File `parent.js`
|
||||
|
||||
```js
|
||||
import {Worker as JestWorker} from 'jest-worker';
|
||||
|
||||
async function main() {
|
||||
const myWorker = new JestWorker(require.resolve('./worker'), {
|
||||
exposedMethods: ['foo', 'bar', 'getWorkerId'],
|
||||
numWorkers: 4,
|
||||
});
|
||||
|
||||
console.log(await myWorker.foo('Alice')); // "Hello from foo: Alice"
|
||||
console.log(await myWorker.bar('Bob')); // "Hello from bar: Bob"
|
||||
console.log(await myWorker.getWorkerId()); // "3" -> this message has sent from the 3rd worker
|
||||
|
||||
const {forceExited} = await myWorker.end();
|
||||
if (forceExited) {
|
||||
console.error('Workers failed to exit gracefully');
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
||||
### File `worker.js`
|
||||
|
||||
```js
|
||||
export function foo(param) {
|
||||
return `Hello from foo: ${param}`;
|
||||
}
|
||||
|
||||
export function bar(param) {
|
||||
return `Hello from bar: ${param}`;
|
||||
}
|
||||
|
||||
export function getWorkerId() {
|
||||
return process.env.JEST_WORKER_ID;
|
||||
}
|
||||
```
|
||||
|
||||
## Bound worker usage:
|
||||
|
||||
This example covers the usage with a `computeWorkerKey` method:
|
||||
|
||||
### File `parent.js`
|
||||
|
||||
```js
|
||||
import {Worker as JestWorker} from 'jest-worker';
|
||||
|
||||
async function main() {
|
||||
const myWorker = new JestWorker(require.resolve('./worker'), {
|
||||
computeWorkerKey: (method, filename) => filename,
|
||||
});
|
||||
|
||||
// Transform the given file, within the first available worker.
|
||||
console.log(await myWorker.transform('/tmp/foo.js'));
|
||||
|
||||
// Wait a bit.
|
||||
await sleep(10_000);
|
||||
|
||||
// Transform the same file again. Will immediately return because the
|
||||
// transformed file is cached in the worker, and `computeWorkerKey` ensures
|
||||
// the same worker that processed the file the first time will process it now.
|
||||
console.log(await myWorker.transform('/tmp/foo.js'));
|
||||
|
||||
const {forceExited} = await myWorker.end();
|
||||
if (forceExited) {
|
||||
console.error('Workers failed to exit gracefully');
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
||||
### File `worker.js`
|
||||
|
||||
```js
|
||||
import babel from '@babel/core';
|
||||
|
||||
const cache = Object.create(null);
|
||||
|
||||
export function transform(filename) {
|
||||
if (cache[filename]) {
|
||||
return cache[filename];
|
||||
}
|
||||
|
||||
// jest-worker can handle both immediate results and thenables. If a
|
||||
// thenable is returned, it will be await'ed until it resolves.
|
||||
return babel.transformFileAsync(filename).then(result => {
|
||||
cache[filename] = result;
|
||||
|
||||
return result;
|
||||
});
|
||||
}
|
||||
```
|
||||
353
frontend/node_modules/jest-worker/build/index.d.ts
generated
vendored
Normal file
353
frontend/node_modules/jest-worker/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,353 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import {ForkOptions} from 'child_process';
|
||||
import {ResourceLimits} from 'worker_threads';
|
||||
|
||||
declare const CHILD_MESSAGE_CALL = 1;
|
||||
|
||||
declare const CHILD_MESSAGE_CALL_SETUP = 4;
|
||||
|
||||
declare const CHILD_MESSAGE_END = 2;
|
||||
|
||||
declare const CHILD_MESSAGE_INITIALIZE = 0;
|
||||
|
||||
declare const CHILD_MESSAGE_MEM_USAGE = 3;
|
||||
|
||||
declare type ChildMessage =
|
||||
| ChildMessageInitialize
|
||||
| ChildMessageCall
|
||||
| ChildMessageEnd
|
||||
| ChildMessageMemUsage
|
||||
| ChildMessageCallSetup;
|
||||
|
||||
declare type ChildMessageCall = [
|
||||
type: typeof CHILD_MESSAGE_CALL,
|
||||
isProcessed: boolean,
|
||||
methodName: string,
|
||||
args: Array<unknown>,
|
||||
];
|
||||
|
||||
declare type ChildMessageCallSetup = [type: typeof CHILD_MESSAGE_CALL_SETUP];
|
||||
|
||||
declare type ChildMessageEnd = [
|
||||
type: typeof CHILD_MESSAGE_END,
|
||||
isProcessed: boolean,
|
||||
];
|
||||
|
||||
declare type ChildMessageInitialize = [
|
||||
type: typeof CHILD_MESSAGE_INITIALIZE,
|
||||
isProcessed: boolean,
|
||||
fileName: string,
|
||||
setupArgs: Array<unknown>,
|
||||
workerId: string | undefined,
|
||||
];
|
||||
|
||||
declare type ChildMessageMemUsage = [type: typeof CHILD_MESSAGE_MEM_USAGE];
|
||||
|
||||
declare type ComputeTaskPriorityCallback = (
|
||||
method: string,
|
||||
...args: Array<unknown>
|
||||
) => number;
|
||||
|
||||
declare type ExcludeReservedKeys<K> = Exclude<K, ReservedKeys>;
|
||||
|
||||
/**
|
||||
* First-in, First-out task queue that manages a dedicated pool
|
||||
* for each worker as well as a shared queue. The FIFO ordering is guaranteed
|
||||
* across the worker specific and shared queue.
|
||||
*/
|
||||
export declare class FifoQueue implements TaskQueue {
|
||||
private _workerQueues;
|
||||
private readonly _sharedQueue;
|
||||
enqueue(task: QueueChildMessage, workerId?: number): void;
|
||||
dequeue(workerId: number): QueueChildMessage | null;
|
||||
}
|
||||
|
||||
declare type FunctionLike = (...args: any) => unknown;
|
||||
|
||||
declare type HeapItem = {
|
||||
priority: number;
|
||||
};
|
||||
|
||||
export declare type JestWorkerFarm<T extends Record<string, unknown>> =
|
||||
Worker_2 & WorkerModule<T>;
|
||||
|
||||
export declare function messageParent(
|
||||
message: unknown,
|
||||
parentProcess?: NodeJS.Process,
|
||||
): void;
|
||||
|
||||
declare type MethodLikeKeys<T> = {
|
||||
[K in keyof T]: T[K] extends FunctionLike ? K : never;
|
||||
}[keyof T];
|
||||
|
||||
declare class MinHeap<TItem extends HeapItem> {
|
||||
private readonly _heap;
|
||||
peek(): TItem | null;
|
||||
add(item: TItem): void;
|
||||
poll(): TItem | null;
|
||||
}
|
||||
|
||||
declare type OnCustomMessage = (message: Array<unknown> | unknown) => void;
|
||||
|
||||
declare type OnEnd = (err: Error | null, result: unknown) => void;
|
||||
|
||||
declare type OnStart = (worker: WorkerInterface) => void;
|
||||
|
||||
declare type OnStateChangeHandler = (
|
||||
state: WorkerStates,
|
||||
oldState: WorkerStates,
|
||||
) => void;
|
||||
|
||||
declare type PoolExitResult = {
|
||||
forceExited: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Priority queue that processes tasks in natural ordering (lower priority first)
|
||||
* according to the priority computed by the function passed in the constructor.
|
||||
*
|
||||
* FIFO ordering isn't guaranteed for tasks with the same priority.
|
||||
*
|
||||
* Worker specific tasks with the same priority as a non-worker specific task
|
||||
* are always processed first.
|
||||
*/
|
||||
export declare class PriorityQueue implements TaskQueue {
|
||||
private readonly _computePriority;
|
||||
private _queue;
|
||||
private readonly _sharedQueue;
|
||||
constructor(_computePriority: ComputeTaskPriorityCallback);
|
||||
enqueue(task: QueueChildMessage, workerId?: number): void;
|
||||
_enqueue(task: QueueChildMessage, queue: MinHeap<QueueItem>): void;
|
||||
dequeue(workerId: number): QueueChildMessage | null;
|
||||
_getWorkerQueue(workerId: number): MinHeap<QueueItem>;
|
||||
}
|
||||
|
||||
export declare interface PromiseWithCustomMessage<T> extends Promise<T> {
|
||||
UNSTABLE_onCustomMessage?: (listener: OnCustomMessage) => () => void;
|
||||
}
|
||||
|
||||
declare type Promisify<T extends FunctionLike> =
|
||||
ReturnType<T> extends Promise<infer R>
|
||||
? (...args: Parameters<T>) => Promise<R>
|
||||
: (...args: Parameters<T>) => Promise<ReturnType<T>>;
|
||||
|
||||
declare type QueueChildMessage = {
|
||||
request: ChildMessageCall;
|
||||
onStart: OnStart;
|
||||
onEnd: OnEnd;
|
||||
onCustomMessage: OnCustomMessage;
|
||||
};
|
||||
|
||||
declare type QueueItem = {
|
||||
task: QueueChildMessage;
|
||||
priority: number;
|
||||
};
|
||||
|
||||
declare type ReservedKeys =
|
||||
| 'end'
|
||||
| 'getStderr'
|
||||
| 'getStdout'
|
||||
| 'setup'
|
||||
| 'teardown';
|
||||
|
||||
export declare interface TaskQueue {
|
||||
/**
|
||||
* Enqueues the task in the queue for the specified worker or adds it to the
|
||||
* queue shared by all workers
|
||||
* @param task the task to queue
|
||||
* @param workerId the id of the worker that should process this task or undefined
|
||||
* if there's no preference.
|
||||
*/
|
||||
enqueue(task: QueueChildMessage, workerId?: number): void;
|
||||
/**
|
||||
* Dequeues the next item from the queue for the specified worker
|
||||
* @param workerId the id of the worker for which the next task should be retrieved
|
||||
*/
|
||||
dequeue(workerId: number): QueueChildMessage | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* is done by providing an absolute path to a module that will be loaded on each
|
||||
* of the child processes, and bridged to the main process.
|
||||
*
|
||||
* Bridged methods are specified by using the "exposedMethods" property of the
|
||||
* "options" object. This is an array of strings, where each of them corresponds
|
||||
* to the exported name in the loaded module.
|
||||
*
|
||||
* You can also control the amount of workers by using the "numWorkers" property
|
||||
* of the "options" object, and the settings passed to fork the process through
|
||||
* the "forkOptions" property. The amount of workers defaults to the amount of
|
||||
* CPUS minus one.
|
||||
*
|
||||
* Queueing calls can be done in two ways:
|
||||
* - Standard method: calls will be redirected to the first available worker,
|
||||
* so they will get executed as soon as they can.
|
||||
*
|
||||
* - Sticky method: if a "computeWorkerKey" method is provided within the
|
||||
* config, the resulting string of this method will be used as a key.
|
||||
* Every time this key is returned, it is guaranteed that your job will be
|
||||
* processed by the same worker. This is specially useful if your workers
|
||||
* are caching results.
|
||||
*/
|
||||
declare class Worker_2 {
|
||||
private _ending;
|
||||
private readonly _farm;
|
||||
private readonly _options;
|
||||
private readonly _workerPool;
|
||||
constructor(workerPath: string | URL, options?: WorkerFarmOptions);
|
||||
private _bindExposedWorkerMethods;
|
||||
private _callFunctionWithArgs;
|
||||
getStderr(): NodeJS.ReadableStream;
|
||||
getStdout(): NodeJS.ReadableStream;
|
||||
start(): Promise<void>;
|
||||
end(): Promise<PoolExitResult>;
|
||||
}
|
||||
export {Worker_2 as Worker};
|
||||
|
||||
declare type WorkerCallback = (
|
||||
workerId: number,
|
||||
request: ChildMessage,
|
||||
onStart: OnStart,
|
||||
onEnd: OnEnd,
|
||||
onCustomMessage: OnCustomMessage,
|
||||
) => void;
|
||||
|
||||
declare enum WorkerEvents {
|
||||
STATE_CHANGE = 'state-change',
|
||||
}
|
||||
|
||||
export declare type WorkerFarmOptions = {
|
||||
computeWorkerKey?: (method: string, ...args: Array<unknown>) => string | null;
|
||||
enableWorkerThreads?: boolean;
|
||||
exposedMethods?: ReadonlyArray<string>;
|
||||
forkOptions?: ForkOptions;
|
||||
maxRetries?: number;
|
||||
numWorkers?: number;
|
||||
resourceLimits?: ResourceLimits;
|
||||
setupArgs?: Array<unknown>;
|
||||
taskQueue?: TaskQueue;
|
||||
WorkerPool?: new (
|
||||
workerPath: string,
|
||||
options?: WorkerPoolOptions,
|
||||
) => WorkerPoolInterface;
|
||||
workerSchedulingPolicy?: WorkerSchedulingPolicy;
|
||||
idleMemoryLimit?: number;
|
||||
};
|
||||
|
||||
declare interface WorkerInterface {
|
||||
get state(): WorkerStates;
|
||||
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;
|
||||
/**
|
||||
* Some system level identifier for the worker. IE, process id, thread id, etc.
|
||||
*/
|
||||
getWorkerSystemId(): number;
|
||||
getMemoryUsage(): Promise<number | null>;
|
||||
/**
|
||||
* Checks to see if the child worker is actually running.
|
||||
*/
|
||||
isWorkerRunning(): boolean;
|
||||
/**
|
||||
* When the worker child is started and ready to start handling requests.
|
||||
*
|
||||
* @remarks
|
||||
* This mostly exists to help with testing so that you don't check the status
|
||||
* of things like isWorkerRunning before it actually is.
|
||||
*/
|
||||
waitForWorkerReady(): Promise<void>;
|
||||
}
|
||||
|
||||
declare type WorkerModule<T> = {
|
||||
[K in keyof T as Extract<
|
||||
ExcludeReservedKeys<K>,
|
||||
MethodLikeKeys<T>
|
||||
>]: T[K] extends FunctionLike ? Promisify<T[K]> : never;
|
||||
};
|
||||
|
||||
declare type WorkerOptions_2 = {
|
||||
forkOptions: ForkOptions;
|
||||
resourceLimits: ResourceLimits;
|
||||
setupArgs: Array<unknown>;
|
||||
maxRetries: number;
|
||||
workerId: number;
|
||||
workerData?: unknown;
|
||||
workerPath: string;
|
||||
/**
|
||||
* After a job has executed the memory usage it should return to.
|
||||
*
|
||||
* @remarks
|
||||
* Note this is different from ResourceLimits in that it checks at idle, after
|
||||
* a job is complete. So you could have a resource limit of 500MB but an idle
|
||||
* limit of 50MB. The latter will only trigger if after a job has completed the
|
||||
* memory usage hasn't returned back down under 50MB.
|
||||
*/
|
||||
idleMemoryLimit?: number;
|
||||
/**
|
||||
* This mainly exists so the path can be changed during testing.
|
||||
* https://github.com/jestjs/jest/issues/9543
|
||||
*/
|
||||
childWorkerPath?: string;
|
||||
/**
|
||||
* This is useful for debugging individual tests allowing you to see
|
||||
* the raw output of the worker.
|
||||
*/
|
||||
silent?: boolean;
|
||||
/**
|
||||
* Used to immediately bind event handlers.
|
||||
*/
|
||||
on?: {
|
||||
[WorkerEvents.STATE_CHANGE]:
|
||||
| OnStateChangeHandler
|
||||
| ReadonlyArray<OnStateChangeHandler>;
|
||||
};
|
||||
};
|
||||
|
||||
export declare interface WorkerPoolInterface {
|
||||
getStderr(): NodeJS.ReadableStream;
|
||||
getStdout(): NodeJS.ReadableStream;
|
||||
getWorkers(): Array<WorkerInterface>;
|
||||
createWorker(options: WorkerOptions_2): WorkerInterface;
|
||||
send: WorkerCallback;
|
||||
start(): Promise<void>;
|
||||
end(): Promise<PoolExitResult>;
|
||||
}
|
||||
|
||||
export declare type WorkerPoolOptions = {
|
||||
setupArgs: Array<unknown>;
|
||||
forkOptions: ForkOptions;
|
||||
resourceLimits: ResourceLimits;
|
||||
maxRetries: number;
|
||||
numWorkers: number;
|
||||
enableWorkerThreads: boolean;
|
||||
idleMemoryLimit?: number;
|
||||
};
|
||||
|
||||
declare type WorkerSchedulingPolicy = 'round-robin' | 'in-order';
|
||||
|
||||
declare enum WorkerStates {
|
||||
STARTING = 'starting',
|
||||
OK = 'ok',
|
||||
OUT_OF_MEMORY = 'oom',
|
||||
RESTARTING = 'restarting',
|
||||
SHUTTING_DOWN = 'shutting-down',
|
||||
SHUT_DOWN = 'shut-down',
|
||||
}
|
||||
|
||||
export {};
|
||||
1902
frontend/node_modules/jest-worker/build/index.js
generated
vendored
Normal file
1902
frontend/node_modules/jest-worker/build/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
frontend/node_modules/jest-worker/build/index.mjs
generated
vendored
Normal file
6
frontend/node_modules/jest-worker/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const FifoQueue = cjsModule.FifoQueue;
|
||||
export const PriorityQueue = cjsModule.PriorityQueue;
|
||||
export const Worker = cjsModule.Worker;
|
||||
export const messageParent = cjsModule.messageParent;
|
||||
310
frontend/node_modules/jest-worker/build/processChild.js
generated
vendored
Normal file
310
frontend/node_modules/jest-worker/build/processChild.js
generated
vendored
Normal file
@@ -0,0 +1,310 @@
|
||||
/*!
|
||||
* /**
|
||||
* * Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* *
|
||||
* * This source code is licensed under the MIT license found in the
|
||||
* * LICENSE file in the root directory of this source tree.
|
||||
* * /
|
||||
*/
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "./src/types.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.WorkerStates = exports.WorkerEvents = exports.PARENT_MESSAGE_SETUP_ERROR = exports.PARENT_MESSAGE_OK = exports.PARENT_MESSAGE_MEM_USAGE = exports.PARENT_MESSAGE_CUSTOM = exports.PARENT_MESSAGE_CLIENT_ERROR = exports.CHILD_MESSAGE_MEM_USAGE = exports.CHILD_MESSAGE_INITIALIZE = exports.CHILD_MESSAGE_END = exports.CHILD_MESSAGE_CALL_SETUP = exports.CHILD_MESSAGE_CALL = void 0;
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// 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 = exports.CHILD_MESSAGE_INITIALIZE = 0;
|
||||
const CHILD_MESSAGE_CALL = exports.CHILD_MESSAGE_CALL = 1;
|
||||
const CHILD_MESSAGE_END = exports.CHILD_MESSAGE_END = 2;
|
||||
const CHILD_MESSAGE_MEM_USAGE = exports.CHILD_MESSAGE_MEM_USAGE = 3;
|
||||
const CHILD_MESSAGE_CALL_SETUP = exports.CHILD_MESSAGE_CALL_SETUP = 4;
|
||||
const PARENT_MESSAGE_OK = exports.PARENT_MESSAGE_OK = 0;
|
||||
const PARENT_MESSAGE_CLIENT_ERROR = exports.PARENT_MESSAGE_CLIENT_ERROR = 1;
|
||||
const PARENT_MESSAGE_SETUP_ERROR = exports.PARENT_MESSAGE_SETUP_ERROR = 2;
|
||||
const PARENT_MESSAGE_CUSTOM = exports.PARENT_MESSAGE_CUSTOM = 3;
|
||||
const PARENT_MESSAGE_MEM_USAGE = exports.PARENT_MESSAGE_MEM_USAGE = 4;
|
||||
|
||||
// Option objects.
|
||||
|
||||
// Messages passed from the parent to the children.
|
||||
|
||||
// Messages passed from the children to the parent.
|
||||
|
||||
// Queue types.
|
||||
let WorkerStates = exports.WorkerStates = /*#__PURE__*/function (WorkerStates) {
|
||||
WorkerStates["STARTING"] = "starting";
|
||||
WorkerStates["OK"] = "ok";
|
||||
WorkerStates["OUT_OF_MEMORY"] = "oom";
|
||||
WorkerStates["RESTARTING"] = "restarting";
|
||||
WorkerStates["SHUTTING_DOWN"] = "shutting-down";
|
||||
WorkerStates["SHUT_DOWN"] = "shut-down";
|
||||
return WorkerStates;
|
||||
}({});
|
||||
let WorkerEvents = exports.WorkerEvents = /*#__PURE__*/function (WorkerEvents) {
|
||||
WorkerEvents["STATE_CHANGE"] = "state-change";
|
||||
return WorkerEvents;
|
||||
}({});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/workers/safeMessageTransferring.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.packMessage = packMessage;
|
||||
exports.unpackMessage = unpackMessage;
|
||||
function _structuredClone() {
|
||||
const data = require("@ungap/structured-clone");
|
||||
_structuredClone = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
function packMessage(message) {
|
||||
return {
|
||||
__STRUCTURED_CLONE_SERIALIZED__: true,
|
||||
/**
|
||||
* Use the `json: true` option to avoid errors
|
||||
* caused by `function` or `symbol` types.
|
||||
* It's not ideal to lose `function` and `symbol` types,
|
||||
* but reliability is more important.
|
||||
*/
|
||||
data: (0, _structuredClone().serialize)(message, {
|
||||
json: true
|
||||
})
|
||||
};
|
||||
}
|
||||
function isTransferringContainer(message) {
|
||||
return message != null && typeof message === 'object' && '__STRUCTURED_CLONE_SERIALIZED__' in message && 'data' in message;
|
||||
}
|
||||
function unpackMessage(message) {
|
||||
if (isTransferringContainer(message)) {
|
||||
return (0, _structuredClone().deserialize)(message.data);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
|
||||
|
||||
function _nodeUtil() {
|
||||
const data = require("node:util");
|
||||
_nodeUtil = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestUtil() {
|
||||
const data = require("jest-util");
|
||||
_jestUtil = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _types = __webpack_require__("./src/types.ts");
|
||||
var _safeMessageTransferring = __webpack_require__("./src/workers/safeMessageTransferring.ts");
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* This file is a small bootstrapper for workers. It sets up the communication
|
||||
* between the worker and the parent process, interpreting parent messages and
|
||||
* sending results back.
|
||||
*
|
||||
* The file loaded will be lazily initialized the first time any of the workers
|
||||
* is called. This is done for optimal performance: if the farm is initialized,
|
||||
* but no call is made to it, child Node processes will be consuming the least
|
||||
* possible amount of memory.
|
||||
*
|
||||
* If an invalid message is detected, the child will exit (by throwing) with a
|
||||
* non-zero exit code.
|
||||
*/
|
||||
const messageListener = request => {
|
||||
switch (request[0]) {
|
||||
case _types.CHILD_MESSAGE_INITIALIZE:
|
||||
const init = request;
|
||||
file = init[2];
|
||||
setupArgs = init[3];
|
||||
break;
|
||||
case _types.CHILD_MESSAGE_CALL:
|
||||
const call = request;
|
||||
execMethod(call[2], call[3]);
|
||||
break;
|
||||
case _types.CHILD_MESSAGE_END:
|
||||
end();
|
||||
break;
|
||||
case _types.CHILD_MESSAGE_MEM_USAGE:
|
||||
reportMemoryUsage();
|
||||
break;
|
||||
case _types.CHILD_MESSAGE_CALL_SETUP:
|
||||
if (initialized) {
|
||||
reportSuccess(void 0);
|
||||
} else {
|
||||
const main = require(file);
|
||||
initialized = true;
|
||||
if (main.setup) {
|
||||
execFunction(main.setup, main, setupArgs, reportSuccess, reportInitializeError);
|
||||
} else {
|
||||
reportSuccess(void 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new TypeError(`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');
|
||||
}
|
||||
try {
|
||||
process.send([_types.PARENT_MESSAGE_OK, result]);
|
||||
} catch (error) {
|
||||
if (_nodeUtil().types.isNativeError(error) &&
|
||||
// if .send is a function, it's a serialization issue
|
||||
!error.message.includes('.send is not a function')) {
|
||||
// Apply specific serialization only in error cases
|
||||
// to avoid affecting performance in regular cases.
|
||||
process.send([_types.PARENT_MESSAGE_OK, (0, _safeMessageTransferring.packMessage)(result)]);
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
function reportClientError(error) {
|
||||
return reportError(error, _types.PARENT_MESSAGE_CLIENT_ERROR);
|
||||
}
|
||||
function reportInitializeError(error) {
|
||||
return reportError(error, _types.PARENT_MESSAGE_SETUP_ERROR);
|
||||
}
|
||||
function reportMemoryUsage() {
|
||||
if (!process || !process.send) {
|
||||
throw new Error('Child can only be used on a forked process');
|
||||
}
|
||||
const msg = [_types.PARENT_MESSAGE_MEM_USAGE, process.memoryUsage().heapUsed];
|
||||
process.send(msg);
|
||||
}
|
||||
function reportError(error, type) {
|
||||
if (!process || !process.send) {
|
||||
throw new Error('Child can only be used on a forked process');
|
||||
}
|
||||
if (error == null) {
|
||||
error = new Error('"null" or "undefined" thrown');
|
||||
}
|
||||
process.send([type, error.constructor && error.constructor.name, error.message, error.stack, typeof error === 'object' ? {
|
||||
...error
|
||||
} : error]);
|
||||
}
|
||||
function end() {
|
||||
const main = require(file);
|
||||
if (!main.teardown) {
|
||||
exitProcess();
|
||||
return;
|
||||
}
|
||||
execFunction(main.teardown, main, [], exitProcess, exitProcess);
|
||||
}
|
||||
function exitProcess() {
|
||||
// Clean up open handles so the process ideally exits gracefully
|
||||
process.removeListener('message', messageListener);
|
||||
}
|
||||
function execMethod(method, args) {
|
||||
const main = require(file);
|
||||
let fn;
|
||||
if (method === 'default') {
|
||||
fn = main.__esModule ? main.default : main;
|
||||
} else {
|
||||
fn = main[method];
|
||||
}
|
||||
function execHelper() {
|
||||
execFunction(fn, main, args, reportSuccess, reportClientError);
|
||||
}
|
||||
if (initialized || !main.setup) {
|
||||
execHelper();
|
||||
return;
|
||||
}
|
||||
initialized = true;
|
||||
execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError);
|
||||
}
|
||||
function execFunction(fn, ctx, args, onResult, onError) {
|
||||
let result;
|
||||
try {
|
||||
result = fn.apply(ctx, args);
|
||||
} catch (error) {
|
||||
onError(error);
|
||||
return;
|
||||
}
|
||||
if ((0, _jestUtil().isPromise)(result)) {
|
||||
result.then(onResult, onError);
|
||||
} else {
|
||||
onResult(result);
|
||||
}
|
||||
}
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
347
frontend/node_modules/jest-worker/build/threadChild.js
generated
vendored
Normal file
347
frontend/node_modules/jest-worker/build/threadChild.js
generated
vendored
Normal file
@@ -0,0 +1,347 @@
|
||||
/*!
|
||||
* /**
|
||||
* * Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* *
|
||||
* * This source code is licensed under the MIT license found in the
|
||||
* * LICENSE file in the root directory of this source tree.
|
||||
* * /
|
||||
*/
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "./src/types.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.WorkerStates = exports.WorkerEvents = exports.PARENT_MESSAGE_SETUP_ERROR = exports.PARENT_MESSAGE_OK = exports.PARENT_MESSAGE_MEM_USAGE = exports.PARENT_MESSAGE_CUSTOM = exports.PARENT_MESSAGE_CLIENT_ERROR = exports.CHILD_MESSAGE_MEM_USAGE = exports.CHILD_MESSAGE_INITIALIZE = exports.CHILD_MESSAGE_END = exports.CHILD_MESSAGE_CALL_SETUP = exports.CHILD_MESSAGE_CALL = void 0;
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// 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 = exports.CHILD_MESSAGE_INITIALIZE = 0;
|
||||
const CHILD_MESSAGE_CALL = exports.CHILD_MESSAGE_CALL = 1;
|
||||
const CHILD_MESSAGE_END = exports.CHILD_MESSAGE_END = 2;
|
||||
const CHILD_MESSAGE_MEM_USAGE = exports.CHILD_MESSAGE_MEM_USAGE = 3;
|
||||
const CHILD_MESSAGE_CALL_SETUP = exports.CHILD_MESSAGE_CALL_SETUP = 4;
|
||||
const PARENT_MESSAGE_OK = exports.PARENT_MESSAGE_OK = 0;
|
||||
const PARENT_MESSAGE_CLIENT_ERROR = exports.PARENT_MESSAGE_CLIENT_ERROR = 1;
|
||||
const PARENT_MESSAGE_SETUP_ERROR = exports.PARENT_MESSAGE_SETUP_ERROR = 2;
|
||||
const PARENT_MESSAGE_CUSTOM = exports.PARENT_MESSAGE_CUSTOM = 3;
|
||||
const PARENT_MESSAGE_MEM_USAGE = exports.PARENT_MESSAGE_MEM_USAGE = 4;
|
||||
|
||||
// Option objects.
|
||||
|
||||
// Messages passed from the parent to the children.
|
||||
|
||||
// Messages passed from the children to the parent.
|
||||
|
||||
// Queue types.
|
||||
let WorkerStates = exports.WorkerStates = /*#__PURE__*/function (WorkerStates) {
|
||||
WorkerStates["STARTING"] = "starting";
|
||||
WorkerStates["OK"] = "ok";
|
||||
WorkerStates["OUT_OF_MEMORY"] = "oom";
|
||||
WorkerStates["RESTARTING"] = "restarting";
|
||||
WorkerStates["SHUTTING_DOWN"] = "shutting-down";
|
||||
WorkerStates["SHUT_DOWN"] = "shut-down";
|
||||
return WorkerStates;
|
||||
}({});
|
||||
let WorkerEvents = exports.WorkerEvents = /*#__PURE__*/function (WorkerEvents) {
|
||||
WorkerEvents["STATE_CHANGE"] = "state-change";
|
||||
return WorkerEvents;
|
||||
}({});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/workers/isDataCloneError.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.isDataCloneError = isDataCloneError;
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// https://webidl.spec.whatwg.org/#datacloneerror
|
||||
const DATA_CLONE_ERROR_CODE = 25;
|
||||
|
||||
/**
|
||||
* Unfortunately, [`util.types.isNativeError(value)`](https://nodejs.org/api/util.html#utiltypesisnativeerrorvalue)
|
||||
* return `false` for `DataCloneError` error.
|
||||
* For this reason, try to detect it in this way
|
||||
*/
|
||||
function isDataCloneError(error) {
|
||||
return error != null && typeof error === 'object' && 'name' in error && error.name === 'DataCloneError' && 'message' in error && typeof error.message === 'string' && 'code' in error && error.code === DATA_CLONE_ERROR_CODE;
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/workers/safeMessageTransferring.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.packMessage = packMessage;
|
||||
exports.unpackMessage = unpackMessage;
|
||||
function _structuredClone() {
|
||||
const data = require("@ungap/structured-clone");
|
||||
_structuredClone = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
function packMessage(message) {
|
||||
return {
|
||||
__STRUCTURED_CLONE_SERIALIZED__: true,
|
||||
/**
|
||||
* Use the `json: true` option to avoid errors
|
||||
* caused by `function` or `symbol` types.
|
||||
* It's not ideal to lose `function` and `symbol` types,
|
||||
* but reliability is more important.
|
||||
*/
|
||||
data: (0, _structuredClone().serialize)(message, {
|
||||
json: true
|
||||
})
|
||||
};
|
||||
}
|
||||
function isTransferringContainer(message) {
|
||||
return message != null && typeof message === 'object' && '__STRUCTURED_CLONE_SERIALIZED__' in message && 'data' in message;
|
||||
}
|
||||
function unpackMessage(message) {
|
||||
if (isTransferringContainer(message)) {
|
||||
return (0, _structuredClone().deserialize)(message.data);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
|
||||
|
||||
function _worker_threads() {
|
||||
const data = require("worker_threads");
|
||||
_worker_threads = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestUtil() {
|
||||
const data = require("jest-util");
|
||||
_jestUtil = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _types = __webpack_require__("./src/types.ts");
|
||||
var _isDataCloneError = __webpack_require__("./src/workers/isDataCloneError.ts");
|
||||
var _safeMessageTransferring = __webpack_require__("./src/workers/safeMessageTransferring.ts");
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* This file is a small bootstrapper for workers. It sets up the communication
|
||||
* between the worker and the parent process, interpreting parent messages and
|
||||
* sending results back.
|
||||
*
|
||||
* The file loaded will be lazily initialized the first time any of the workers
|
||||
* is called. This is done for optimal performance: if the farm is initialized,
|
||||
* but no call is made to it, child Node processes will be consuming the least
|
||||
* possible amount of memory.
|
||||
*
|
||||
* If an invalid message is detected, the child will exit (by throwing) with a
|
||||
* non-zero exit code.
|
||||
*/
|
||||
const messageListener = request => {
|
||||
switch (request[0]) {
|
||||
case _types.CHILD_MESSAGE_INITIALIZE:
|
||||
const init = request;
|
||||
file = init[2];
|
||||
setupArgs = init[3];
|
||||
process.env.JEST_WORKER_ID = init[4];
|
||||
break;
|
||||
case _types.CHILD_MESSAGE_CALL:
|
||||
const call = request;
|
||||
execMethod(call[2], call[3]);
|
||||
break;
|
||||
case _types.CHILD_MESSAGE_END:
|
||||
end();
|
||||
break;
|
||||
case _types.CHILD_MESSAGE_MEM_USAGE:
|
||||
reportMemoryUsage();
|
||||
break;
|
||||
case _types.CHILD_MESSAGE_CALL_SETUP:
|
||||
if (initialized) {
|
||||
reportSuccess(void 0);
|
||||
} else {
|
||||
const main = require(file);
|
||||
initialized = true;
|
||||
if (main.setup) {
|
||||
execFunction(main.setup, main, setupArgs, reportSuccess, reportInitializeError);
|
||||
} else {
|
||||
reportSuccess(void 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new TypeError(`Unexpected request from parent process: ${request[0]}`);
|
||||
}
|
||||
};
|
||||
_worker_threads().parentPort.on('message', messageListener);
|
||||
function reportMemoryUsage() {
|
||||
if (_worker_threads().isMainThread) {
|
||||
throw new Error('Child can only be used on a forked process');
|
||||
}
|
||||
const msg = [_types.PARENT_MESSAGE_MEM_USAGE, process.memoryUsage().heapUsed];
|
||||
_worker_threads().parentPort.postMessage(msg);
|
||||
}
|
||||
function reportSuccess(result) {
|
||||
if (_worker_threads().isMainThread) {
|
||||
throw new Error('Child can only be used on a forked process');
|
||||
}
|
||||
try {
|
||||
_worker_threads().parentPort.postMessage([_types.PARENT_MESSAGE_OK, result]);
|
||||
} catch (error) {
|
||||
let resolvedError = error;
|
||||
// Try to handle https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal
|
||||
// for `symbols` and `functions`
|
||||
if ((0, _isDataCloneError.isDataCloneError)(error)) {
|
||||
try {
|
||||
_worker_threads().parentPort.postMessage([_types.PARENT_MESSAGE_OK, (0, _safeMessageTransferring.packMessage)(result)]);
|
||||
return;
|
||||
} catch (secondTryError) {
|
||||
resolvedError = secondTryError;
|
||||
}
|
||||
}
|
||||
// Handling it here to avoid unhandled rejection
|
||||
// which is hard to distinguish on the parent side
|
||||
reportClientError(resolvedError);
|
||||
}
|
||||
}
|
||||
function reportClientError(error) {
|
||||
return reportError(error, _types.PARENT_MESSAGE_CLIENT_ERROR);
|
||||
}
|
||||
function reportInitializeError(error) {
|
||||
return reportError(error, _types.PARENT_MESSAGE_SETUP_ERROR);
|
||||
}
|
||||
function reportError(error, type) {
|
||||
if (_worker_threads().isMainThread) {
|
||||
throw new Error('Child can only be used on a forked process');
|
||||
}
|
||||
if (error == null) {
|
||||
error = new Error('"null" or "undefined" thrown');
|
||||
}
|
||||
_worker_threads().parentPort.postMessage([type, error.constructor && error.constructor.name, error.message, error.stack, typeof error === 'object' ? {
|
||||
...error
|
||||
} : error]);
|
||||
}
|
||||
function end() {
|
||||
const main = require(file);
|
||||
if (!main.teardown) {
|
||||
exitProcess();
|
||||
return;
|
||||
}
|
||||
execFunction(main.teardown, main, [], exitProcess, exitProcess);
|
||||
}
|
||||
function exitProcess() {
|
||||
// Clean up open handles so the worker ideally exits gracefully
|
||||
_worker_threads().parentPort.removeListener('message', messageListener);
|
||||
}
|
||||
function execMethod(method, args) {
|
||||
const main = require(file);
|
||||
let fn;
|
||||
if (method === 'default') {
|
||||
fn = main.__esModule ? main.default : main;
|
||||
} else {
|
||||
fn = main[method];
|
||||
}
|
||||
function execHelper() {
|
||||
execFunction(fn, main, args, reportSuccess, reportClientError);
|
||||
}
|
||||
if (initialized || !main.setup) {
|
||||
execHelper();
|
||||
return;
|
||||
}
|
||||
initialized = true;
|
||||
execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError);
|
||||
}
|
||||
function execFunction(fn, ctx, args, onResult, onError) {
|
||||
let result;
|
||||
try {
|
||||
result = fn.apply(ctx, args);
|
||||
} catch (error) {
|
||||
onError(error);
|
||||
return;
|
||||
}
|
||||
if ((0, _jestUtil().isPromise)(result)) {
|
||||
result.then(onResult, onError);
|
||||
} else {
|
||||
onResult(result);
|
||||
}
|
||||
}
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
24
frontend/node_modules/jest-worker/node_modules/supports-color/browser.js
generated
vendored
Normal file
24
frontend/node_modules/jest-worker/node_modules/supports-color/browser.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/* eslint-env browser */
|
||||
'use strict';
|
||||
|
||||
function getChromeVersion() {
|
||||
const matches = /(Chrome|Chromium)\/(?<chromeVersion>\d+)\./.exec(navigator.userAgent);
|
||||
|
||||
if (!matches) {
|
||||
return;
|
||||
}
|
||||
|
||||
return Number.parseInt(matches.groups.chromeVersion, 10);
|
||||
}
|
||||
|
||||
const colorSupport = getChromeVersion() >= 69 ? {
|
||||
level: 1,
|
||||
hasBasic: true,
|
||||
has256: false,
|
||||
has16m: false
|
||||
} : false;
|
||||
|
||||
module.exports = {
|
||||
stdout: colorSupport,
|
||||
stderr: colorSupport
|
||||
};
|
||||
152
frontend/node_modules/jest-worker/node_modules/supports-color/index.js
generated
vendored
Normal file
152
frontend/node_modules/jest-worker/node_modules/supports-color/index.js
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
'use strict';
|
||||
const os = require('os');
|
||||
const tty = require('tty');
|
||||
const hasFlag = require('has-flag');
|
||||
|
||||
const {env} = process;
|
||||
|
||||
let flagForceColor;
|
||||
if (hasFlag('no-color') ||
|
||||
hasFlag('no-colors') ||
|
||||
hasFlag('color=false') ||
|
||||
hasFlag('color=never')) {
|
||||
flagForceColor = 0;
|
||||
} else if (hasFlag('color') ||
|
||||
hasFlag('colors') ||
|
||||
hasFlag('color=true') ||
|
||||
hasFlag('color=always')) {
|
||||
flagForceColor = 1;
|
||||
}
|
||||
|
||||
function envForceColor() {
|
||||
if ('FORCE_COLOR' in env) {
|
||||
if (env.FORCE_COLOR === 'true') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (env.FORCE_COLOR === 'false') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
||||
}
|
||||
}
|
||||
|
||||
function translateLevel(level) {
|
||||
if (level === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
level,
|
||||
hasBasic: true,
|
||||
has256: level >= 2,
|
||||
has16m: level >= 3
|
||||
};
|
||||
}
|
||||
|
||||
function supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
|
||||
const noFlagForceColor = envForceColor();
|
||||
if (noFlagForceColor !== undefined) {
|
||||
flagForceColor = noFlagForceColor;
|
||||
}
|
||||
|
||||
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
||||
|
||||
if (forceColor === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sniffFlags) {
|
||||
if (hasFlag('color=16m') ||
|
||||
hasFlag('color=full') ||
|
||||
hasFlag('color=truecolor')) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
if (hasFlag('color=256')) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const min = forceColor || 0;
|
||||
|
||||
if (env.TERM === 'dumb') {
|
||||
return min;
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
// 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(osRelease[0]) >= 10 &&
|
||||
Number(osRelease[2]) >= 10586
|
||||
) {
|
||||
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ('CI' in env) {
|
||||
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return min;
|
||||
}
|
||||
|
||||
if ('TEAMCITY_VERSION' in env) {
|
||||
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
||||
}
|
||||
|
||||
if (env.COLORTERM === 'truecolor') {
|
||||
return 3;
|
||||
}
|
||||
|
||||
if ('TERM_PROGRAM' in env) {
|
||||
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
||||
|
||||
switch (env.TERM_PROGRAM) {
|
||||
case 'iTerm.app':
|
||||
return version >= 3 ? 3 : 2;
|
||||
case 'Apple_Terminal':
|
||||
return 2;
|
||||
// No default
|
||||
}
|
||||
}
|
||||
|
||||
if (/-256(color)?$/i.test(env.TERM)) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ('COLORTERM' in env) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return min;
|
||||
}
|
||||
|
||||
function getSupportLevel(stream, options = {}) {
|
||||
const level = supportsColor(stream, {
|
||||
streamIsTTY: stream && stream.isTTY,
|
||||
...options
|
||||
});
|
||||
|
||||
return translateLevel(level);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
supportsColor: getSupportLevel,
|
||||
stdout: getSupportLevel({isTTY: tty.isatty(1)}),
|
||||
stderr: getSupportLevel({isTTY: tty.isatty(2)})
|
||||
};
|
||||
9
frontend/node_modules/jest-worker/node_modules/supports-color/license
generated
vendored
Normal file
9
frontend/node_modules/jest-worker/node_modules/supports-color/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://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.
|
||||
58
frontend/node_modules/jest-worker/node_modules/supports-color/package.json
generated
vendored
Normal file
58
frontend/node_modules/jest-worker/node_modules/supports-color/package.json
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "supports-color",
|
||||
"version": "8.1.1",
|
||||
"description": "Detect whether a terminal supports color",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/supports-color",
|
||||
"funding": "https://github.com/chalk/supports-color?sponsor=1",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"browser.js"
|
||||
],
|
||||
"exports": {
|
||||
"node": "./index.js",
|
||||
"default": "./browser.js"
|
||||
},
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"ansi",
|
||||
"styles",
|
||||
"tty",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"command-line",
|
||||
"support",
|
||||
"supports",
|
||||
"capability",
|
||||
"detect",
|
||||
"truecolor",
|
||||
"16m"
|
||||
],
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^2.4.0",
|
||||
"import-fresh": "^3.2.2",
|
||||
"xo": "^0.35.0"
|
||||
},
|
||||
"browser": "browser.js"
|
||||
}
|
||||
77
frontend/node_modules/jest-worker/node_modules/supports-color/readme.md
generated
vendored
Normal file
77
frontend/node_modules/jest-worker/node_modules/supports-color/readme.md
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
# supports-color
|
||||
|
||||
> Detect whether a terminal supports color
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install supports-color
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const supportsColor = require('supports-color');
|
||||
|
||||
if (supportsColor.stdout) {
|
||||
console.log('Terminal stdout supports color');
|
||||
}
|
||||
|
||||
if (supportsColor.stdout.has256) {
|
||||
console.log('Terminal stdout supports 256 colors');
|
||||
}
|
||||
|
||||
if (supportsColor.stderr.has16m) {
|
||||
console.log('Terminal stderr supports 16 million colors (truecolor)');
|
||||
}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
|
||||
|
||||
The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
|
||||
|
||||
- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
|
||||
- `.level = 2` and `.has256 = true`: 256 color support
|
||||
- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
|
||||
|
||||
### `require('supports-color').supportsColor(stream, options?)`
|
||||
|
||||
Additionally, `supports-color` exposes the `.supportsColor()` function that takes an arbitrary write stream (e.g. `process.stdout`) and an optional options object to (re-)evaluate color support for an arbitrary stream.
|
||||
|
||||
For example, `require('supports-color').stdout` is the equivalent of `require('supports-color').supportsColor(process.stdout)`.
|
||||
|
||||
The options object supports a single boolean property `sniffFlags`. By default it is `true`, which instructs `supportsColor()` to sniff `process.argv` for the multitude of `--color` flags (see _Info_ below). If `false`, then `process.argv` is not considered when determining color support.
|
||||
|
||||
## Info
|
||||
|
||||
It obeys the `--color` and `--no-color` CLI flags.
|
||||
|
||||
For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
|
||||
|
||||
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
|
||||
|
||||
## Related
|
||||
|
||||
- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
---
|
||||
|
||||
<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>
|
||||
|
||||
---
|
||||
44
frontend/node_modules/jest-worker/package.json
generated
vendored
Normal file
44
frontend/node_modules/jest-worker/package.json
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "jest-worker",
|
||||
"version": "30.0.2",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-worker"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "./build/index.js",
|
||||
"types": "./build/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./build/index.d.ts",
|
||||
"require": "./build/index.js",
|
||||
"import": "./build/index.mjs",
|
||||
"default": "./build/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@ungap/structured-clone": "^1.3.0",
|
||||
"jest-util": "30.0.2",
|
||||
"merge-stream": "^2.0.0",
|
||||
"supports-color": "^8.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.4",
|
||||
"@types/merge-stream": "^2.0.0",
|
||||
"@types/supports-color": "^8.1.3",
|
||||
"@types/ungap__structured-clone": "^1.2.0",
|
||||
"get-stream": "^6.0.0",
|
||||
"jest-leak-detector": "30.0.2",
|
||||
"worker-farm": "^1.7.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "393acbfac31f64bb38dff23c89224797caded83c"
|
||||
}
|
||||
Reference in New Issue
Block a user