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/console/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/console/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.
|
||||
105
frontend/node_modules/@jest/console/build/index.d.mts
generated
vendored
Normal file
105
frontend/node_modules/@jest/console/build/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
import { Console } from "console";
|
||||
import { InspectOptions } from "util";
|
||||
import { StackTraceConfig } from "jest-message-util";
|
||||
import { WriteStream } from "tty";
|
||||
import { Config } from "@jest/types";
|
||||
|
||||
//#region src/types.d.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.
|
||||
*/
|
||||
type LogMessage = string;
|
||||
type LogEntry = {
|
||||
message: LogMessage;
|
||||
origin: string;
|
||||
type: LogType;
|
||||
};
|
||||
type LogType = 'assert' | 'count' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'info' | 'log' | 'time' | 'warn';
|
||||
type ConsoleBuffer = Array<LogEntry>;
|
||||
//#endregion
|
||||
//#region src/BufferedConsole.d.ts
|
||||
declare class BufferedConsole extends Console {
|
||||
private readonly _buffer;
|
||||
private _counters;
|
||||
private _timers;
|
||||
private _groupDepth;
|
||||
Console: typeof Console;
|
||||
constructor();
|
||||
static write(this: void, buffer: ConsoleBuffer, type: LogType, message: LogMessage, stackLevel?: number): ConsoleBuffer;
|
||||
private _log;
|
||||
assert(value: unknown, message?: string | Error): void;
|
||||
count(label?: string): void;
|
||||
countReset(label?: string): void;
|
||||
debug(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
dir(firstArg: unknown, options?: InspectOptions): void;
|
||||
dirxml(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
error(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
group(title?: string, ...rest: Array<unknown>): void;
|
||||
groupCollapsed(title?: string, ...rest: Array<unknown>): void;
|
||||
groupEnd(): void;
|
||||
info(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
log(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
time(label?: string): void;
|
||||
timeEnd(label?: string): void;
|
||||
timeLog(label?: string, ...data: Array<unknown>): void;
|
||||
warn(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
getBuffer(): ConsoleBuffer | undefined;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/CustomConsole.d.ts
|
||||
type Formatter = (type: LogType, message: LogMessage) => string;
|
||||
declare class CustomConsole extends Console {
|
||||
private readonly _stdout;
|
||||
private readonly _stderr;
|
||||
private readonly _formatBuffer;
|
||||
private _counters;
|
||||
private _timers;
|
||||
private _groupDepth;
|
||||
Console: typeof Console;
|
||||
constructor(stdout: WriteStream, stderr: WriteStream, formatBuffer?: Formatter);
|
||||
private _log;
|
||||
private _logError;
|
||||
assert(value: unknown, message?: string | Error): asserts value;
|
||||
count(label?: string): void;
|
||||
countReset(label?: string): void;
|
||||
debug(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
dir(firstArg: unknown, options?: InspectOptions): void;
|
||||
dirxml(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
error(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
group(title?: string, ...args: Array<unknown>): void;
|
||||
groupCollapsed(title?: string, ...args: Array<unknown>): void;
|
||||
groupEnd(): void;
|
||||
info(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
log(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
time(label?: string): void;
|
||||
timeEnd(label?: string): void;
|
||||
timeLog(label?: string, ...data: Array<unknown>): void;
|
||||
warn(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
getBuffer(): undefined;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/NullConsole.d.ts
|
||||
declare class NullConsole extends CustomConsole {
|
||||
assert(): void;
|
||||
debug(): void;
|
||||
dir(): void;
|
||||
error(): void;
|
||||
info(): void;
|
||||
log(): void;
|
||||
time(): void;
|
||||
timeEnd(): void;
|
||||
timeLog(): void;
|
||||
trace(): void;
|
||||
warn(): void;
|
||||
group(): void;
|
||||
groupCollapsed(): void;
|
||||
groupEnd(): void;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/getConsoleOutput.d.ts
|
||||
declare function getConsoleOutput(buffer: ConsoleBuffer, config: StackTraceConfig, globalConfig: Config.GlobalConfig): string;
|
||||
//#endregion
|
||||
export { BufferedConsole, ConsoleBuffer, CustomConsole, LogEntry, LogMessage, LogType, NullConsole, getConsoleOutput };
|
||||
131
frontend/node_modules/@jest/console/build/index.d.ts
generated
vendored
Normal file
131
frontend/node_modules/@jest/console/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
* 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 {Console as Console_2} from 'console';
|
||||
import {WriteStream} from 'tty';
|
||||
import {InspectOptions} from 'util';
|
||||
import {Config} from '@jest/types';
|
||||
import {StackTraceConfig} from 'jest-message-util';
|
||||
|
||||
export declare class BufferedConsole extends Console_2 {
|
||||
private readonly _buffer;
|
||||
private _counters;
|
||||
private _timers;
|
||||
private _groupDepth;
|
||||
Console: typeof Console_2;
|
||||
constructor();
|
||||
static write(
|
||||
this: void,
|
||||
buffer: ConsoleBuffer,
|
||||
type: LogType,
|
||||
message: LogMessage,
|
||||
stackLevel?: number,
|
||||
): ConsoleBuffer;
|
||||
private _log;
|
||||
assert(value: unknown, message?: string | Error): void;
|
||||
count(label?: string): void;
|
||||
countReset(label?: string): void;
|
||||
debug(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
dir(firstArg: unknown, options?: InspectOptions): void;
|
||||
dirxml(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
error(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
group(title?: string, ...rest: Array<unknown>): void;
|
||||
groupCollapsed(title?: string, ...rest: Array<unknown>): void;
|
||||
groupEnd(): void;
|
||||
info(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
log(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
time(label?: string): void;
|
||||
timeEnd(label?: string): void;
|
||||
timeLog(label?: string, ...data: Array<unknown>): void;
|
||||
warn(firstArg: unknown, ...rest: Array<unknown>): void;
|
||||
getBuffer(): ConsoleBuffer | undefined;
|
||||
}
|
||||
|
||||
export declare type ConsoleBuffer = Array<LogEntry>;
|
||||
|
||||
export declare class CustomConsole extends Console_2 {
|
||||
private readonly _stdout;
|
||||
private readonly _stderr;
|
||||
private readonly _formatBuffer;
|
||||
private _counters;
|
||||
private _timers;
|
||||
private _groupDepth;
|
||||
Console: typeof Console_2;
|
||||
constructor(
|
||||
stdout: WriteStream,
|
||||
stderr: WriteStream,
|
||||
formatBuffer?: Formatter,
|
||||
);
|
||||
private _log;
|
||||
private _logError;
|
||||
assert(value: unknown, message?: string | Error): asserts value;
|
||||
count(label?: string): void;
|
||||
countReset(label?: string): void;
|
||||
debug(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
dir(firstArg: unknown, options?: InspectOptions): void;
|
||||
dirxml(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
error(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
group(title?: string, ...args: Array<unknown>): void;
|
||||
groupCollapsed(title?: string, ...args: Array<unknown>): void;
|
||||
groupEnd(): void;
|
||||
info(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
log(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
time(label?: string): void;
|
||||
timeEnd(label?: string): void;
|
||||
timeLog(label?: string, ...data: Array<unknown>): void;
|
||||
warn(firstArg: unknown, ...args: Array<unknown>): void;
|
||||
getBuffer(): undefined;
|
||||
}
|
||||
|
||||
declare type Formatter = (type: LogType, message: LogMessage) => string;
|
||||
|
||||
export declare function getConsoleOutput(
|
||||
buffer: ConsoleBuffer,
|
||||
config: StackTraceConfig,
|
||||
globalConfig: Config.GlobalConfig,
|
||||
): string;
|
||||
|
||||
export declare type LogEntry = {
|
||||
message: LogMessage;
|
||||
origin: string;
|
||||
type: LogType;
|
||||
};
|
||||
|
||||
export declare type LogMessage = string;
|
||||
|
||||
export declare type LogType =
|
||||
| 'assert'
|
||||
| 'count'
|
||||
| 'debug'
|
||||
| 'dir'
|
||||
| 'dirxml'
|
||||
| 'error'
|
||||
| 'group'
|
||||
| 'groupCollapsed'
|
||||
| 'info'
|
||||
| 'log'
|
||||
| 'time'
|
||||
| 'warn';
|
||||
|
||||
export declare class NullConsole extends CustomConsole {
|
||||
assert(): void;
|
||||
debug(): void;
|
||||
dir(): void;
|
||||
error(): void;
|
||||
info(): void;
|
||||
log(): void;
|
||||
time(): void;
|
||||
timeEnd(): void;
|
||||
timeLog(): void;
|
||||
trace(): void;
|
||||
warn(): void;
|
||||
group(): void;
|
||||
groupCollapsed(): void;
|
||||
groupEnd(): void;
|
||||
}
|
||||
|
||||
export {};
|
||||
521
frontend/node_modules/@jest/console/build/index.js
generated
vendored
Normal file
521
frontend/node_modules/@jest/console/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,521 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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/BufferedConsole.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = void 0;
|
||||
function _assert() {
|
||||
const data = require("assert");
|
||||
_assert = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _console() {
|
||||
const data = require("console");
|
||||
_console = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _util() {
|
||||
const data = require("util");
|
||||
_util = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require("chalk"));
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestUtil() {
|
||||
const data = require("jest-util");
|
||||
_jestUtil = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
class BufferedConsole extends _console().Console {
|
||||
_buffer = [];
|
||||
_counters = {};
|
||||
_timers = {};
|
||||
_groupDepth = 0;
|
||||
Console = _console().Console;
|
||||
constructor() {
|
||||
super({
|
||||
write: message => {
|
||||
BufferedConsole.write(this._buffer, 'log', message);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
static write(buffer, type, message, stackLevel = 2) {
|
||||
const rawStack = new (_jestUtil().ErrorWithStack)(undefined, BufferedConsole.write).stack;
|
||||
(0, _jestUtil().invariant)(rawStack != null, 'always have a stack trace');
|
||||
const origin = rawStack.split('\n').slice(stackLevel).filter(Boolean).join('\n');
|
||||
buffer.push({
|
||||
message,
|
||||
origin,
|
||||
type
|
||||
});
|
||||
return buffer;
|
||||
}
|
||||
_log(type, message) {
|
||||
BufferedConsole.write(this._buffer, type, ' '.repeat(this._groupDepth) + message, 3);
|
||||
}
|
||||
assert(value, message) {
|
||||
try {
|
||||
_assert().strict.ok(value, message);
|
||||
} catch (error) {
|
||||
if (!(error instanceof _assert().AssertionError)) {
|
||||
throw error;
|
||||
}
|
||||
// https://github.com/jestjs/jest/pull/13422#issuecomment-1273396392
|
||||
this._log('assert', error.toString().replaceAll(/:\n\n.*\n/gs, ''));
|
||||
}
|
||||
}
|
||||
count(label = 'default') {
|
||||
if (!this._counters[label]) {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
this._log('count', (0, _util().format)(`${label}: ${++this._counters[label]}`));
|
||||
}
|
||||
countReset(label = 'default') {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
debug(firstArg, ...rest) {
|
||||
this._log('debug', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
dir(firstArg, options = {}) {
|
||||
const representation = (0, _util().inspect)(firstArg, options);
|
||||
this._log('dir', (0, _util().formatWithOptions)(options, representation));
|
||||
}
|
||||
dirxml(firstArg, ...rest) {
|
||||
this._log('dirxml', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
error(firstArg, ...rest) {
|
||||
this._log('error', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
group(title, ...rest) {
|
||||
this._groupDepth++;
|
||||
if (title != null || rest.length > 0) {
|
||||
this._log('group', _chalk().default.bold((0, _util().format)(title, ...rest)));
|
||||
}
|
||||
}
|
||||
groupCollapsed(title, ...rest) {
|
||||
this._groupDepth++;
|
||||
if (title != null || rest.length > 0) {
|
||||
this._log('groupCollapsed', _chalk().default.bold((0, _util().format)(title, ...rest)));
|
||||
}
|
||||
}
|
||||
groupEnd() {
|
||||
if (this._groupDepth > 0) {
|
||||
this._groupDepth--;
|
||||
}
|
||||
}
|
||||
info(firstArg, ...rest) {
|
||||
this._log('info', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
log(firstArg, ...rest) {
|
||||
this._log('log', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
time(label = 'default') {
|
||||
if (this._timers[label] != null) {
|
||||
return;
|
||||
}
|
||||
this._timers[label] = new Date();
|
||||
}
|
||||
timeEnd(label = 'default') {
|
||||
const startTime = this._timers[label];
|
||||
if (startTime != null) {
|
||||
const endTime = new Date();
|
||||
const time = endTime.getTime() - startTime.getTime();
|
||||
this._log('time', (0, _util().format)(`${label}: ${(0, _jestUtil().formatTime)(time)}`));
|
||||
delete this._timers[label];
|
||||
}
|
||||
}
|
||||
timeLog(label = 'default', ...data) {
|
||||
const startTime = this._timers[label];
|
||||
if (startTime != null) {
|
||||
const endTime = new Date();
|
||||
const time = endTime.getTime() - startTime.getTime();
|
||||
this._log('time', (0, _util().format)(`${label}: ${(0, _jestUtil().formatTime)(time)}`, ...data));
|
||||
}
|
||||
}
|
||||
warn(firstArg, ...rest) {
|
||||
this._log('warn', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
getBuffer() {
|
||||
return this._buffer.length > 0 ? this._buffer : undefined;
|
||||
}
|
||||
}
|
||||
exports["default"] = BufferedConsole;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/CustomConsole.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = void 0;
|
||||
function _assert() {
|
||||
const data = require("assert");
|
||||
_assert = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _console() {
|
||||
const data = require("console");
|
||||
_console = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _util() {
|
||||
const data = require("util");
|
||||
_util = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require("chalk"));
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestUtil() {
|
||||
const data = require("jest-util");
|
||||
_jestUtil = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
class CustomConsole extends _console().Console {
|
||||
_stdout;
|
||||
_stderr;
|
||||
_formatBuffer;
|
||||
_counters = {};
|
||||
_timers = {};
|
||||
_groupDepth = 0;
|
||||
Console = _console().Console;
|
||||
constructor(stdout, stderr, formatBuffer = (_type, message) => message) {
|
||||
super(stdout, stderr);
|
||||
this._stdout = stdout;
|
||||
this._stderr = stderr;
|
||||
this._formatBuffer = formatBuffer;
|
||||
}
|
||||
_log(type, message) {
|
||||
(0, _jestUtil().clearLine)(this._stdout);
|
||||
super.log(this._formatBuffer(type, ' '.repeat(this._groupDepth) + message));
|
||||
}
|
||||
_logError(type, message) {
|
||||
(0, _jestUtil().clearLine)(this._stderr);
|
||||
super.error(this._formatBuffer(type, ' '.repeat(this._groupDepth) + message));
|
||||
}
|
||||
assert(value, message) {
|
||||
try {
|
||||
_assert().strict.ok(value, message);
|
||||
} catch (error) {
|
||||
if (!(error instanceof _assert().AssertionError)) {
|
||||
throw error;
|
||||
}
|
||||
// https://github.com/jestjs/jest/pull/13422#issuecomment-1273396392
|
||||
this._logError('assert', error.toString().replaceAll(/:\n\n.*\n/gs, ''));
|
||||
}
|
||||
}
|
||||
count(label = 'default') {
|
||||
if (!this._counters[label]) {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
this._log('count', (0, _util().format)(`${label}: ${++this._counters[label]}`));
|
||||
}
|
||||
countReset(label = 'default') {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
debug(firstArg, ...args) {
|
||||
this._log('debug', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
dir(firstArg, options = {}) {
|
||||
const representation = (0, _util().inspect)(firstArg, options);
|
||||
this._log('dir', (0, _util().formatWithOptions)(options, representation));
|
||||
}
|
||||
dirxml(firstArg, ...args) {
|
||||
this._log('dirxml', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
error(firstArg, ...args) {
|
||||
this._logError('error', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
group(title, ...args) {
|
||||
this._groupDepth++;
|
||||
if (title != null || args.length > 0) {
|
||||
this._log('group', _chalk().default.bold((0, _util().format)(title, ...args)));
|
||||
}
|
||||
}
|
||||
groupCollapsed(title, ...args) {
|
||||
this._groupDepth++;
|
||||
if (title != null || args.length > 0) {
|
||||
this._log('groupCollapsed', _chalk().default.bold((0, _util().format)(title, ...args)));
|
||||
}
|
||||
}
|
||||
groupEnd() {
|
||||
if (this._groupDepth > 0) {
|
||||
this._groupDepth--;
|
||||
}
|
||||
}
|
||||
info(firstArg, ...args) {
|
||||
this._log('info', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
log(firstArg, ...args) {
|
||||
this._log('log', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
time(label = 'default') {
|
||||
if (this._timers[label] != null) {
|
||||
return;
|
||||
}
|
||||
this._timers[label] = new Date();
|
||||
}
|
||||
timeEnd(label = 'default') {
|
||||
const startTime = this._timers[label];
|
||||
if (startTime != null) {
|
||||
const endTime = Date.now();
|
||||
const time = endTime - startTime.getTime();
|
||||
this._log('time', (0, _util().format)(`${label}: ${(0, _jestUtil().formatTime)(time)}`));
|
||||
delete this._timers[label];
|
||||
}
|
||||
}
|
||||
timeLog(label = 'default', ...data) {
|
||||
const startTime = this._timers[label];
|
||||
if (startTime != null) {
|
||||
const endTime = new Date();
|
||||
const time = endTime.getTime() - startTime.getTime();
|
||||
this._log('time', (0, _util().format)(`${label}: ${(0, _jestUtil().formatTime)(time)}`, ...data));
|
||||
}
|
||||
}
|
||||
warn(firstArg, ...args) {
|
||||
this._logError('warn', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
getBuffer() {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
exports["default"] = CustomConsole;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/NullConsole.ts":
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = void 0;
|
||||
var _CustomConsole = _interopRequireDefault(__webpack_require__("./src/CustomConsole.ts"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
class NullConsole extends _CustomConsole.default {
|
||||
assert() {}
|
||||
debug() {}
|
||||
dir() {}
|
||||
error() {}
|
||||
info() {}
|
||||
log() {}
|
||||
time() {}
|
||||
timeEnd() {}
|
||||
timeLog() {}
|
||||
trace() {}
|
||||
warn() {}
|
||||
group() {}
|
||||
groupCollapsed() {}
|
||||
groupEnd() {}
|
||||
}
|
||||
exports["default"] = NullConsole;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/getConsoleOutput.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = getConsoleOutput;
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require("chalk"));
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestMessageUtil() {
|
||||
const data = require("jest-message-util");
|
||||
_jestMessageUtil = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
/**
|
||||
* 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 getConsoleOutput(buffer, config, globalConfig) {
|
||||
const TITLE_INDENT = globalConfig.verbose === true ? ' '.repeat(2) : ' '.repeat(4);
|
||||
const CONSOLE_INDENT = TITLE_INDENT + ' '.repeat(2);
|
||||
const logEntries = buffer.reduce((output, {
|
||||
type,
|
||||
message,
|
||||
origin
|
||||
}) => {
|
||||
message = message.split(/\n/).map(line => CONSOLE_INDENT + line).join('\n');
|
||||
let typeMessage = `console.${type}`;
|
||||
let noStackTrace = true;
|
||||
let noCodeFrame = true;
|
||||
if (type === 'warn') {
|
||||
message = _chalk().default.yellow(message);
|
||||
typeMessage = _chalk().default.yellow(typeMessage);
|
||||
noStackTrace = globalConfig?.noStackTrace ?? false;
|
||||
noCodeFrame = false;
|
||||
} else if (type === 'error') {
|
||||
message = _chalk().default.red(message);
|
||||
typeMessage = _chalk().default.red(typeMessage);
|
||||
noStackTrace = globalConfig?.noStackTrace ?? false;
|
||||
noCodeFrame = false;
|
||||
}
|
||||
const options = {
|
||||
noCodeFrame,
|
||||
noStackTrace
|
||||
};
|
||||
const formattedStackTrace = (0, _jestMessageUtil().formatStackTrace)(origin, config, options);
|
||||
return `${output + TITLE_INDENT + _chalk().default.dim(typeMessage)}\n${message.trimEnd()}\n${_chalk().default.dim(formattedStackTrace.trimEnd())}\n\n`;
|
||||
}, '');
|
||||
return `${logEntries.trimEnd()}\n`;
|
||||
}
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // 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__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
|
||||
(() => {
|
||||
var exports = __webpack_exports__;
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
Object.defineProperty(exports, "BufferedConsole", ({
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _BufferedConsole.default;
|
||||
}
|
||||
}));
|
||||
Object.defineProperty(exports, "CustomConsole", ({
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _CustomConsole.default;
|
||||
}
|
||||
}));
|
||||
Object.defineProperty(exports, "NullConsole", ({
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _NullConsole.default;
|
||||
}
|
||||
}));
|
||||
Object.defineProperty(exports, "getConsoleOutput", ({
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _getConsoleOutput.default;
|
||||
}
|
||||
}));
|
||||
var _BufferedConsole = _interopRequireDefault(__webpack_require__("./src/BufferedConsole.ts"));
|
||||
var _CustomConsole = _interopRequireDefault(__webpack_require__("./src/CustomConsole.ts"));
|
||||
var _NullConsole = _interopRequireDefault(__webpack_require__("./src/NullConsole.ts"));
|
||||
var _getConsoleOutput = _interopRequireDefault(__webpack_require__("./src/getConsoleOutput.ts"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
})();
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
6
frontend/node_modules/@jest/console/build/index.mjs
generated
vendored
Normal file
6
frontend/node_modules/@jest/console/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const BufferedConsole = cjsModule.BufferedConsole;
|
||||
export const CustomConsole = cjsModule.CustomConsole;
|
||||
export const NullConsole = cjsModule.NullConsole;
|
||||
export const getConsoleOutput = cjsModule.getConsoleOutput;
|
||||
39
frontend/node_modules/@jest/console/package.json
generated
vendored
Normal file
39
frontend/node_modules/@jest/console/package.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "@jest/console",
|
||||
"version": "30.0.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-console"
|
||||
},
|
||||
"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": {
|
||||
"@jest/types": "30.0.1",
|
||||
"@types/node": "*",
|
||||
"chalk": "^4.1.2",
|
||||
"jest-message-util": "30.0.2",
|
||||
"jest-util": "30.0.2",
|
||||
"slash": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/test-utils": "30.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "f4296d2bc85c1405f84ddf613a25d0bc3766b7e5"
|
||||
}
|
||||
22
frontend/node_modules/@jest/core/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/core/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.
|
||||
3
frontend/node_modules/@jest/core/README.md
generated
vendored
Normal file
3
frontend/node_modules/@jest/core/README.md
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# @jest/core
|
||||
|
||||
Jest is currently working on providing a programmatic API. This is under development, and usage of this package directly is currently not supported.
|
||||
82
frontend/node_modules/@jest/core/build/index.d.mts
generated
vendored
Normal file
82
frontend/node_modules/@jest/core/build/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
import { BaseReporter, Reporter, ReporterContext } from "@jest/reporters";
|
||||
import { AggregatedResult, Test, TestContext } from "@jest/test-result";
|
||||
import { TestWatcher } from "jest-watcher";
|
||||
import { ChangedFiles } from "jest-changed-files";
|
||||
import { TestPathPatternsExecutor } from "@jest/pattern";
|
||||
import { Config } from "@jest/types";
|
||||
import { TestRunnerContext } from "jest-runner";
|
||||
|
||||
//#region src/types.d.ts
|
||||
type Stats = {
|
||||
roots: number;
|
||||
testMatch: number;
|
||||
testPathIgnorePatterns: number;
|
||||
testRegex: number;
|
||||
testPathPatterns?: number;
|
||||
};
|
||||
type Filter = (testPaths: Array<string>) => Promise<{
|
||||
filtered: Array<string>;
|
||||
}>;
|
||||
//#endregion
|
||||
//#region src/SearchSource.d.ts
|
||||
type SearchResult = {
|
||||
noSCM?: boolean;
|
||||
stats?: Stats;
|
||||
collectCoverageFrom?: Set<string>;
|
||||
tests: Array<Test>;
|
||||
total?: number;
|
||||
};
|
||||
declare class SearchSource {
|
||||
private readonly _context;
|
||||
private _dependencyResolver;
|
||||
private readonly _testPathCases;
|
||||
constructor(context: TestContext);
|
||||
private _getOrBuildDependencyResolver;
|
||||
private _filterTestPathsWithStats;
|
||||
private _getAllTestPaths;
|
||||
isTestFilePath(path: string): boolean;
|
||||
findMatchingTests(testPathPatternsExecutor: TestPathPatternsExecutor): SearchResult;
|
||||
findRelatedTests(allPaths: Set<string>, collectCoverage: boolean): Promise<SearchResult>;
|
||||
findTestsByPaths(paths: Array<string>): SearchResult;
|
||||
findRelatedTestsFromPattern(paths: Array<string>, collectCoverage: boolean): Promise<SearchResult>;
|
||||
findTestRelatedToChangedFiles(changedFilesInfo: ChangedFiles, collectCoverage: boolean): Promise<SearchResult>;
|
||||
private _getTestPaths;
|
||||
filterPathsWin32(paths: Array<string>): Array<string>;
|
||||
getTestPaths(globalConfig: Config.GlobalConfig, projectConfig: Config.ProjectConfig, changedFiles?: ChangedFiles, filter?: Filter): Promise<SearchResult>;
|
||||
findRelatedSourcesFromTestsInChangedFiles(changedFilesInfo: ChangedFiles): Promise<Array<string>>;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/TestScheduler.d.ts
|
||||
type ReporterConstructor = new (globalConfig: Config.GlobalConfig, reporterConfig: Record<string, unknown>, reporterContext: ReporterContext) => BaseReporter;
|
||||
type TestSchedulerContext = ReporterContext & TestRunnerContext;
|
||||
declare function createTestScheduler(globalConfig: Config.GlobalConfig, context: TestSchedulerContext): Promise<TestScheduler>;
|
||||
declare class TestScheduler {
|
||||
private readonly _context;
|
||||
private readonly _dispatcher;
|
||||
private readonly _globalConfig;
|
||||
constructor(globalConfig: Config.GlobalConfig, context: TestSchedulerContext);
|
||||
addReporter(reporter: Reporter): void;
|
||||
removeReporter(reporterConstructor: ReporterConstructor): void;
|
||||
scheduleTests(tests: Array<Test>, watcher: TestWatcher): Promise<AggregatedResult>;
|
||||
private _partitionTests;
|
||||
_setupReporters(): Promise<void>;
|
||||
private _addCustomReporter;
|
||||
private _bailIfNeeded;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/cli/index.d.ts
|
||||
declare function runCLI(argv: Config.Argv, projects: Array<string>): Promise<{
|
||||
results: AggregatedResult;
|
||||
globalConfig: Config.GlobalConfig;
|
||||
}>;
|
||||
//#endregion
|
||||
//#region src/version.d.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.
|
||||
*/
|
||||
declare function getVersion(): string;
|
||||
//#endregion
|
||||
export { SearchSource, createTestScheduler, getVersion, runCLI };
|
||||
114
frontend/node_modules/@jest/core/build/index.d.ts
generated
vendored
Normal file
114
frontend/node_modules/@jest/core/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* 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 {TestPathPatternsExecutor} from '@jest/pattern';
|
||||
import {BaseReporter, Reporter, ReporterContext} from '@jest/reporters';
|
||||
import {AggregatedResult, Test, TestContext} from '@jest/test-result';
|
||||
import {Config} from '@jest/types';
|
||||
import {ChangedFiles} from 'jest-changed-files';
|
||||
import {TestRunnerContext} from 'jest-runner';
|
||||
import {TestWatcher} from 'jest-watcher';
|
||||
|
||||
export declare function createTestScheduler(
|
||||
globalConfig: Config.GlobalConfig,
|
||||
context: TestSchedulerContext,
|
||||
): Promise<TestScheduler>;
|
||||
|
||||
declare type Filter = (testPaths: Array<string>) => Promise<{
|
||||
filtered: Array<string>;
|
||||
}>;
|
||||
|
||||
export declare function getVersion(): string;
|
||||
|
||||
declare type ReporterConstructor = new (
|
||||
globalConfig: Config.GlobalConfig,
|
||||
reporterConfig: Record<string, unknown>,
|
||||
reporterContext: ReporterContext,
|
||||
) => BaseReporter;
|
||||
|
||||
export declare function runCLI(
|
||||
argv: Config.Argv,
|
||||
projects: Array<string>,
|
||||
): Promise<{
|
||||
results: AggregatedResult;
|
||||
globalConfig: Config.GlobalConfig;
|
||||
}>;
|
||||
|
||||
declare type SearchResult = {
|
||||
noSCM?: boolean;
|
||||
stats?: Stats;
|
||||
collectCoverageFrom?: Set<string>;
|
||||
tests: Array<Test>;
|
||||
total?: number;
|
||||
};
|
||||
|
||||
export declare class SearchSource {
|
||||
private readonly _context;
|
||||
private _dependencyResolver;
|
||||
private readonly _testPathCases;
|
||||
constructor(context: TestContext);
|
||||
private _getOrBuildDependencyResolver;
|
||||
private _filterTestPathsWithStats;
|
||||
private _getAllTestPaths;
|
||||
isTestFilePath(path: string): boolean;
|
||||
findMatchingTests(
|
||||
testPathPatternsExecutor: TestPathPatternsExecutor,
|
||||
): SearchResult;
|
||||
findRelatedTests(
|
||||
allPaths: Set<string>,
|
||||
collectCoverage: boolean,
|
||||
): Promise<SearchResult>;
|
||||
findTestsByPaths(paths: Array<string>): SearchResult;
|
||||
findRelatedTestsFromPattern(
|
||||
paths: Array<string>,
|
||||
collectCoverage: boolean,
|
||||
): Promise<SearchResult>;
|
||||
findTestRelatedToChangedFiles(
|
||||
changedFilesInfo: ChangedFiles,
|
||||
collectCoverage: boolean,
|
||||
): Promise<SearchResult>;
|
||||
private _getTestPaths;
|
||||
filterPathsWin32(paths: Array<string>): Array<string>;
|
||||
getTestPaths(
|
||||
globalConfig: Config.GlobalConfig,
|
||||
projectConfig: Config.ProjectConfig,
|
||||
changedFiles?: ChangedFiles,
|
||||
filter?: Filter,
|
||||
): Promise<SearchResult>;
|
||||
findRelatedSourcesFromTestsInChangedFiles(
|
||||
changedFilesInfo: ChangedFiles,
|
||||
): Promise<Array<string>>;
|
||||
}
|
||||
|
||||
declare type Stats = {
|
||||
roots: number;
|
||||
testMatch: number;
|
||||
testPathIgnorePatterns: number;
|
||||
testRegex: number;
|
||||
testPathPatterns?: number;
|
||||
};
|
||||
|
||||
declare class TestScheduler {
|
||||
private readonly _context;
|
||||
private readonly _dispatcher;
|
||||
private readonly _globalConfig;
|
||||
constructor(globalConfig: Config.GlobalConfig, context: TestSchedulerContext);
|
||||
addReporter(reporter: Reporter): void;
|
||||
removeReporter(reporterConstructor: ReporterConstructor): void;
|
||||
scheduleTests(
|
||||
tests: Array<Test>,
|
||||
watcher: TestWatcher,
|
||||
): Promise<AggregatedResult>;
|
||||
private _partitionTests;
|
||||
_setupReporters(): Promise<void>;
|
||||
private _addCustomReporter;
|
||||
private _bailIfNeeded;
|
||||
}
|
||||
|
||||
declare type TestSchedulerContext = ReporterContext & TestRunnerContext;
|
||||
|
||||
export {};
|
||||
4128
frontend/node_modules/@jest/core/build/index.js
generated
vendored
Normal file
4128
frontend/node_modules/@jest/core/build/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
frontend/node_modules/@jest/core/build/index.mjs
generated
vendored
Normal file
6
frontend/node_modules/@jest/core/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const SearchSource = cjsModule.SearchSource;
|
||||
export const createTestScheduler = cjsModule.createTestScheduler;
|
||||
export const getVersion = cjsModule.getVersion;
|
||||
export const runCLI = cjsModule.runCLI;
|
||||
167
frontend/node_modules/@jest/core/node_modules/ansi-styles/index.d.ts
generated
vendored
Normal file
167
frontend/node_modules/@jest/core/node_modules/ansi-styles/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
declare namespace ansiStyles {
|
||||
interface CSPair {
|
||||
/**
|
||||
The ANSI terminal control sequence for starting this style.
|
||||
*/
|
||||
readonly open: string;
|
||||
|
||||
/**
|
||||
The ANSI terminal control sequence for ending this style.
|
||||
*/
|
||||
readonly close: string;
|
||||
}
|
||||
|
||||
interface ColorBase {
|
||||
/**
|
||||
The ANSI terminal control sequence for ending this color.
|
||||
*/
|
||||
readonly close: string;
|
||||
|
||||
ansi256(code: number): string;
|
||||
|
||||
ansi16m(red: number, green: number, blue: number): string;
|
||||
}
|
||||
|
||||
interface Modifier {
|
||||
/**
|
||||
Resets the current color chain.
|
||||
*/
|
||||
readonly reset: CSPair;
|
||||
|
||||
/**
|
||||
Make text bold.
|
||||
*/
|
||||
readonly bold: CSPair;
|
||||
|
||||
/**
|
||||
Emitting only a small amount of light.
|
||||
*/
|
||||
readonly dim: CSPair;
|
||||
|
||||
/**
|
||||
Make text italic. (Not widely supported)
|
||||
*/
|
||||
readonly italic: CSPair;
|
||||
|
||||
/**
|
||||
Make text underline. (Not widely supported)
|
||||
*/
|
||||
readonly underline: CSPair;
|
||||
|
||||
/**
|
||||
Make text overline.
|
||||
|
||||
Supported on VTE-based terminals, the GNOME terminal, mintty, and Git Bash.
|
||||
*/
|
||||
readonly overline: CSPair;
|
||||
|
||||
/**
|
||||
Inverse background and foreground colors.
|
||||
*/
|
||||
readonly inverse: CSPair;
|
||||
|
||||
/**
|
||||
Prints the text, but makes it invisible.
|
||||
*/
|
||||
readonly hidden: CSPair;
|
||||
|
||||
/**
|
||||
Puts a horizontal line through the center of the text. (Not widely supported)
|
||||
*/
|
||||
readonly strikethrough: CSPair;
|
||||
}
|
||||
|
||||
interface ForegroundColor {
|
||||
readonly black: CSPair;
|
||||
readonly red: CSPair;
|
||||
readonly green: CSPair;
|
||||
readonly yellow: CSPair;
|
||||
readonly blue: CSPair;
|
||||
readonly cyan: CSPair;
|
||||
readonly magenta: CSPair;
|
||||
readonly white: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `blackBright`.
|
||||
*/
|
||||
readonly gray: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `blackBright`.
|
||||
*/
|
||||
readonly grey: CSPair;
|
||||
|
||||
readonly blackBright: CSPair;
|
||||
readonly redBright: CSPair;
|
||||
readonly greenBright: CSPair;
|
||||
readonly yellowBright: CSPair;
|
||||
readonly blueBright: CSPair;
|
||||
readonly cyanBright: CSPair;
|
||||
readonly magentaBright: CSPair;
|
||||
readonly whiteBright: CSPair;
|
||||
}
|
||||
|
||||
interface BackgroundColor {
|
||||
readonly bgBlack: CSPair;
|
||||
readonly bgRed: CSPair;
|
||||
readonly bgGreen: CSPair;
|
||||
readonly bgYellow: CSPair;
|
||||
readonly bgBlue: CSPair;
|
||||
readonly bgCyan: CSPair;
|
||||
readonly bgMagenta: CSPair;
|
||||
readonly bgWhite: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `bgBlackBright`.
|
||||
*/
|
||||
readonly bgGray: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `bgBlackBright`.
|
||||
*/
|
||||
readonly bgGrey: CSPair;
|
||||
|
||||
readonly bgBlackBright: CSPair;
|
||||
readonly bgRedBright: CSPair;
|
||||
readonly bgGreenBright: CSPair;
|
||||
readonly bgYellowBright: CSPair;
|
||||
readonly bgBlueBright: CSPair;
|
||||
readonly bgCyanBright: CSPair;
|
||||
readonly bgMagentaBright: CSPair;
|
||||
readonly bgWhiteBright: CSPair;
|
||||
}
|
||||
|
||||
interface ConvertColor {
|
||||
/**
|
||||
Convert from the RGB color space to the ANSI 256 color space.
|
||||
|
||||
@param red - (`0...255`)
|
||||
@param green - (`0...255`)
|
||||
@param blue - (`0...255`)
|
||||
*/
|
||||
rgbToAnsi256(red: number, green: number, blue: number): number;
|
||||
|
||||
/**
|
||||
Convert from the RGB HEX color space to the RGB color space.
|
||||
|
||||
@param hex - A hexadecimal string containing RGB data.
|
||||
*/
|
||||
hexToRgb(hex: string): [red: number, green: number, blue: number];
|
||||
|
||||
/**
|
||||
Convert from the RGB HEX color space to the ANSI 256 color space.
|
||||
|
||||
@param hex - A hexadecimal string containing RGB data.
|
||||
*/
|
||||
hexToAnsi256(hex: string): number;
|
||||
}
|
||||
}
|
||||
|
||||
declare const ansiStyles: {
|
||||
readonly modifier: ansiStyles.Modifier;
|
||||
readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase;
|
||||
readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase;
|
||||
readonly codes: ReadonlyMap<number, number>;
|
||||
} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier & ansiStyles.ConvertColor;
|
||||
|
||||
export = ansiStyles;
|
||||
164
frontend/node_modules/@jest/core/node_modules/ansi-styles/index.js
generated
vendored
Normal file
164
frontend/node_modules/@jest/core/node_modules/ansi-styles/index.js
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
'use strict';
|
||||
|
||||
const ANSI_BACKGROUND_OFFSET = 10;
|
||||
|
||||
const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
|
||||
|
||||
const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
||||
|
||||
function assembleStyles() {
|
||||
const codes = new Map();
|
||||
const styles = {
|
||||
modifier: {
|
||||
reset: [0, 0],
|
||||
// 21 isn't widely supported and 22 does the same thing
|
||||
bold: [1, 22],
|
||||
dim: [2, 22],
|
||||
italic: [3, 23],
|
||||
underline: [4, 24],
|
||||
overline: [53, 55],
|
||||
inverse: [7, 27],
|
||||
hidden: [8, 28],
|
||||
strikethrough: [9, 29]
|
||||
},
|
||||
color: {
|
||||
black: [30, 39],
|
||||
red: [31, 39],
|
||||
green: [32, 39],
|
||||
yellow: [33, 39],
|
||||
blue: [34, 39],
|
||||
magenta: [35, 39],
|
||||
cyan: [36, 39],
|
||||
white: [37, 39],
|
||||
|
||||
// Bright color
|
||||
blackBright: [90, 39],
|
||||
redBright: [91, 39],
|
||||
greenBright: [92, 39],
|
||||
yellowBright: [93, 39],
|
||||
blueBright: [94, 39],
|
||||
magentaBright: [95, 39],
|
||||
cyanBright: [96, 39],
|
||||
whiteBright: [97, 39]
|
||||
},
|
||||
bgColor: {
|
||||
bgBlack: [40, 49],
|
||||
bgRed: [41, 49],
|
||||
bgGreen: [42, 49],
|
||||
bgYellow: [43, 49],
|
||||
bgBlue: [44, 49],
|
||||
bgMagenta: [45, 49],
|
||||
bgCyan: [46, 49],
|
||||
bgWhite: [47, 49],
|
||||
|
||||
// Bright color
|
||||
bgBlackBright: [100, 49],
|
||||
bgRedBright: [101, 49],
|
||||
bgGreenBright: [102, 49],
|
||||
bgYellowBright: [103, 49],
|
||||
bgBlueBright: [104, 49],
|
||||
bgMagentaBright: [105, 49],
|
||||
bgCyanBright: [106, 49],
|
||||
bgWhiteBright: [107, 49]
|
||||
}
|
||||
};
|
||||
|
||||
// Alias bright black as gray (and grey)
|
||||
styles.color.gray = styles.color.blackBright;
|
||||
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
||||
styles.color.grey = styles.color.blackBright;
|
||||
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
||||
|
||||
for (const [groupName, group] of Object.entries(styles)) {
|
||||
for (const [styleName, style] of Object.entries(group)) {
|
||||
styles[styleName] = {
|
||||
open: `\u001B[${style[0]}m`,
|
||||
close: `\u001B[${style[1]}m`
|
||||
};
|
||||
|
||||
group[styleName] = styles[styleName];
|
||||
|
||||
codes.set(style[0], style[1]);
|
||||
}
|
||||
|
||||
Object.defineProperty(styles, groupName, {
|
||||
value: group,
|
||||
enumerable: false
|
||||
});
|
||||
}
|
||||
|
||||
Object.defineProperty(styles, 'codes', {
|
||||
value: codes,
|
||||
enumerable: false
|
||||
});
|
||||
|
||||
styles.color.close = '\u001B[39m';
|
||||
styles.bgColor.close = '\u001B[49m';
|
||||
|
||||
styles.color.ansi256 = wrapAnsi256();
|
||||
styles.color.ansi16m = wrapAnsi16m();
|
||||
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
||||
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
||||
|
||||
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
|
||||
Object.defineProperties(styles, {
|
||||
rgbToAnsi256: {
|
||||
value: (red, green, blue) => {
|
||||
// We use the extended greyscale palette here, with the exception of
|
||||
// black and white. normal palette only has 4 greyscale shades.
|
||||
if (red === green && green === blue) {
|
||||
if (red < 8) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
if (red > 248) {
|
||||
return 231;
|
||||
}
|
||||
|
||||
return Math.round(((red - 8) / 247) * 24) + 232;
|
||||
}
|
||||
|
||||
return 16 +
|
||||
(36 * Math.round(red / 255 * 5)) +
|
||||
(6 * Math.round(green / 255 * 5)) +
|
||||
Math.round(blue / 255 * 5);
|
||||
},
|
||||
enumerable: false
|
||||
},
|
||||
hexToRgb: {
|
||||
value: hex => {
|
||||
const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
|
||||
if (!matches) {
|
||||
return [0, 0, 0];
|
||||
}
|
||||
|
||||
let {colorString} = matches.groups;
|
||||
|
||||
if (colorString.length === 3) {
|
||||
colorString = colorString.split('').map(character => character + character).join('');
|
||||
}
|
||||
|
||||
const integer = Number.parseInt(colorString, 16);
|
||||
|
||||
return [
|
||||
(integer >> 16) & 0xFF,
|
||||
(integer >> 8) & 0xFF,
|
||||
integer & 0xFF
|
||||
];
|
||||
},
|
||||
enumerable: false
|
||||
},
|
||||
hexToAnsi256: {
|
||||
value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
||||
enumerable: false
|
||||
}
|
||||
});
|
||||
|
||||
return styles;
|
||||
}
|
||||
|
||||
// Make the export immutable
|
||||
Object.defineProperty(module, 'exports', {
|
||||
enumerable: true,
|
||||
get: assembleStyles
|
||||
});
|
||||
9
frontend/node_modules/@jest/core/node_modules/ansi-styles/license
generated
vendored
Normal file
9
frontend/node_modules/@jest/core/node_modules/ansi-styles/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.
|
||||
52
frontend/node_modules/@jest/core/node_modules/ansi-styles/package.json
generated
vendored
Normal file
52
frontend/node_modules/@jest/core/node_modules/ansi-styles/package.json
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "ansi-styles",
|
||||
"version": "5.2.0",
|
||||
"description": "ANSI escape codes for styling strings in the terminal",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/ansi-styles",
|
||||
"funding": "https://github.com/chalk/ansi-styles?sponsor=1",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd",
|
||||
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^2.4.0",
|
||||
"svg-term-cli": "^2.1.1",
|
||||
"tsd": "^0.14.0",
|
||||
"xo": "^0.37.1"
|
||||
}
|
||||
}
|
||||
144
frontend/node_modules/@jest/core/node_modules/ansi-styles/readme.md
generated
vendored
Normal file
144
frontend/node_modules/@jest/core/node_modules/ansi-styles/readme.md
generated
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
# ansi-styles
|
||||
|
||||
> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
|
||||
|
||||
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
|
||||
|
||||
<img src="screenshot.svg" width="900">
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-styles
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const style = require('ansi-styles');
|
||||
|
||||
console.log(`${style.green.open}Hello world!${style.green.close}`);
|
||||
|
||||
|
||||
// Color conversion between 256/truecolor
|
||||
// NOTE: When converting from truecolor to 256 colors, the original color
|
||||
// may be degraded to fit the new color palette. This means terminals
|
||||
// that do not support 16 million colors will best-match the
|
||||
// original color.
|
||||
console.log(`${style.color.ansi256(style.rgbToAnsi256(199, 20, 250))}Hello World${style.color.close}`)
|
||||
console.log(`${style.color.ansi16m(...style.hexToRgb('#abcdef'))}Hello World${style.color.close}`)
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Each style has an `open` and `close` property.
|
||||
|
||||
## Styles
|
||||
|
||||
### Modifiers
|
||||
|
||||
- `reset`
|
||||
- `bold`
|
||||
- `dim`
|
||||
- `italic` *(Not widely supported)*
|
||||
- `underline`
|
||||
- `overline` *Supported on VTE-based terminals, the GNOME terminal, mintty, and Git Bash.*
|
||||
- `inverse`
|
||||
- `hidden`
|
||||
- `strikethrough` *(Not widely supported)*
|
||||
|
||||
### Colors
|
||||
|
||||
- `black`
|
||||
- `red`
|
||||
- `green`
|
||||
- `yellow`
|
||||
- `blue`
|
||||
- `magenta`
|
||||
- `cyan`
|
||||
- `white`
|
||||
- `blackBright` (alias: `gray`, `grey`)
|
||||
- `redBright`
|
||||
- `greenBright`
|
||||
- `yellowBright`
|
||||
- `blueBright`
|
||||
- `magentaBright`
|
||||
- `cyanBright`
|
||||
- `whiteBright`
|
||||
|
||||
### Background colors
|
||||
|
||||
- `bgBlack`
|
||||
- `bgRed`
|
||||
- `bgGreen`
|
||||
- `bgYellow`
|
||||
- `bgBlue`
|
||||
- `bgMagenta`
|
||||
- `bgCyan`
|
||||
- `bgWhite`
|
||||
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
|
||||
- `bgRedBright`
|
||||
- `bgGreenBright`
|
||||
- `bgYellowBright`
|
||||
- `bgBlueBright`
|
||||
- `bgMagentaBright`
|
||||
- `bgCyanBright`
|
||||
- `bgWhiteBright`
|
||||
|
||||
## Advanced usage
|
||||
|
||||
By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
|
||||
|
||||
- `style.modifier`
|
||||
- `style.color`
|
||||
- `style.bgColor`
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(style.color.green.open);
|
||||
```
|
||||
|
||||
Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(style.codes.get(36));
|
||||
//=> 39
|
||||
```
|
||||
|
||||
## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
|
||||
|
||||
`ansi-styles` allows converting between various color formats and ANSI escapes, with support for 256 and 16 million colors.
|
||||
|
||||
The following color spaces from `color-convert` are supported:
|
||||
|
||||
- `rgb`
|
||||
- `hex`
|
||||
- `ansi256`
|
||||
|
||||
To use these, call the associated conversion function with the intended output, for example:
|
||||
|
||||
```js
|
||||
style.color.ansi256(style.rgbToAnsi256(100, 200, 15)); // RGB to 256 color ansi foreground code
|
||||
style.bgColor.ansi256(style.hexToAnsi256('#C0FFEE')); // HEX to 256 color ansi foreground code
|
||||
|
||||
style.color.ansi16m(100, 200, 15); // RGB to 16 million color foreground code
|
||||
style.bgColor.ansi16m(...style.hexToRgb('#C0FFEE')); // Hex (RGB) to 16 million color foreground code
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
## For enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
22
frontend/node_modules/@jest/core/node_modules/pretty-format/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/core/node_modules/pretty-format/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.
|
||||
463
frontend/node_modules/@jest/core/node_modules/pretty-format/README.md
generated
vendored
Executable file
463
frontend/node_modules/@jest/core/node_modules/pretty-format/README.md
generated
vendored
Executable file
@@ -0,0 +1,463 @@
|
||||
# pretty-format
|
||||
|
||||
Stringify any JavaScript value.
|
||||
|
||||
- Serialize built-in JavaScript types.
|
||||
- Serialize application-specific data types with built-in or user-defined plugins.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
$ yarn add pretty-format
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const {format: prettyFormat} = require('pretty-format'); // CommonJS
|
||||
```
|
||||
|
||||
```js
|
||||
import {format as prettyFormat} from 'pretty-format'; // ES2015 modules
|
||||
```
|
||||
|
||||
```js
|
||||
const val = {object: {}};
|
||||
val.circularReference = val;
|
||||
val[Symbol('foo')] = 'foo';
|
||||
val.map = new Map([['prop', 'value']]);
|
||||
val.array = [-0, Infinity, NaN];
|
||||
|
||||
console.log(prettyFormat(val));
|
||||
/*
|
||||
Object {
|
||||
"array": Array [
|
||||
-0,
|
||||
Infinity,
|
||||
NaN,
|
||||
],
|
||||
"circularReference": [Circular],
|
||||
"map": Map {
|
||||
"prop" => "value",
|
||||
},
|
||||
"object": Object {},
|
||||
Symbol(foo): "foo",
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
## Usage with options
|
||||
|
||||
```js
|
||||
function onClick() {}
|
||||
|
||||
console.log(prettyFormat(onClick));
|
||||
/*
|
||||
[Function onClick]
|
||||
*/
|
||||
|
||||
const options = {
|
||||
printFunctionName: false,
|
||||
};
|
||||
console.log(prettyFormat(onClick, options));
|
||||
/*
|
||||
[Function]
|
||||
*/
|
||||
```
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
| key | type | default | description |
|
||||
| :-------------------- | :--------------- | :---------- | :-------------------------------------------------------------------------------------- |
|
||||
| `callToJSON` | `boolean` | `true` | call `toJSON` method (if it exists) on objects |
|
||||
| `compareKeys` | `function\|null` | `undefined` | compare function used when sorting object keys, `null` can be used to skip over sorting |
|
||||
| `escapeRegex` | `boolean` | `false` | escape special characters in regular expressions |
|
||||
| `escapeString` | `boolean` | `true` | escape special characters in strings |
|
||||
| `highlight` | `boolean` | `false` | highlight syntax with colors in terminal (some plugins) |
|
||||
| `indent` | `number` | `2` | spaces in each level of indentation |
|
||||
| `maxDepth` | `number` | `Infinity` | levels to print in arrays, objects, elements, and so on |
|
||||
| `maxWidth` | `number` | `Infinity` | number of elements to print in arrays, sets, and so on |
|
||||
| `min` | `boolean` | `false` | minimize added space: no indentation nor line breaks |
|
||||
| `plugins` | `array` | `[]` | plugins to serialize application-specific data types |
|
||||
| `printBasicPrototype` | `boolean` | `false` | print the prototype for plain objects and arrays |
|
||||
| `printFunctionName` | `boolean` | `true` | include or omit the name of a function |
|
||||
| `theme` | `object` | | colors to highlight syntax in terminal |
|
||||
|
||||
Property values of `theme` are from [ansi-styles colors](https://github.com/chalk/ansi-styles#colors)
|
||||
|
||||
```js
|
||||
const DEFAULT_THEME = {
|
||||
comment: 'gray',
|
||||
content: 'reset',
|
||||
prop: 'yellow',
|
||||
tag: 'cyan',
|
||||
value: 'green',
|
||||
};
|
||||
```
|
||||
|
||||
## Usage with plugins
|
||||
|
||||
The `pretty-format` package provides some built-in plugins, including:
|
||||
|
||||
- `ReactElement` for elements from `react`
|
||||
- `ReactTestComponent` for test objects from `react-test-renderer`
|
||||
|
||||
```js
|
||||
// CommonJS
|
||||
const React = require('react');
|
||||
const renderer = require('react-test-renderer');
|
||||
const {format: prettyFormat, plugins} = require('pretty-format');
|
||||
|
||||
const {ReactElement, ReactTestComponent} = plugins;
|
||||
```
|
||||
|
||||
```js
|
||||
// ES2015 modules and destructuring assignment
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import {plugins, format as prettyFormat} from 'pretty-format';
|
||||
|
||||
const {ReactElement, ReactTestComponent} = plugins;
|
||||
```
|
||||
|
||||
```js
|
||||
const onClick = () => {};
|
||||
const element = React.createElement('button', {onClick}, 'Hello World');
|
||||
|
||||
const formatted1 = prettyFormat(element, {
|
||||
plugins: [ReactElement],
|
||||
printFunctionName: false,
|
||||
});
|
||||
const formatted2 = prettyFormat(renderer.create(element).toJSON(), {
|
||||
plugins: [ReactTestComponent],
|
||||
printFunctionName: false,
|
||||
});
|
||||
/*
|
||||
<button
|
||||
onClick=[Function]
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
*/
|
||||
```
|
||||
|
||||
## Usage in Jest
|
||||
|
||||
For snapshot tests, Jest uses `pretty-format` with options that include some of its built-in plugins. For this purpose, plugins are also known as **snapshot serializers**.
|
||||
|
||||
To serialize application-specific data types, you can add modules to `devDependencies` of a project, and then:
|
||||
|
||||
In an **individual** test file, you can add a module as follows. It precedes any modules from Jest configuration.
|
||||
|
||||
```js
|
||||
import serializer from 'my-serializer-module';
|
||||
expect.addSnapshotSerializer(serializer);
|
||||
|
||||
// tests which have `expect(value).toMatchSnapshot()` assertions
|
||||
```
|
||||
|
||||
For **all** test files, you can specify modules in Jest configuration. They precede built-in plugins for React, HTML, and Immutable.js data types. For example, in a `package.json` file:
|
||||
|
||||
```json
|
||||
{
|
||||
"jest": {
|
||||
"snapshotSerializers": ["my-serializer-module"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Writing plugins
|
||||
|
||||
A plugin is a JavaScript object.
|
||||
|
||||
If `options` has a `plugins` array: for the first plugin whose `test(val)` method returns a truthy value, then `prettyFormat(val, options)` returns the result from either:
|
||||
|
||||
- `serialize(val, …)` method of the **improved** interface (available in **version 21** or later)
|
||||
- `print(val, …)` method of the **original** interface (if plugin does not have `serialize` method)
|
||||
|
||||
### test
|
||||
|
||||
Write `test` so it can receive `val` argument of any type. To serialize **objects** which have certain properties, then a guarded expression like `val != null && …` or more concise `val && …` prevents the following errors:
|
||||
|
||||
- `TypeError: Cannot read property 'whatever' of null`
|
||||
- `TypeError: Cannot read property 'whatever' of undefined`
|
||||
|
||||
For example, `test` method of built-in `ReactElement` plugin:
|
||||
|
||||
```js
|
||||
const elementSymbol = Symbol.for('react.element');
|
||||
const test = val => val && val.$$typeof === elementSymbol;
|
||||
```
|
||||
|
||||
Pay attention to efficiency in `test` because `pretty-format` calls it often.
|
||||
|
||||
### serialize
|
||||
|
||||
The **improved** interface is available in **version 21** or later.
|
||||
|
||||
Write `serialize` to return a string, given the arguments:
|
||||
|
||||
- `val` which “passed the test”
|
||||
- unchanging `config` object: derived from `options`
|
||||
- current `indentation` string: concatenate to `indent` from `config`
|
||||
- current `depth` number: compare to `maxDepth` from `config`
|
||||
- current `refs` array: find circular references in objects
|
||||
- `printer` callback function: serialize children
|
||||
|
||||
### config
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
| key | type | description |
|
||||
| :------------------ | :--------------- | :-------------------------------------------------------------------------------------- |
|
||||
| `callToJSON` | `boolean` | call `toJSON` method (if it exists) on objects |
|
||||
| `compareKeys` | `function\|null` | compare function used when sorting object keys, `null` can be used to skip over sorting |
|
||||
| `colors` | `Object` | escape codes for colors to highlight syntax |
|
||||
| `escapeRegex` | `boolean` | escape special characters in regular expressions |
|
||||
| `escapeString` | `boolean` | escape special characters in strings |
|
||||
| `indent` | `string` | spaces in each level of indentation |
|
||||
| `maxDepth` | `number` | levels to print in arrays, objects, elements, and so on |
|
||||
| `min` | `boolean` | minimize added space: no indentation nor line breaks |
|
||||
| `plugins` | `array` | plugins to serialize application-specific data types |
|
||||
| `printFunctionName` | `boolean` | include or omit the name of a function |
|
||||
| `spacingInner` | `string` | spacing to separate items in a list |
|
||||
| `spacingOuter` | `string` | spacing to enclose a list of items |
|
||||
|
||||
Each property of `colors` in `config` corresponds to a property of `theme` in `options`:
|
||||
|
||||
- the key is the same (for example, `tag`)
|
||||
- the value in `colors` is a object with `open` and `close` properties whose values are escape codes from [ansi-styles](https://github.com/chalk/ansi-styles) for the color value in `theme` (for example, `'cyan'`)
|
||||
|
||||
Some properties in `config` are derived from `min` in `options`:
|
||||
|
||||
- `spacingInner` and `spacingOuter` are **newline** if `min` is `false`
|
||||
- `spacingInner` is **space** and `spacingOuter` is **empty string** if `min` is `true`
|
||||
|
||||
### Example of serialize and test
|
||||
|
||||
This plugin is a pattern you can apply to serialize composite data types. Side note: `pretty-format` does not need a plugin to serialize arrays.
|
||||
|
||||
```js
|
||||
// We reused more code when we factored out a function for child items
|
||||
// that is independent of depth, name, and enclosing punctuation (see below).
|
||||
const SEPARATOR = ',';
|
||||
function serializeItems(items, config, indentation, depth, refs, printer) {
|
||||
if (items.length === 0) {
|
||||
return '';
|
||||
}
|
||||
const indentationItems = indentation + config.indent;
|
||||
return (
|
||||
config.spacingOuter +
|
||||
items
|
||||
.map(
|
||||
item =>
|
||||
indentationItems +
|
||||
printer(item, config, indentationItems, depth, refs), // callback
|
||||
)
|
||||
.join(SEPARATOR + config.spacingInner) +
|
||||
(config.min ? '' : SEPARATOR) + // following the last item
|
||||
config.spacingOuter +
|
||||
indentation
|
||||
);
|
||||
}
|
||||
|
||||
const plugin = {
|
||||
test(val) {
|
||||
return Array.isArray(val);
|
||||
},
|
||||
serialize(array, config, indentation, depth, refs, printer) {
|
||||
const name = array.constructor.name;
|
||||
return ++depth > config.maxDepth
|
||||
? `[${name}]`
|
||||
: `${config.min ? '' : `${name} `}[${serializeItems(
|
||||
array,
|
||||
config,
|
||||
indentation,
|
||||
depth,
|
||||
refs,
|
||||
printer,
|
||||
)}]`;
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
```js
|
||||
const val = {
|
||||
filter: 'completed',
|
||||
items: [
|
||||
{
|
||||
text: 'Write test',
|
||||
completed: true,
|
||||
},
|
||||
{
|
||||
text: 'Write serialize',
|
||||
completed: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
```js
|
||||
console.log(
|
||||
prettyFormat(val, {
|
||||
plugins: [plugin],
|
||||
}),
|
||||
);
|
||||
/*
|
||||
Object {
|
||||
"filter": "completed",
|
||||
"items": Array [
|
||||
Object {
|
||||
"completed": true,
|
||||
"text": "Write test",
|
||||
},
|
||||
Object {
|
||||
"completed": true,
|
||||
"text": "Write serialize",
|
||||
},
|
||||
],
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
```js
|
||||
console.log(
|
||||
prettyFormat(val, {
|
||||
indent: 4,
|
||||
plugins: [plugin],
|
||||
}),
|
||||
);
|
||||
/*
|
||||
Object {
|
||||
"filter": "completed",
|
||||
"items": Array [
|
||||
Object {
|
||||
"completed": true,
|
||||
"text": "Write test",
|
||||
},
|
||||
Object {
|
||||
"completed": true,
|
||||
"text": "Write serialize",
|
||||
},
|
||||
],
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
```js
|
||||
console.log(
|
||||
prettyFormat(val, {
|
||||
maxDepth: 1,
|
||||
plugins: [plugin],
|
||||
}),
|
||||
);
|
||||
/*
|
||||
Object {
|
||||
"filter": "completed",
|
||||
"items": [Array],
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
```js
|
||||
console.log(
|
||||
prettyFormat(val, {
|
||||
min: true,
|
||||
plugins: [plugin],
|
||||
}),
|
||||
);
|
||||
/*
|
||||
{"filter": "completed", "items": [{"completed": true, "text": "Write test"}, {"completed": true, "text": "Write serialize"}]}
|
||||
*/
|
||||
```
|
||||
|
||||
### print
|
||||
|
||||
The **original** interface is adequate for plugins:
|
||||
|
||||
- that **do not** depend on options other than `highlight` or `min`
|
||||
- that **do not** depend on `depth` or `refs` in recursive traversal, and
|
||||
- if values either
|
||||
- do **not** require indentation, or
|
||||
- do **not** occur as children of JavaScript data structures (for example, array)
|
||||
|
||||
Write `print` to return a string, given the arguments:
|
||||
|
||||
- `val` which “passed the test”
|
||||
- current `printer(valChild)` callback function: serialize children
|
||||
- current `indenter(lines)` callback function: indent lines at the next level
|
||||
- unchanging `config` object: derived from `options`
|
||||
- unchanging `colors` object: derived from `options`
|
||||
|
||||
The 3 properties of `config` are `min` in `options` and:
|
||||
|
||||
- `spacing` and `edgeSpacing` are **newline** if `min` is `false`
|
||||
- `spacing` is **space** and `edgeSpacing` is **empty string** if `min` is `true`
|
||||
|
||||
Each property of `colors` corresponds to a property of `theme` in `options`:
|
||||
|
||||
- the key is the same (for example, `tag`)
|
||||
- the value in `colors` is a object with `open` and `close` properties whose values are escape codes from [ansi-styles](https://github.com/chalk/ansi-styles) for the color value in `theme` (for example, `'cyan'`)
|
||||
|
||||
### Example of print and test
|
||||
|
||||
This plugin prints functions with the **number of named arguments** excluding rest argument.
|
||||
|
||||
```js
|
||||
const plugin = {
|
||||
print(val) {
|
||||
return `[Function ${val.name || 'anonymous'} ${val.length}]`;
|
||||
},
|
||||
test(val) {
|
||||
return typeof val === 'function';
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
```js
|
||||
const val = {
|
||||
onClick(event) {},
|
||||
render() {},
|
||||
};
|
||||
|
||||
prettyFormat(val, {
|
||||
plugins: [plugin],
|
||||
});
|
||||
/*
|
||||
Object {
|
||||
"onClick": [Function onClick 1],
|
||||
"render": [Function render 0],
|
||||
}
|
||||
*/
|
||||
|
||||
prettyFormat(val);
|
||||
/*
|
||||
Object {
|
||||
"onClick": [Function onClick],
|
||||
"render": [Function render],
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
This plugin **ignores** the `printFunctionName` option. That limitation of the original `print` interface is a reason to use the improved `serialize` interface, described above.
|
||||
|
||||
```js
|
||||
prettyFormat(val, {
|
||||
plugins: [pluginOld],
|
||||
printFunctionName: false,
|
||||
});
|
||||
/*
|
||||
Object {
|
||||
"onClick": [Function onClick 1],
|
||||
"render": [Function render 0],
|
||||
}
|
||||
*/
|
||||
|
||||
prettyFormat(val, {
|
||||
printFunctionName: false,
|
||||
});
|
||||
/*
|
||||
Object {
|
||||
"onClick": [Function],
|
||||
"render": [Function],
|
||||
}
|
||||
*/
|
||||
```
|
||||
164
frontend/node_modules/@jest/core/node_modules/pretty-format/build/index.d.ts
generated
vendored
Normal file
164
frontend/node_modules/@jest/core/node_modules/pretty-format/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
/**
|
||||
* 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 {SnapshotFormat} from '@jest/schemas';
|
||||
|
||||
export declare type Colors = {
|
||||
comment: {
|
||||
close: string;
|
||||
open: string;
|
||||
};
|
||||
content: {
|
||||
close: string;
|
||||
open: string;
|
||||
};
|
||||
prop: {
|
||||
close: string;
|
||||
open: string;
|
||||
};
|
||||
tag: {
|
||||
close: string;
|
||||
open: string;
|
||||
};
|
||||
value: {
|
||||
close: string;
|
||||
open: string;
|
||||
};
|
||||
};
|
||||
|
||||
export declare type CompareKeys =
|
||||
| ((a: string, b: string) => number)
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
export declare type Config = {
|
||||
callToJSON: boolean;
|
||||
compareKeys: CompareKeys;
|
||||
colors: Colors;
|
||||
escapeRegex: boolean;
|
||||
escapeString: boolean;
|
||||
indent: string;
|
||||
maxDepth: number;
|
||||
maxWidth: number;
|
||||
min: boolean;
|
||||
plugins: Plugins;
|
||||
printBasicPrototype: boolean;
|
||||
printFunctionName: boolean;
|
||||
spacingInner: string;
|
||||
spacingOuter: string;
|
||||
};
|
||||
|
||||
export declare const DEFAULT_OPTIONS: {
|
||||
callToJSON: true;
|
||||
compareKeys: undefined;
|
||||
escapeRegex: false;
|
||||
escapeString: true;
|
||||
highlight: false;
|
||||
indent: number;
|
||||
maxDepth: number;
|
||||
maxWidth: number;
|
||||
min: false;
|
||||
plugins: Array<never>;
|
||||
printBasicPrototype: true;
|
||||
printFunctionName: true;
|
||||
theme: Required<{
|
||||
comment?: string | undefined;
|
||||
content?: string | undefined;
|
||||
prop?: string | undefined;
|
||||
tag?: string | undefined;
|
||||
value?: string | undefined;
|
||||
}>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a presentation string of your `val` object
|
||||
* @param val any potential JavaScript object
|
||||
* @param options Custom settings
|
||||
*/
|
||||
declare function format(val: unknown, options?: OptionsReceived): string;
|
||||
export default format;
|
||||
export {format};
|
||||
|
||||
declare type Indent = (arg0: string) => string;
|
||||
|
||||
export declare type NewPlugin = {
|
||||
serialize: (
|
||||
val: any,
|
||||
config: Config,
|
||||
indentation: string,
|
||||
depth: number,
|
||||
refs: Refs,
|
||||
printer: Printer,
|
||||
) => string;
|
||||
test: Test;
|
||||
};
|
||||
|
||||
export declare type OldPlugin = {
|
||||
print: (
|
||||
val: unknown,
|
||||
print: Print,
|
||||
indent: Indent,
|
||||
options: PluginOptions,
|
||||
colors: Colors,
|
||||
) => string;
|
||||
test: Test;
|
||||
};
|
||||
|
||||
export declare interface Options
|
||||
extends Omit<RequiredOptions, 'compareKeys' | 'theme'> {
|
||||
compareKeys: CompareKeys;
|
||||
theme: Required<RequiredOptions['theme']>;
|
||||
}
|
||||
|
||||
export declare type OptionsReceived = PrettyFormatOptions;
|
||||
|
||||
declare type Plugin_2 = NewPlugin | OldPlugin;
|
||||
export {Plugin_2 as Plugin};
|
||||
|
||||
declare type PluginOptions = {
|
||||
edgeSpacing: string;
|
||||
min: boolean;
|
||||
spacing: string;
|
||||
};
|
||||
|
||||
export declare type Plugins = Array<Plugin_2>;
|
||||
|
||||
export declare const plugins: {
|
||||
AsymmetricMatcher: NewPlugin;
|
||||
DOMCollection: NewPlugin;
|
||||
DOMElement: NewPlugin;
|
||||
Immutable: NewPlugin;
|
||||
ReactElement: NewPlugin;
|
||||
ReactTestComponent: NewPlugin;
|
||||
};
|
||||
|
||||
export declare interface PrettyFormatOptions
|
||||
extends Omit<SnapshotFormat, 'compareKeys'> {
|
||||
compareKeys?: CompareKeys;
|
||||
plugins?: Plugins;
|
||||
}
|
||||
|
||||
declare type Print = (arg0: unknown) => string;
|
||||
|
||||
export declare type Printer = (
|
||||
val: unknown,
|
||||
config: Config,
|
||||
indentation: string,
|
||||
depth: number,
|
||||
refs: Refs,
|
||||
hasCalledToJSON?: boolean,
|
||||
) => string;
|
||||
|
||||
export declare type Refs = Array<unknown>;
|
||||
|
||||
declare type RequiredOptions = Required<PrettyFormatOptions>;
|
||||
|
||||
declare type Test = (arg0: any) => boolean;
|
||||
|
||||
export declare type Theme = Options['theme'];
|
||||
|
||||
export {};
|
||||
1048
frontend/node_modules/@jest/core/node_modules/pretty-format/build/index.js
generated
vendored
Normal file
1048
frontend/node_modules/@jest/core/node_modules/pretty-format/build/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
frontend/node_modules/@jest/core/node_modules/pretty-format/build/index.mjs
generated
vendored
Normal file
6
frontend/node_modules/@jest/core/node_modules/pretty-format/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const DEFAULT_OPTIONS = cjsModule.DEFAULT_OPTIONS;
|
||||
export const format = cjsModule.format;
|
||||
export const plugins = cjsModule.plugins;
|
||||
export default cjsModule.default;
|
||||
45
frontend/node_modules/@jest/core/node_modules/pretty-format/package.json
generated
vendored
Normal file
45
frontend/node_modules/@jest/core/node_modules/pretty-format/package.json
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "pretty-format",
|
||||
"version": "30.0.2",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/pretty-format"
|
||||
},
|
||||
"license": "MIT",
|
||||
"description": "Stringify any JavaScript value.",
|
||||
"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"
|
||||
},
|
||||
"author": "James Kyle <me@thejameskyle.com>",
|
||||
"dependencies": {
|
||||
"@jest/schemas": "30.0.1",
|
||||
"ansi-styles": "^5.2.0",
|
||||
"react-is": "^18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.3.23",
|
||||
"@types/react-is": "^18.3.1",
|
||||
"@types/react-test-renderer": "^18.3.1",
|
||||
"immutable": "^5.1.2",
|
||||
"jest-util": "30.0.2",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"react-test-renderer": "18.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "393acbfac31f64bb38dff23c89224797caded83c"
|
||||
}
|
||||
103
frontend/node_modules/@jest/core/package.json
generated
vendored
Normal file
103
frontend/node_modules/@jest/core/package.json
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"name": "@jest/core",
|
||||
"description": "Delightful JavaScript Testing.",
|
||||
"version": "30.0.4",
|
||||
"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": {
|
||||
"@jest/console": "30.0.4",
|
||||
"@jest/pattern": "30.0.1",
|
||||
"@jest/reporters": "30.0.4",
|
||||
"@jest/test-result": "30.0.4",
|
||||
"@jest/transform": "30.0.4",
|
||||
"@jest/types": "30.0.1",
|
||||
"@types/node": "*",
|
||||
"ansi-escapes": "^4.3.2",
|
||||
"chalk": "^4.1.2",
|
||||
"ci-info": "^4.2.0",
|
||||
"exit-x": "^0.2.2",
|
||||
"graceful-fs": "^4.2.11",
|
||||
"jest-changed-files": "30.0.2",
|
||||
"jest-config": "30.0.4",
|
||||
"jest-haste-map": "30.0.2",
|
||||
"jest-message-util": "30.0.2",
|
||||
"jest-regex-util": "30.0.1",
|
||||
"jest-resolve": "30.0.2",
|
||||
"jest-resolve-dependencies": "30.0.4",
|
||||
"jest-runner": "30.0.4",
|
||||
"jest-runtime": "30.0.4",
|
||||
"jest-snapshot": "30.0.4",
|
||||
"jest-util": "30.0.2",
|
||||
"jest-validate": "30.0.2",
|
||||
"jest-watcher": "30.0.4",
|
||||
"micromatch": "^4.0.8",
|
||||
"pretty-format": "30.0.2",
|
||||
"slash": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/test-sequencer": "30.0.4",
|
||||
"@jest/test-utils": "30.0.4",
|
||||
"@types/graceful-fs": "^4.1.9",
|
||||
"@types/micromatch": "^4.0.9"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"node-notifier": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-core"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jestjs/jest/issues"
|
||||
},
|
||||
"homepage": "https://jestjs.io/",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"ava",
|
||||
"babel",
|
||||
"coverage",
|
||||
"easy",
|
||||
"expect",
|
||||
"facebook",
|
||||
"immersive",
|
||||
"instant",
|
||||
"jasmine",
|
||||
"jest",
|
||||
"jsdom",
|
||||
"mocha",
|
||||
"mocking",
|
||||
"painless",
|
||||
"qunit",
|
||||
"runner",
|
||||
"sandboxed",
|
||||
"snapshot",
|
||||
"tap",
|
||||
"tape",
|
||||
"test",
|
||||
"testing",
|
||||
"typescript",
|
||||
"watch"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "f4296d2bc85c1405f84ddf613a25d0bc3766b7e5"
|
||||
}
|
||||
22
frontend/node_modules/@jest/diff-sequences/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/diff-sequences/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.
|
||||
404
frontend/node_modules/@jest/diff-sequences/README.md
generated
vendored
Normal file
404
frontend/node_modules/@jest/diff-sequences/README.md
generated
vendored
Normal file
@@ -0,0 +1,404 @@
|
||||
# diff-sequences
|
||||
|
||||
Compare items in two sequences to find a **longest common subsequence**.
|
||||
|
||||
The items not in common are the items to delete or insert in a **shortest edit script**.
|
||||
|
||||
To maximize flexibility and minimize memory, you write **callback** functions as configuration:
|
||||
|
||||
**Input** function `isCommon(aIndex, bIndex)` compares items at indexes in the sequences and returns a truthy/falsey value. This package might call your function more than once for some pairs of indexes.
|
||||
|
||||
- Because your function encapsulates **comparison**, this package can compare items according to `===` operator, `Object.is` method, or other criterion.
|
||||
- Because your function encapsulates **sequences**, this package can find differences in arrays, strings, or other data.
|
||||
|
||||
**Output** function `foundSubsequence(nCommon, aCommon, bCommon)` receives the number of adjacent items and starting indexes of each common subsequence. If sequences do not have common items, then this package does not call your function.
|
||||
|
||||
If N is the sum of lengths of sequences and L is length of a longest common subsequence, then D = N – 2L is the number of **differences** in the corresponding shortest edit script.
|
||||
|
||||
[_An O(ND) Difference Algorithm and Its Variations_](http://xmailserver.org/diff2.pdf) by Eugene W. Myers is fast when sequences have **few** differences.
|
||||
|
||||
This package implements the **linear space** variation with optimizations so it is fast even when sequences have **many** differences.
|
||||
|
||||
## Usage
|
||||
|
||||
To add this package as a dependency of a project, do either of the following:
|
||||
|
||||
- `npm install diff-sequences`
|
||||
- `yarn add diff-sequences`
|
||||
|
||||
To use `diff` as the name of the default export from this package, do either of the following:
|
||||
|
||||
- `var diff = require('@jest/diff-sequences').default; // CommonJS modules`
|
||||
- `import diff from '@jest/diff-sequences'; // ECMAScript modules`
|
||||
|
||||
Call `diff` with the **lengths** of sequences and your **callback** functions:
|
||||
|
||||
```js
|
||||
const a = ['a', 'b', 'c', 'a', 'b', 'b', 'a'];
|
||||
const b = ['c', 'b', 'a', 'b', 'a', 'c'];
|
||||
|
||||
function isCommon(aIndex, bIndex) {
|
||||
return a[aIndex] === b[bIndex];
|
||||
}
|
||||
function foundSubsequence(nCommon, aCommon, bCommon) {
|
||||
// see examples
|
||||
}
|
||||
|
||||
diff(a.length, b.length, isCommon, foundSubsequence);
|
||||
```
|
||||
|
||||
## Example of longest common subsequence
|
||||
|
||||
Some sequences (for example, `a` and `b` in the example of usage) have more than one longest common subsequence.
|
||||
|
||||
This package finds the following common items:
|
||||
|
||||
| comparisons of common items | values | output arguments |
|
||||
| :------------------------------- | :--------- | --------------------------: |
|
||||
| `a[2] === b[0]` | `'c'` | `foundSubsequence(1, 2, 0)` |
|
||||
| `a[4] === b[1]` | `'b'` | `foundSubsequence(1, 4, 1)` |
|
||||
| `a[5] === b[3] && a[6] === b[4]` | `'b', 'a'` | `foundSubsequence(2, 5, 3)` |
|
||||
|
||||
The “edit graph” analogy in the Myers paper shows the following common items:
|
||||
|
||||
| comparisons of common items | values |
|
||||
| :------------------------------- | :--------- |
|
||||
| `a[2] === b[0]` | `'c'` |
|
||||
| `a[3] === b[2] && a[4] === b[3]` | `'a', 'b'` |
|
||||
| `a[6] === b[4]` | `'a'` |
|
||||
|
||||
Various packages which implement the Myers algorithm will **always agree** on the **length** of a longest common subsequence, but might **sometimes disagree** on which **items** are in it.
|
||||
|
||||
## Example of callback functions to count common items
|
||||
|
||||
```js
|
||||
// Return length of longest common subsequence according to === operator.
|
||||
function countCommonItems(a, b) {
|
||||
let n = 0;
|
||||
function isCommon(aIndex, bIndex) {
|
||||
return a[aIndex] === b[bIndex];
|
||||
}
|
||||
function foundSubsequence(nCommon) {
|
||||
n += nCommon;
|
||||
}
|
||||
|
||||
diff(a.length, b.length, isCommon, foundSubsequence);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
const commonLength = countCommonItems(
|
||||
['a', 'b', 'c', 'a', 'b', 'b', 'a'],
|
||||
['c', 'b', 'a', 'b', 'a', 'c'],
|
||||
);
|
||||
```
|
||||
|
||||
| category of items | expression | value |
|
||||
| :----------------- | ------------------------: | ----: |
|
||||
| in common | `commonLength` | `4` |
|
||||
| to delete from `a` | `a.length - commonLength` | `3` |
|
||||
| to insert from `b` | `b.length - commonLength` | `2` |
|
||||
|
||||
If the length difference `b.length - a.length` is:
|
||||
|
||||
- negative: its absolute value is the minimum number of items to **delete** from `a`
|
||||
- positive: it is the minimum number of items to **insert** from `b`
|
||||
- zero: there is an **equal** number of items to delete from `a` and insert from `b`
|
||||
- non-zero: there is an equal number of **additional** items to delete from `a` and insert from `b`
|
||||
|
||||
In this example, `6 - 7` is:
|
||||
|
||||
- negative: `1` is the minimum number of items to **delete** from `a`
|
||||
- non-zero: `2` is the number of **additional** items to delete from `a` and insert from `b`
|
||||
|
||||
## Example of callback functions to find common items
|
||||
|
||||
```js
|
||||
// Return array of items in longest common subsequence according to Object.is method.
|
||||
const findCommonItems = (a, b) => {
|
||||
const array = [];
|
||||
diff(
|
||||
a.length,
|
||||
b.length,
|
||||
(aIndex, bIndex) => Object.is(a[aIndex], b[bIndex]),
|
||||
(nCommon, aCommon) => {
|
||||
for (; nCommon !== 0; nCommon -= 1, aCommon += 1) {
|
||||
array.push(a[aCommon]);
|
||||
}
|
||||
},
|
||||
);
|
||||
return array;
|
||||
};
|
||||
|
||||
const commonItems = findCommonItems(
|
||||
['a', 'b', 'c', 'a', 'b', 'b', 'a'],
|
||||
['c', 'b', 'a', 'b', 'a', 'c'],
|
||||
);
|
||||
```
|
||||
|
||||
| `i` | `commonItems[i]` | `aIndex` |
|
||||
| --: | :--------------- | -------: |
|
||||
| `0` | `'c'` | `2` |
|
||||
| `1` | `'b'` | `4` |
|
||||
| `2` | `'b'` | `5` |
|
||||
| `3` | `'a'` | `6` |
|
||||
|
||||
## Example of callback functions to diff index intervals
|
||||
|
||||
Instead of slicing array-like objects, you can adjust indexes in your callback functions.
|
||||
|
||||
```js
|
||||
// Diff index intervals that are half open [start, end) like array slice method.
|
||||
const diffIndexIntervals = (a, aStart, aEnd, b, bStart, bEnd) => {
|
||||
// Validate: 0 <= aStart and aStart <= aEnd and aEnd <= a.length
|
||||
// Validate: 0 <= bStart and bStart <= bEnd and bEnd <= b.length
|
||||
|
||||
diff(
|
||||
aEnd - aStart,
|
||||
bEnd - bStart,
|
||||
(aIndex, bIndex) => Object.is(a[aStart + aIndex], b[bStart + bIndex]),
|
||||
(nCommon, aCommon, bCommon) => {
|
||||
// aStart + aCommon, bStart + bCommon
|
||||
},
|
||||
);
|
||||
|
||||
// After the last common subsequence, do any remaining work.
|
||||
};
|
||||
```
|
||||
|
||||
## Example of callback functions to emulate diff command
|
||||
|
||||
Linux or Unix has a `diff` command to compare files line by line. Its output is a **shortest edit script**:
|
||||
|
||||
- **c**hange adjacent lines from the first file to lines from the second file
|
||||
- **d**elete lines from the first file
|
||||
- **a**ppend or insert lines from the second file
|
||||
|
||||
```js
|
||||
// Given zero-based half-open range [start, end) of array indexes,
|
||||
// return one-based closed range [start + 1, end] as string.
|
||||
const getRange = (start, end) =>
|
||||
start + 1 === end ? `${start + 1}` : `${start + 1},${end}`;
|
||||
|
||||
// Given index intervals of lines to delete or insert, or both, or neither,
|
||||
// push formatted diff lines onto array.
|
||||
const pushDelIns = (aLines, aIndex, aEnd, bLines, bIndex, bEnd, array) => {
|
||||
const deleteLines = aIndex !== aEnd;
|
||||
const insertLines = bIndex !== bEnd;
|
||||
const changeLines = deleteLines && insertLines;
|
||||
if (changeLines) {
|
||||
array.push(`${getRange(aIndex, aEnd)}c${getRange(bIndex, bEnd)}`);
|
||||
} else if (deleteLines) {
|
||||
array.push(`${getRange(aIndex, aEnd)}d${String(bIndex)}`);
|
||||
} else if (insertLines) {
|
||||
array.push(`${String(aIndex)}a${getRange(bIndex, bEnd)}`);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
for (; aIndex !== aEnd; aIndex += 1) {
|
||||
array.push(`< ${aLines[aIndex]}`); // delete is less than
|
||||
}
|
||||
|
||||
if (changeLines) {
|
||||
array.push('---');
|
||||
}
|
||||
|
||||
for (; bIndex !== bEnd; bIndex += 1) {
|
||||
array.push(`> ${bLines[bIndex]}`); // insert is greater than
|
||||
}
|
||||
};
|
||||
|
||||
// Given content of two files, return emulated output of diff utility.
|
||||
const findShortestEditScript = (a, b) => {
|
||||
const aLines = a.split('\n');
|
||||
const bLines = b.split('\n');
|
||||
const aLength = aLines.length;
|
||||
const bLength = bLines.length;
|
||||
|
||||
const isCommon = (aIndex, bIndex) => aLines[aIndex] === bLines[bIndex];
|
||||
|
||||
let aIndex = 0;
|
||||
let bIndex = 0;
|
||||
const array = [];
|
||||
const foundSubsequence = (nCommon, aCommon, bCommon) => {
|
||||
pushDelIns(aLines, aIndex, aCommon, bLines, bIndex, bCommon, array);
|
||||
aIndex = aCommon + nCommon; // number of lines compared in a
|
||||
bIndex = bCommon + nCommon; // number of lines compared in b
|
||||
};
|
||||
|
||||
diff(aLength, bLength, isCommon, foundSubsequence);
|
||||
|
||||
// After the last common subsequence, push remaining change lines.
|
||||
pushDelIns(aLines, aIndex, aLength, bLines, bIndex, bLength, array);
|
||||
|
||||
return array.length === 0 ? '' : `${array.join('\n')}\n`;
|
||||
};
|
||||
```
|
||||
|
||||
## Example of callback functions to format diff lines
|
||||
|
||||
Here is simplified code to format **changed and unchanged lines** in expected and received values after a test fails in Jest:
|
||||
|
||||
```js
|
||||
// Format diff with minus or plus for change lines and space for common lines.
|
||||
const formatDiffLines = (a, b) => {
|
||||
// Jest depends on pretty-format package to serialize objects as strings.
|
||||
// Unindented for comparison to avoid distracting differences:
|
||||
const aLinesUn = format(a, {indent: 0 /*, other options*/}).split('\n');
|
||||
const bLinesUn = format(b, {indent: 0 /*, other options*/}).split('\n');
|
||||
// Indented to display changed and unchanged lines:
|
||||
const aLinesIn = format(a, {indent: 2 /*, other options*/}).split('\n');
|
||||
const bLinesIn = format(b, {indent: 2 /*, other options*/}).split('\n');
|
||||
|
||||
const aLength = aLinesIn.length; // Validate: aLinesUn.length === aLength
|
||||
const bLength = bLinesIn.length; // Validate: bLinesUn.length === bLength
|
||||
|
||||
const isCommon = (aIndex, bIndex) => aLinesUn[aIndex] === bLinesUn[bIndex];
|
||||
|
||||
// Only because the GitHub Flavored Markdown doc collapses adjacent spaces,
|
||||
// this example code and the following table represent spaces as middle dots.
|
||||
let aIndex = 0;
|
||||
let bIndex = 0;
|
||||
const array = [];
|
||||
const foundSubsequence = (nCommon, aCommon, bCommon) => {
|
||||
for (; aIndex !== aCommon; aIndex += 1) {
|
||||
array.push(`-·${aLinesIn[aIndex]}`); // delete is minus
|
||||
}
|
||||
for (; bIndex !== bCommon; bIndex += 1) {
|
||||
array.push(`+·${bLinesIn[bIndex]}`); // insert is plus
|
||||
}
|
||||
for (; nCommon !== 0; nCommon -= 1, aIndex += 1, bIndex += 1) {
|
||||
// For common lines, received indentation seems more intuitive.
|
||||
array.push(`··${bLinesIn[bIndex]}`); // common is space
|
||||
}
|
||||
};
|
||||
|
||||
diff(aLength, bLength, isCommon, foundSubsequence);
|
||||
|
||||
// After the last common subsequence, push remaining change lines.
|
||||
for (; aIndex !== aLength; aIndex += 1) {
|
||||
array.push(`-·${aLinesIn[aIndex]}`);
|
||||
}
|
||||
for (; bIndex !== bLength; bIndex += 1) {
|
||||
array.push(`+·${bLinesIn[bIndex]}`);
|
||||
}
|
||||
|
||||
return array;
|
||||
};
|
||||
|
||||
const expected = {
|
||||
searching: '',
|
||||
sorting: {
|
||||
ascending: true,
|
||||
fieldKey: 'what',
|
||||
},
|
||||
};
|
||||
const received = {
|
||||
searching: '',
|
||||
sorting: [
|
||||
{
|
||||
descending: false,
|
||||
fieldKey: 'what',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const diffLines = formatDiffLines(expected, received);
|
||||
```
|
||||
|
||||
If N is the sum of lengths of sequences and L is length of a longest common subsequence, then N – L is length of an array of diff lines. In this example, N is 7 + 9, L is 5, and N – L is 11.
|
||||
|
||||
| `i` | `diffLines[i]` | `aIndex` | `bIndex` |
|
||||
| ---: | :--------------------------------- | -------: | -------: |
|
||||
| `0` | `'··Object {'` | `0` | `0` |
|
||||
| `1` | `'····"searching": "",'` | `1` | `1` |
|
||||
| `2` | `'-···"sorting": Object {'` | `2` | |
|
||||
| `3` | `'-·····"ascending": true,'` | `3` | |
|
||||
| `4` | `'+·····"sorting": Array ['` | | `2` |
|
||||
| `5` | `'+·······Object {'` | | `3` |
|
||||
| `6` | `'+·········"descending": false,'` | | `4` |
|
||||
| `7` | `'··········"fieldKey": "what",'` | `4` | `5` |
|
||||
| `8` | `'········},'` | `5` | `6` |
|
||||
| `9` | `'+·····],'` | | `7` |
|
||||
| `10` | `'··}'` | `6` | `8` |
|
||||
|
||||
## Example of callback functions to find diff items
|
||||
|
||||
Here is simplified code to find changed and unchanged substrings **within adjacent changed lines** in expected and received values after a test fails in Jest:
|
||||
|
||||
```js
|
||||
// Return diff items for strings (compatible with diff-match-patch package).
|
||||
const findDiffItems = (a, b) => {
|
||||
const isCommon = (aIndex, bIndex) => a[aIndex] === b[bIndex];
|
||||
|
||||
let aIndex = 0;
|
||||
let bIndex = 0;
|
||||
const array = [];
|
||||
const foundSubsequence = (nCommon, aCommon, bCommon) => {
|
||||
if (aIndex !== aCommon) {
|
||||
array.push([-1, a.slice(aIndex, aCommon)]); // delete is -1
|
||||
}
|
||||
if (bIndex !== bCommon) {
|
||||
array.push([1, b.slice(bIndex, bCommon)]); // insert is 1
|
||||
}
|
||||
|
||||
aIndex = aCommon + nCommon; // number of characters compared in a
|
||||
bIndex = bCommon + nCommon; // number of characters compared in b
|
||||
array.push([0, a.slice(aCommon, aIndex)]); // common is 0
|
||||
};
|
||||
|
||||
diff(a.length, b.length, isCommon, foundSubsequence);
|
||||
|
||||
// After the last common subsequence, push remaining change items.
|
||||
if (aIndex !== a.length) {
|
||||
array.push([-1, a.slice(aIndex)]);
|
||||
}
|
||||
if (bIndex !== b.length) {
|
||||
array.push([1, b.slice(bIndex)]);
|
||||
}
|
||||
|
||||
return array;
|
||||
};
|
||||
|
||||
const expectedDeleted = ['"sorting": Object {', '"ascending": true,'].join(
|
||||
'\n',
|
||||
);
|
||||
const receivedInserted = [
|
||||
'"sorting": Array [',
|
||||
'Object {',
|
||||
'"descending": false,',
|
||||
].join('\n');
|
||||
|
||||
const diffItems = findDiffItems(expectedDeleted, receivedInserted);
|
||||
```
|
||||
|
||||
| `i` | `diffItems[i][0]` | `diffItems[i][1]` |
|
||||
| --: | ----------------: | :---------------- |
|
||||
| `0` | `0` | `'"sorting": '` |
|
||||
| `1` | `1` | `'Array [\n'` |
|
||||
| `2` | `0` | `'Object {\n"'` |
|
||||
| `3` | `-1` | `'a'` |
|
||||
| `4` | `1` | `'de'` |
|
||||
| `5` | `0` | `'scending": '` |
|
||||
| `6` | `-1` | `'tru'` |
|
||||
| `7` | `1` | `'fals'` |
|
||||
| `8` | `0` | `'e,'` |
|
||||
|
||||
The length difference `b.length - a.length` is equal to the sum of `diffItems[i][0]` values times `diffItems[i][1]` lengths. In this example, the difference `48 - 38` is equal to the sum `10`.
|
||||
|
||||
| category of diff item | `[0]` | `[1]` lengths | subtotal |
|
||||
| :-------------------- | ----: | -----------------: | -------: |
|
||||
| in common | `0` | `11 + 10 + 11 + 2` | `0` |
|
||||
| to delete from `a` | `–1` | `1 + 3` | `-4` |
|
||||
| to insert from `b` | `1` | `8 + 2 + 4` | `14` |
|
||||
|
||||
Instead of formatting the changed substrings with escape codes for colors in the `foundSubsequence` function to save memory, this example spends memory to **gain flexibility** before formatting, so a separate heuristic algorithm might modify the generic array of diff items to show changes more clearly:
|
||||
|
||||
| `i` | `diffItems[i][0]` | `diffItems[i][1]` |
|
||||
| --: | ----------------: | :---------------- |
|
||||
| `6` | `-1` | `'true'` |
|
||||
| `7` | `1` | `'false'` |
|
||||
| `8` | `0` | `','` |
|
||||
|
||||
For expected and received strings of serialized data, the result of finding changed **lines**, and then finding changed **substrings** within adjacent changed lines (as in the preceding two examples) sometimes displays the changes in a more intuitive way than the result of finding changed substrings, and then splitting them into changed and unchanged lines.
|
||||
39
frontend/node_modules/@jest/diff-sequences/build/index.d.ts
generated
vendored
Normal file
39
frontend/node_modules/@jest/diff-sequences/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export declare type Callbacks = {
|
||||
foundSubsequence: FoundSubsequence;
|
||||
isCommon: IsCommon;
|
||||
};
|
||||
|
||||
declare function diffSequence(
|
||||
aLength: number,
|
||||
bLength: number,
|
||||
isCommon: IsCommon,
|
||||
foundSubsequence: FoundSubsequence,
|
||||
): void;
|
||||
export default diffSequence;
|
||||
|
||||
declare type FoundSubsequence = (
|
||||
nCommon: number, // caller can assume: 0 < nCommon
|
||||
aCommon: number, // caller can assume: 0 <= aCommon && aCommon < aLength
|
||||
bCommon: number,
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
declare type IsCommon = (
|
||||
aIndex: number, // caller can assume: 0 <= aIndex && aIndex < aLength
|
||||
bIndex: number,
|
||||
) => boolean;
|
||||
|
||||
export {};
|
||||
637
frontend/node_modules/@jest/diff-sequences/build/index.js
generated
vendored
Normal file
637
frontend/node_modules/@jest/diff-sequences/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,637 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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_exports__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
|
||||
(() => {
|
||||
var exports = __webpack_exports__;
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = diffSequence;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
// This diff-sequences package implements the linear space variation in
|
||||
// An O(ND) Difference Algorithm and Its Variations by Eugene W. Myers
|
||||
|
||||
// Relationship in notation between Myers paper and this package:
|
||||
// A is a
|
||||
// N is aLength, aEnd - aStart, and so on
|
||||
// x is aIndex, aFirst, aLast, and so on
|
||||
// B is b
|
||||
// M is bLength, bEnd - bStart, and so on
|
||||
// y is bIndex, bFirst, bLast, and so on
|
||||
// Δ = N - M is negative of baDeltaLength = bLength - aLength
|
||||
// D is d
|
||||
// k is kF
|
||||
// k + Δ is kF = kR - baDeltaLength
|
||||
// V is aIndexesF or aIndexesR (see comment below about Indexes type)
|
||||
// index intervals [1, N] and [1, M] are [0, aLength) and [0, bLength)
|
||||
// starting point in forward direction (0, 0) is (-1, -1)
|
||||
// starting point in reverse direction (N + 1, M + 1) is (aLength, bLength)
|
||||
|
||||
// The “edit graph” for sequences a and b corresponds to items:
|
||||
// in a on the horizontal axis
|
||||
// in b on the vertical axis
|
||||
//
|
||||
// Given a-coordinate of a point in a diagonal, you can compute b-coordinate.
|
||||
//
|
||||
// Forward diagonals kF:
|
||||
// zero diagonal intersects top left corner
|
||||
// positive diagonals intersect top edge
|
||||
// negative diagonals intersect left edge
|
||||
//
|
||||
// Reverse diagonals kR:
|
||||
// zero diagonal intersects bottom right corner
|
||||
// positive diagonals intersect right edge
|
||||
// negative diagonals intersect bottom edge
|
||||
|
||||
// The graph contains a directed acyclic graph of edges:
|
||||
// horizontal: delete an item from a
|
||||
// vertical: insert an item from b
|
||||
// diagonal: common item in a and b
|
||||
//
|
||||
// The algorithm solves dual problems in the graph analogy:
|
||||
// Find longest common subsequence: path with maximum number of diagonal edges
|
||||
// Find shortest edit script: path with minimum number of non-diagonal edges
|
||||
|
||||
// Input callback function compares items at indexes in the sequences.
|
||||
|
||||
// Output callback function receives the number of adjacent items
|
||||
// and starting indexes of each common subsequence.
|
||||
|
||||
// Either original functions or wrapped to swap indexes if graph is transposed.
|
||||
|
||||
// Indexes in sequence a of last point of forward or reverse paths in graph.
|
||||
// Myers algorithm indexes by diagonal k which for negative is bad deopt in V8.
|
||||
// This package indexes by iF and iR which are greater than or equal to zero.
|
||||
// and also updates the index arrays in place to cut memory in half.
|
||||
// kF = 2 * iF - d
|
||||
// kR = d - 2 * iR
|
||||
|
||||
// Division of index intervals in sequences a and b at the middle change.
|
||||
// Invariant: intervals do not have common items at the start or end.
|
||||
|
||||
const pkg = '@jest/diff-sequences'; // for error messages
|
||||
const NOT_YET_SET = 0; // small int instead of undefined to avoid deopt in V8
|
||||
|
||||
// Return the number of common items that follow in forward direction.
|
||||
// The length of what Myers paper calls a “snake” in a forward path.
|
||||
const countCommonItemsF = (aIndex, aEnd, bIndex, bEnd, isCommon) => {
|
||||
let nCommon = 0;
|
||||
while (aIndex < aEnd && bIndex < bEnd && isCommon(aIndex, bIndex)) {
|
||||
aIndex += 1;
|
||||
bIndex += 1;
|
||||
nCommon += 1;
|
||||
}
|
||||
return nCommon;
|
||||
};
|
||||
|
||||
// Return the number of common items that precede in reverse direction.
|
||||
// The length of what Myers paper calls a “snake” in a reverse path.
|
||||
const countCommonItemsR = (aStart, aIndex, bStart, bIndex, isCommon) => {
|
||||
let nCommon = 0;
|
||||
while (aStart <= aIndex && bStart <= bIndex && isCommon(aIndex, bIndex)) {
|
||||
aIndex -= 1;
|
||||
bIndex -= 1;
|
||||
nCommon += 1;
|
||||
}
|
||||
return nCommon;
|
||||
};
|
||||
|
||||
// A simple function to extend forward paths from (d - 1) to d changes
|
||||
// when forward and reverse paths cannot yet overlap.
|
||||
const extendPathsF = (d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF // return the value because optimization might decrease it
|
||||
) => {
|
||||
// Unroll the first iteration.
|
||||
let iF = 0;
|
||||
let kF = -d; // kF = 2 * iF - d
|
||||
let aFirst = aIndexesF[iF]; // in first iteration always insert
|
||||
let aIndexPrev1 = aFirst; // prev value of [iF - 1] in next iteration
|
||||
aIndexesF[iF] += countCommonItemsF(aFirst + 1, aEnd, bF + aFirst - kF + 1, bEnd, isCommon);
|
||||
|
||||
// Optimization: skip diagonals in which paths cannot ever overlap.
|
||||
const nF = Math.min(d, iMaxF);
|
||||
|
||||
// The diagonals kF are odd when d is odd and even when d is even.
|
||||
for (iF += 1, kF += 2; iF <= nF; iF += 1, kF += 2) {
|
||||
// To get first point of path segment, move one change in forward direction
|
||||
// from last point of previous path segment in an adjacent diagonal.
|
||||
// In last possible iteration when iF === d and kF === d always delete.
|
||||
if (iF !== d && aIndexPrev1 < aIndexesF[iF]) {
|
||||
aFirst = aIndexesF[iF]; // vertical to insert from b
|
||||
} else {
|
||||
aFirst = aIndexPrev1 + 1; // horizontal to delete from a
|
||||
|
||||
if (aEnd <= aFirst) {
|
||||
// Optimization: delete moved past right of graph.
|
||||
return iF - 1;
|
||||
}
|
||||
}
|
||||
|
||||
// To get last point of path segment, move along diagonal of common items.
|
||||
aIndexPrev1 = aIndexesF[iF];
|
||||
aIndexesF[iF] = aFirst + countCommonItemsF(aFirst + 1, aEnd, bF + aFirst - kF + 1, bEnd, isCommon);
|
||||
}
|
||||
return iMaxF;
|
||||
};
|
||||
|
||||
// A simple function to extend reverse paths from (d - 1) to d changes
|
||||
// when reverse and forward paths cannot yet overlap.
|
||||
const extendPathsR = (d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR // return the value because optimization might decrease it
|
||||
) => {
|
||||
// Unroll the first iteration.
|
||||
let iR = 0;
|
||||
let kR = d; // kR = d - 2 * iR
|
||||
let aFirst = aIndexesR[iR]; // in first iteration always insert
|
||||
let aIndexPrev1 = aFirst; // prev value of [iR - 1] in next iteration
|
||||
aIndexesR[iR] -= countCommonItemsR(aStart, aFirst - 1, bStart, bR + aFirst - kR - 1, isCommon);
|
||||
|
||||
// Optimization: skip diagonals in which paths cannot ever overlap.
|
||||
const nR = Math.min(d, iMaxR);
|
||||
|
||||
// The diagonals kR are odd when d is odd and even when d is even.
|
||||
for (iR += 1, kR -= 2; iR <= nR; iR += 1, kR -= 2) {
|
||||
// To get first point of path segment, move one change in reverse direction
|
||||
// from last point of previous path segment in an adjacent diagonal.
|
||||
// In last possible iteration when iR === d and kR === -d always delete.
|
||||
if (iR !== d && aIndexesR[iR] < aIndexPrev1) {
|
||||
aFirst = aIndexesR[iR]; // vertical to insert from b
|
||||
} else {
|
||||
aFirst = aIndexPrev1 - 1; // horizontal to delete from a
|
||||
|
||||
if (aFirst < aStart) {
|
||||
// Optimization: delete moved past left of graph.
|
||||
return iR - 1;
|
||||
}
|
||||
}
|
||||
|
||||
// To get last point of path segment, move along diagonal of common items.
|
||||
aIndexPrev1 = aIndexesR[iR];
|
||||
aIndexesR[iR] = aFirst - countCommonItemsR(aStart, aFirst - 1, bStart, bR + aFirst - kR - 1, isCommon);
|
||||
}
|
||||
return iMaxR;
|
||||
};
|
||||
|
||||
// A complete function to extend forward paths from (d - 1) to d changes.
|
||||
// Return true if a path overlaps reverse path of (d - 1) changes in its diagonal.
|
||||
const extendOverlappablePathsF = (d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division // update prop values if return true
|
||||
) => {
|
||||
const bF = bStart - aStart; // bIndex = bF + aIndex - kF
|
||||
const aLength = aEnd - aStart;
|
||||
const bLength = bEnd - bStart;
|
||||
const baDeltaLength = bLength - aLength; // kF = kR - baDeltaLength
|
||||
|
||||
// Range of diagonals in which forward and reverse paths might overlap.
|
||||
const kMinOverlapF = -baDeltaLength - (d - 1); // -(d - 1) <= kR
|
||||
const kMaxOverlapF = -baDeltaLength + (d - 1); // kR <= (d - 1)
|
||||
|
||||
let aIndexPrev1 = NOT_YET_SET; // prev value of [iF - 1] in next iteration
|
||||
|
||||
// Optimization: skip diagonals in which paths cannot ever overlap.
|
||||
const nF = Math.min(d, iMaxF);
|
||||
|
||||
// The diagonals kF = 2 * iF - d are odd when d is odd and even when d is even.
|
||||
for (let iF = 0, kF = -d; iF <= nF; iF += 1, kF += 2) {
|
||||
// To get first point of path segment, move one change in forward direction
|
||||
// from last point of previous path segment in an adjacent diagonal.
|
||||
// In first iteration when iF === 0 and kF === -d always insert.
|
||||
// In last possible iteration when iF === d and kF === d always delete.
|
||||
const insert = iF === 0 || iF !== d && aIndexPrev1 < aIndexesF[iF];
|
||||
const aLastPrev = insert ? aIndexesF[iF] : aIndexPrev1;
|
||||
const aFirst = insert ? aLastPrev // vertical to insert from b
|
||||
: aLastPrev + 1; // horizontal to delete from a
|
||||
|
||||
// To get last point of path segment, move along diagonal of common items.
|
||||
const bFirst = bF + aFirst - kF;
|
||||
const nCommonF = countCommonItemsF(aFirst + 1, aEnd, bFirst + 1, bEnd, isCommon);
|
||||
const aLast = aFirst + nCommonF;
|
||||
aIndexPrev1 = aIndexesF[iF];
|
||||
aIndexesF[iF] = aLast;
|
||||
if (kMinOverlapF <= kF && kF <= kMaxOverlapF) {
|
||||
// Solve for iR of reverse path with (d - 1) changes in diagonal kF:
|
||||
// kR = kF + baDeltaLength
|
||||
// kR = (d - 1) - 2 * iR
|
||||
const iR = (d - 1 - (kF + baDeltaLength)) / 2;
|
||||
|
||||
// If this forward path overlaps the reverse path in this diagonal,
|
||||
// then this is the middle change of the index intervals.
|
||||
if (iR <= iMaxR && aIndexesR[iR] - 1 <= aLast) {
|
||||
// Unlike the Myers algorithm which finds only the middle “snake”
|
||||
// this package can find two common subsequences per division.
|
||||
// Last point of previous path segment is on an adjacent diagonal.
|
||||
const bLastPrev = bF + aLastPrev - (insert ? kF + 1 : kF - 1);
|
||||
|
||||
// Because of invariant that intervals preceding the middle change
|
||||
// cannot have common items at the end,
|
||||
// move in reverse direction along a diagonal of common items.
|
||||
const nCommonR = countCommonItemsR(aStart, aLastPrev, bStart, bLastPrev, isCommon);
|
||||
const aIndexPrevFirst = aLastPrev - nCommonR;
|
||||
const bIndexPrevFirst = bLastPrev - nCommonR;
|
||||
const aEndPreceding = aIndexPrevFirst + 1;
|
||||
const bEndPreceding = bIndexPrevFirst + 1;
|
||||
division.nChangePreceding = d - 1;
|
||||
if (d - 1 === aEndPreceding + bEndPreceding - aStart - bStart) {
|
||||
// Optimization: number of preceding changes in forward direction
|
||||
// is equal to number of items in preceding interval,
|
||||
// therefore it cannot contain any common items.
|
||||
division.aEndPreceding = aStart;
|
||||
division.bEndPreceding = bStart;
|
||||
} else {
|
||||
division.aEndPreceding = aEndPreceding;
|
||||
division.bEndPreceding = bEndPreceding;
|
||||
}
|
||||
division.nCommonPreceding = nCommonR;
|
||||
if (nCommonR !== 0) {
|
||||
division.aCommonPreceding = aEndPreceding;
|
||||
division.bCommonPreceding = bEndPreceding;
|
||||
}
|
||||
division.nCommonFollowing = nCommonF;
|
||||
if (nCommonF !== 0) {
|
||||
division.aCommonFollowing = aFirst + 1;
|
||||
division.bCommonFollowing = bFirst + 1;
|
||||
}
|
||||
const aStartFollowing = aLast + 1;
|
||||
const bStartFollowing = bFirst + nCommonF + 1;
|
||||
division.nChangeFollowing = d - 1;
|
||||
if (d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing) {
|
||||
// Optimization: number of changes in reverse direction
|
||||
// is equal to number of items in following interval,
|
||||
// therefore it cannot contain any common items.
|
||||
division.aStartFollowing = aEnd;
|
||||
division.bStartFollowing = bEnd;
|
||||
} else {
|
||||
division.aStartFollowing = aStartFollowing;
|
||||
division.bStartFollowing = bStartFollowing;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// A complete function to extend reverse paths from (d - 1) to d changes.
|
||||
// Return true if a path overlaps forward path of d changes in its diagonal.
|
||||
const extendOverlappablePathsR = (d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division // update prop values if return true
|
||||
) => {
|
||||
const bR = bEnd - aEnd; // bIndex = bR + aIndex - kR
|
||||
const aLength = aEnd - aStart;
|
||||
const bLength = bEnd - bStart;
|
||||
const baDeltaLength = bLength - aLength; // kR = kF + baDeltaLength
|
||||
|
||||
// Range of diagonals in which forward and reverse paths might overlap.
|
||||
const kMinOverlapR = baDeltaLength - d; // -d <= kF
|
||||
const kMaxOverlapR = baDeltaLength + d; // kF <= d
|
||||
|
||||
let aIndexPrev1 = NOT_YET_SET; // prev value of [iR - 1] in next iteration
|
||||
|
||||
// Optimization: skip diagonals in which paths cannot ever overlap.
|
||||
const nR = Math.min(d, iMaxR);
|
||||
|
||||
// The diagonals kR = d - 2 * iR are odd when d is odd and even when d is even.
|
||||
for (let iR = 0, kR = d; iR <= nR; iR += 1, kR -= 2) {
|
||||
// To get first point of path segment, move one change in reverse direction
|
||||
// from last point of previous path segment in an adjacent diagonal.
|
||||
// In first iteration when iR === 0 and kR === d always insert.
|
||||
// In last possible iteration when iR === d and kR === -d always delete.
|
||||
const insert = iR === 0 || iR !== d && aIndexesR[iR] < aIndexPrev1;
|
||||
const aLastPrev = insert ? aIndexesR[iR] : aIndexPrev1;
|
||||
const aFirst = insert ? aLastPrev // vertical to insert from b
|
||||
: aLastPrev - 1; // horizontal to delete from a
|
||||
|
||||
// To get last point of path segment, move along diagonal of common items.
|
||||
const bFirst = bR + aFirst - kR;
|
||||
const nCommonR = countCommonItemsR(aStart, aFirst - 1, bStart, bFirst - 1, isCommon);
|
||||
const aLast = aFirst - nCommonR;
|
||||
aIndexPrev1 = aIndexesR[iR];
|
||||
aIndexesR[iR] = aLast;
|
||||
if (kMinOverlapR <= kR && kR <= kMaxOverlapR) {
|
||||
// Solve for iF of forward path with d changes in diagonal kR:
|
||||
// kF = kR - baDeltaLength
|
||||
// kF = 2 * iF - d
|
||||
const iF = (d + (kR - baDeltaLength)) / 2;
|
||||
|
||||
// If this reverse path overlaps the forward path in this diagonal,
|
||||
// then this is a middle change of the index intervals.
|
||||
if (iF <= iMaxF && aLast - 1 <= aIndexesF[iF]) {
|
||||
const bLast = bFirst - nCommonR;
|
||||
division.nChangePreceding = d;
|
||||
if (d === aLast + bLast - aStart - bStart) {
|
||||
// Optimization: number of changes in reverse direction
|
||||
// is equal to number of items in preceding interval,
|
||||
// therefore it cannot contain any common items.
|
||||
division.aEndPreceding = aStart;
|
||||
division.bEndPreceding = bStart;
|
||||
} else {
|
||||
division.aEndPreceding = aLast;
|
||||
division.bEndPreceding = bLast;
|
||||
}
|
||||
division.nCommonPreceding = nCommonR;
|
||||
if (nCommonR !== 0) {
|
||||
// The last point of reverse path segment is start of common subsequence.
|
||||
division.aCommonPreceding = aLast;
|
||||
division.bCommonPreceding = bLast;
|
||||
}
|
||||
division.nChangeFollowing = d - 1;
|
||||
if (d === 1) {
|
||||
// There is no previous path segment.
|
||||
division.nCommonFollowing = 0;
|
||||
division.aStartFollowing = aEnd;
|
||||
division.bStartFollowing = bEnd;
|
||||
} else {
|
||||
// Unlike the Myers algorithm which finds only the middle “snake”
|
||||
// this package can find two common subsequences per division.
|
||||
// Last point of previous path segment is on an adjacent diagonal.
|
||||
const bLastPrev = bR + aLastPrev - (insert ? kR - 1 : kR + 1);
|
||||
|
||||
// Because of invariant that intervals following the middle change
|
||||
// cannot have common items at the start,
|
||||
// move in forward direction along a diagonal of common items.
|
||||
const nCommonF = countCommonItemsF(aLastPrev, aEnd, bLastPrev, bEnd, isCommon);
|
||||
division.nCommonFollowing = nCommonF;
|
||||
if (nCommonF !== 0) {
|
||||
// The last point of reverse path segment is start of common subsequence.
|
||||
division.aCommonFollowing = aLastPrev;
|
||||
division.bCommonFollowing = bLastPrev;
|
||||
}
|
||||
const aStartFollowing = aLastPrev + nCommonF; // aFirstPrev
|
||||
const bStartFollowing = bLastPrev + nCommonF; // bFirstPrev
|
||||
|
||||
if (d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing) {
|
||||
// Optimization: number of changes in forward direction
|
||||
// is equal to number of items in following interval,
|
||||
// therefore it cannot contain any common items.
|
||||
division.aStartFollowing = aEnd;
|
||||
division.bStartFollowing = bEnd;
|
||||
} else {
|
||||
division.aStartFollowing = aStartFollowing;
|
||||
division.bStartFollowing = bStartFollowing;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// Given index intervals and input function to compare items at indexes,
|
||||
// divide at the middle change.
|
||||
//
|
||||
// DO NOT CALL if start === end, because interval cannot contain common items
|
||||
// and because this function will throw the “no overlap” error.
|
||||
const divide = (nChange, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, aIndexesR, division // output
|
||||
) => {
|
||||
const bF = bStart - aStart; // bIndex = bF + aIndex - kF
|
||||
const bR = bEnd - aEnd; // bIndex = bR + aIndex - kR
|
||||
const aLength = aEnd - aStart;
|
||||
const bLength = bEnd - bStart;
|
||||
|
||||
// Because graph has square or portrait orientation,
|
||||
// length difference is minimum number of items to insert from b.
|
||||
// Corresponding forward and reverse diagonals in graph
|
||||
// depend on length difference of the sequences:
|
||||
// kF = kR - baDeltaLength
|
||||
// kR = kF + baDeltaLength
|
||||
const baDeltaLength = bLength - aLength;
|
||||
|
||||
// Optimization: max diagonal in graph intersects corner of shorter side.
|
||||
let iMaxF = aLength;
|
||||
let iMaxR = aLength;
|
||||
|
||||
// Initialize no changes yet in forward or reverse direction:
|
||||
aIndexesF[0] = aStart - 1; // at open start of interval, outside closed start
|
||||
aIndexesR[0] = aEnd; // at open end of interval
|
||||
|
||||
if (baDeltaLength % 2 === 0) {
|
||||
// The number of changes in paths is 2 * d if length difference is even.
|
||||
const dMin = (nChange || baDeltaLength) / 2;
|
||||
const dMax = (aLength + bLength) / 2;
|
||||
for (let d = 1; d <= dMax; d += 1) {
|
||||
iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
|
||||
if (d < dMin) {
|
||||
iMaxR = extendPathsR(d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR);
|
||||
} else if (
|
||||
// If a reverse path overlaps a forward path in the same diagonal,
|
||||
// return a division of the index intervals at the middle change.
|
||||
extendOverlappablePathsR(d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The number of changes in paths is 2 * d - 1 if length difference is odd.
|
||||
const dMin = ((nChange || baDeltaLength) + 1) / 2;
|
||||
const dMax = (aLength + bLength + 1) / 2;
|
||||
|
||||
// Unroll first half iteration so loop extends the relevant pairs of paths.
|
||||
// Because of invariant that intervals have no common items at start or end,
|
||||
// and limitation not to call divide with empty intervals,
|
||||
// therefore it cannot be called if a forward path with one change
|
||||
// would overlap a reverse path with no changes, even if dMin === 1.
|
||||
let d = 1;
|
||||
iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
|
||||
for (d += 1; d <= dMax; d += 1) {
|
||||
iMaxR = extendPathsR(d - 1, aStart, bStart, bR, isCommon, aIndexesR, iMaxR);
|
||||
if (d < dMin) {
|
||||
iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
|
||||
} else if (
|
||||
// If a forward path overlaps a reverse path in the same diagonal,
|
||||
// return a division of the index intervals at the middle change.
|
||||
extendOverlappablePathsF(d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
throw new Error(`${pkg}: no overlap aStart=${aStart} aEnd=${aEnd} bStart=${bStart} bEnd=${bEnd}`);
|
||||
};
|
||||
|
||||
// Given index intervals and input function to compare items at indexes,
|
||||
// return by output function the number of adjacent items and starting indexes
|
||||
// of each common subsequence. Divide and conquer with only linear space.
|
||||
//
|
||||
// The index intervals are half open [start, end) like array slice method.
|
||||
// DO NOT CALL if start === end, because interval cannot contain common items
|
||||
// and because divide function will throw the “no overlap” error.
|
||||
const findSubsequences = (nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division // temporary memory, not input nor output
|
||||
) => {
|
||||
if (bEnd - bStart < aEnd - aStart) {
|
||||
// Transpose graph so it has portrait instead of landscape orientation.
|
||||
// Always compare shorter to longer sequence for consistency and optimization.
|
||||
transposed = !transposed;
|
||||
if (transposed && callbacks.length === 1) {
|
||||
// Lazily wrap callback functions to swap args if graph is transposed.
|
||||
const {
|
||||
foundSubsequence,
|
||||
isCommon
|
||||
} = callbacks[0];
|
||||
callbacks[1] = {
|
||||
foundSubsequence: (nCommon, bCommon, aCommon) => {
|
||||
foundSubsequence(nCommon, aCommon, bCommon);
|
||||
},
|
||||
isCommon: (bIndex, aIndex) => isCommon(aIndex, bIndex)
|
||||
};
|
||||
}
|
||||
const tStart = aStart;
|
||||
const tEnd = aEnd;
|
||||
aStart = bStart;
|
||||
aEnd = bEnd;
|
||||
bStart = tStart;
|
||||
bEnd = tEnd;
|
||||
}
|
||||
const {
|
||||
foundSubsequence,
|
||||
isCommon
|
||||
} = callbacks[transposed ? 1 : 0];
|
||||
|
||||
// Divide the index intervals at the middle change.
|
||||
divide(nChange, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, aIndexesR, division);
|
||||
const {
|
||||
nChangePreceding,
|
||||
aEndPreceding,
|
||||
bEndPreceding,
|
||||
nCommonPreceding,
|
||||
aCommonPreceding,
|
||||
bCommonPreceding,
|
||||
nCommonFollowing,
|
||||
aCommonFollowing,
|
||||
bCommonFollowing,
|
||||
nChangeFollowing,
|
||||
aStartFollowing,
|
||||
bStartFollowing
|
||||
} = division;
|
||||
|
||||
// Unless either index interval is empty, they might contain common items.
|
||||
if (aStart < aEndPreceding && bStart < bEndPreceding) {
|
||||
// Recursely find and return common subsequences preceding the division.
|
||||
findSubsequences(nChangePreceding, aStart, aEndPreceding, bStart, bEndPreceding, transposed, callbacks, aIndexesF, aIndexesR, division);
|
||||
}
|
||||
|
||||
// Return common subsequences that are adjacent to the middle change.
|
||||
if (nCommonPreceding !== 0) {
|
||||
foundSubsequence(nCommonPreceding, aCommonPreceding, bCommonPreceding);
|
||||
}
|
||||
if (nCommonFollowing !== 0) {
|
||||
foundSubsequence(nCommonFollowing, aCommonFollowing, bCommonFollowing);
|
||||
}
|
||||
|
||||
// Unless either index interval is empty, they might contain common items.
|
||||
if (aStartFollowing < aEnd && bStartFollowing < bEnd) {
|
||||
// Recursely find and return common subsequences following the division.
|
||||
findSubsequences(nChangeFollowing, aStartFollowing, aEnd, bStartFollowing, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division);
|
||||
}
|
||||
};
|
||||
const validateLength = (name, arg) => {
|
||||
if (typeof arg !== 'number') {
|
||||
throw new TypeError(`${pkg}: ${name} typeof ${typeof arg} is not a number`);
|
||||
}
|
||||
if (!Number.isSafeInteger(arg)) {
|
||||
throw new RangeError(`${pkg}: ${name} value ${arg} is not a safe integer`);
|
||||
}
|
||||
if (arg < 0) {
|
||||
throw new RangeError(`${pkg}: ${name} value ${arg} is a negative integer`);
|
||||
}
|
||||
};
|
||||
const validateCallback = (name, arg) => {
|
||||
const type = typeof arg;
|
||||
if (type !== 'function') {
|
||||
throw new TypeError(`${pkg}: ${name} typeof ${type} is not a function`);
|
||||
}
|
||||
};
|
||||
|
||||
// Compare items in two sequences to find a longest common subsequence.
|
||||
// Given lengths of sequences and input function to compare items at indexes,
|
||||
// return by output function the number of adjacent items and starting indexes
|
||||
// of each common subsequence.
|
||||
function diffSequence(aLength, bLength, isCommon, foundSubsequence) {
|
||||
validateLength('aLength', aLength);
|
||||
validateLength('bLength', bLength);
|
||||
validateCallback('isCommon', isCommon);
|
||||
validateCallback('foundSubsequence', foundSubsequence);
|
||||
|
||||
// Count common items from the start in the forward direction.
|
||||
const nCommonF = countCommonItemsF(0, aLength, 0, bLength, isCommon);
|
||||
if (nCommonF !== 0) {
|
||||
foundSubsequence(nCommonF, 0, 0);
|
||||
}
|
||||
|
||||
// Unless both sequences consist of common items only,
|
||||
// find common items in the half-trimmed index intervals.
|
||||
if (aLength !== nCommonF || bLength !== nCommonF) {
|
||||
// Invariant: intervals do not have common items at the start.
|
||||
// The start of an index interval is closed like array slice method.
|
||||
const aStart = nCommonF;
|
||||
const bStart = nCommonF;
|
||||
|
||||
// Count common items from the end in the reverse direction.
|
||||
const nCommonR = countCommonItemsR(aStart, aLength - 1, bStart, bLength - 1, isCommon);
|
||||
|
||||
// Invariant: intervals do not have common items at the end.
|
||||
// The end of an index interval is open like array slice method.
|
||||
const aEnd = aLength - nCommonR;
|
||||
const bEnd = bLength - nCommonR;
|
||||
|
||||
// Unless one sequence consists of common items only,
|
||||
// therefore the other trimmed index interval consists of changes only,
|
||||
// find common items in the trimmed index intervals.
|
||||
const nCommonFR = nCommonF + nCommonR;
|
||||
if (aLength !== nCommonFR && bLength !== nCommonFR) {
|
||||
const nChange = 0; // number of change items is not yet known
|
||||
const transposed = false; // call the original unwrapped functions
|
||||
const callbacks = [{
|
||||
foundSubsequence,
|
||||
isCommon
|
||||
}];
|
||||
|
||||
// Indexes in sequence a of last points in furthest reaching paths
|
||||
// from outside the start at top left in the forward direction:
|
||||
const aIndexesF = [NOT_YET_SET];
|
||||
// from the end at bottom right in the reverse direction:
|
||||
const aIndexesR = [NOT_YET_SET];
|
||||
|
||||
// Initialize one object as output of all calls to divide function.
|
||||
const division = {
|
||||
aCommonFollowing: NOT_YET_SET,
|
||||
aCommonPreceding: NOT_YET_SET,
|
||||
aEndPreceding: NOT_YET_SET,
|
||||
aStartFollowing: NOT_YET_SET,
|
||||
bCommonFollowing: NOT_YET_SET,
|
||||
bCommonPreceding: NOT_YET_SET,
|
||||
bEndPreceding: NOT_YET_SET,
|
||||
bStartFollowing: NOT_YET_SET,
|
||||
nChangeFollowing: NOT_YET_SET,
|
||||
nChangePreceding: NOT_YET_SET,
|
||||
nCommonFollowing: NOT_YET_SET,
|
||||
nCommonPreceding: NOT_YET_SET
|
||||
};
|
||||
|
||||
// Find and return common subsequences in the trimmed index intervals.
|
||||
findSubsequences(nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division);
|
||||
}
|
||||
if (nCommonR !== 0) {
|
||||
foundSubsequence(nCommonR, aEnd, bEnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
3
frontend/node_modules/@jest/diff-sequences/build/index.mjs
generated
vendored
Normal file
3
frontend/node_modules/@jest/diff-sequences/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export default cjsModule.default;
|
||||
41
frontend/node_modules/@jest/diff-sequences/package.json
generated
vendored
Normal file
41
frontend/node_modules/@jest/diff-sequences/package.json
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@jest/diff-sequences",
|
||||
"version": "30.0.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/diff-sequences"
|
||||
},
|
||||
"license": "MIT",
|
||||
"description": "Compare items in two sequences to find a longest common subsequence",
|
||||
"keywords": [
|
||||
"fast",
|
||||
"linear",
|
||||
"space",
|
||||
"callback",
|
||||
"diff"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fast-check/jest": "^2.1.1",
|
||||
"benchmark": "^2.1.4",
|
||||
"diff": "^7.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "5ce865b4060189fe74cd486544816c079194a0f7"
|
||||
}
|
||||
22
frontend/node_modules/@jest/environment-jsdom-abstract/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/environment-jsdom-abstract/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.
|
||||
31
frontend/node_modules/@jest/environment-jsdom-abstract/build/index.d.mts
generated
vendored
Normal file
31
frontend/node_modules/@jest/environment-jsdom-abstract/build/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import { LegacyFakeTimers, ModernFakeTimers } from "@jest/fake-timers";
|
||||
import { ModuleMocker } from "jest-mock";
|
||||
import { Context } from "vm";
|
||||
import * as jsdom from "jsdom";
|
||||
import { EnvironmentContext, JestEnvironment, JestEnvironmentConfig } from "@jest/environment";
|
||||
import { Global } from "@jest/types";
|
||||
|
||||
//#region src/index.d.ts
|
||||
|
||||
type Win = Window & Global.Global & {
|
||||
Error: {
|
||||
stackTraceLimit: number;
|
||||
};
|
||||
};
|
||||
declare abstract class BaseJSDOMEnvironment implements JestEnvironment<number> {
|
||||
dom: jsdom.JSDOM | null;
|
||||
fakeTimers: LegacyFakeTimers<number> | null;
|
||||
fakeTimersModern: ModernFakeTimers | null;
|
||||
global: Win;
|
||||
private errorEventListener;
|
||||
moduleMocker: ModuleMocker | null;
|
||||
customExportConditions: string[];
|
||||
private readonly _configuredExportConditions?;
|
||||
protected constructor(config: JestEnvironmentConfig, context: EnvironmentContext, jsdomModule: typeof jsdom);
|
||||
setup(): Promise<void>;
|
||||
teardown(): Promise<void>;
|
||||
exportConditions(): Array<string>;
|
||||
getVmContext(): Context | null;
|
||||
}
|
||||
//#endregion
|
||||
export { BaseJSDOMEnvironment as default };
|
||||
47
frontend/node_modules/@jest/environment-jsdom-abstract/build/index.d.ts
generated
vendored
Normal file
47
frontend/node_modules/@jest/environment-jsdom-abstract/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* 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 {Context} from 'vm';
|
||||
import * as jsdom from 'jsdom';
|
||||
import {
|
||||
EnvironmentContext,
|
||||
JestEnvironment,
|
||||
JestEnvironmentConfig,
|
||||
} from '@jest/environment';
|
||||
import {LegacyFakeTimers, ModernFakeTimers} from '@jest/fake-timers';
|
||||
import {Global as Global_2} from '@jest/types';
|
||||
import {ModuleMocker} from 'jest-mock';
|
||||
|
||||
declare abstract class BaseJSDOMEnvironment implements JestEnvironment<number> {
|
||||
dom: jsdom.JSDOM | null;
|
||||
fakeTimers: LegacyFakeTimers<number> | null;
|
||||
fakeTimersModern: ModernFakeTimers | null;
|
||||
global: Win;
|
||||
private errorEventListener;
|
||||
moduleMocker: ModuleMocker | null;
|
||||
customExportConditions: Array<string>;
|
||||
private readonly _configuredExportConditions?;
|
||||
protected constructor(
|
||||
config: JestEnvironmentConfig,
|
||||
context: EnvironmentContext,
|
||||
jsdomModule: typeof jsdom,
|
||||
);
|
||||
setup(): Promise<void>;
|
||||
teardown(): Promise<void>;
|
||||
exportConditions(): Array<string>;
|
||||
getVmContext(): Context | null;
|
||||
}
|
||||
export default BaseJSDOMEnvironment;
|
||||
|
||||
declare type Win = Window &
|
||||
Global_2.Global & {
|
||||
Error: {
|
||||
stackTraceLimit: number;
|
||||
};
|
||||
};
|
||||
|
||||
export {};
|
||||
194
frontend/node_modules/@jest/environment-jsdom-abstract/build/index.js
generated
vendored
Normal file
194
frontend/node_modules/@jest/environment-jsdom-abstract/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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_exports__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
|
||||
(() => {
|
||||
var exports = __webpack_exports__;
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = void 0;
|
||||
function _fakeTimers() {
|
||||
const data = require("@jest/fake-timers");
|
||||
_fakeTimers = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestMock() {
|
||||
const data = require("jest-mock");
|
||||
_jestMock = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestUtil() {
|
||||
const data = require("jest-util");
|
||||
_jestUtil = 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.
|
||||
*/
|
||||
|
||||
// The `Window` interface does not have an `Error.stackTraceLimit` property, but
|
||||
// `JSDOMEnvironment` assumes it is there.
|
||||
|
||||
function isString(value) {
|
||||
return typeof value === 'string';
|
||||
}
|
||||
class BaseJSDOMEnvironment {
|
||||
dom;
|
||||
fakeTimers;
|
||||
fakeTimersModern;
|
||||
global;
|
||||
errorEventListener;
|
||||
moduleMocker;
|
||||
customExportConditions = ['browser'];
|
||||
_configuredExportConditions;
|
||||
constructor(config, context, jsdomModule) {
|
||||
const {
|
||||
projectConfig
|
||||
} = config;
|
||||
const {
|
||||
JSDOM,
|
||||
ResourceLoader,
|
||||
VirtualConsole
|
||||
} = jsdomModule;
|
||||
const virtualConsole = new VirtualConsole();
|
||||
virtualConsole.sendTo(context.console, {
|
||||
omitJSDOMErrors: true
|
||||
});
|
||||
virtualConsole.on('jsdomError', error => {
|
||||
context.console.error(error);
|
||||
});
|
||||
this.dom = new JSDOM(typeof projectConfig.testEnvironmentOptions.html === 'string' ? projectConfig.testEnvironmentOptions.html : '<!DOCTYPE html>', {
|
||||
pretendToBeVisual: true,
|
||||
resources: typeof projectConfig.testEnvironmentOptions.userAgent === 'string' ? new ResourceLoader({
|
||||
userAgent: projectConfig.testEnvironmentOptions.userAgent
|
||||
}) : undefined,
|
||||
runScripts: 'dangerously',
|
||||
url: 'http://localhost/',
|
||||
virtualConsole,
|
||||
...projectConfig.testEnvironmentOptions
|
||||
});
|
||||
const global = this.global = this.dom.window;
|
||||
if (global == null) {
|
||||
throw new Error('JSDOM did not return a Window object');
|
||||
}
|
||||
|
||||
// TODO: remove at some point - for "universal" code (code should use `globalThis`)
|
||||
global.global = global;
|
||||
|
||||
// Node's error-message stack size is limited at 10, but it's pretty useful
|
||||
// to see more than that when a test fails.
|
||||
this.global.Error.stackTraceLimit = 100;
|
||||
(0, _jestUtil().installCommonGlobals)(global, projectConfig.globals);
|
||||
|
||||
// TODO: remove this ASAP, but it currently causes tests to run really slow
|
||||
global.Buffer = Buffer;
|
||||
|
||||
// Report uncaught errors.
|
||||
this.errorEventListener = event => {
|
||||
if (userErrorListenerCount === 0 && event.error != null) {
|
||||
process.emit('uncaughtException', event.error);
|
||||
}
|
||||
};
|
||||
global.addEventListener('error', this.errorEventListener);
|
||||
|
||||
// However, don't report them as uncaught if the user listens to 'error' event.
|
||||
// In that case, we assume the might have custom error handling logic.
|
||||
const originalAddListener = global.addEventListener.bind(global);
|
||||
const originalRemoveListener = global.removeEventListener.bind(global);
|
||||
let userErrorListenerCount = 0;
|
||||
global.addEventListener = function (...args) {
|
||||
if (args[0] === 'error') {
|
||||
userErrorListenerCount++;
|
||||
}
|
||||
return originalAddListener.apply(this, args);
|
||||
};
|
||||
global.removeEventListener = function (...args) {
|
||||
if (args[0] === 'error') {
|
||||
userErrorListenerCount--;
|
||||
}
|
||||
return originalRemoveListener.apply(this, args);
|
||||
};
|
||||
if ('customExportConditions' in projectConfig.testEnvironmentOptions) {
|
||||
const {
|
||||
customExportConditions
|
||||
} = projectConfig.testEnvironmentOptions;
|
||||
if (Array.isArray(customExportConditions) && customExportConditions.every(isString)) {
|
||||
this._configuredExportConditions = customExportConditions;
|
||||
} else {
|
||||
throw new Error('Custom export conditions specified but they are not an array of strings');
|
||||
}
|
||||
}
|
||||
this.moduleMocker = new (_jestMock().ModuleMocker)(global);
|
||||
this.fakeTimers = new (_fakeTimers().LegacyFakeTimers)({
|
||||
config: projectConfig,
|
||||
global: global,
|
||||
moduleMocker: this.moduleMocker,
|
||||
timerConfig: {
|
||||
idToRef: id => id,
|
||||
refToId: ref => ref
|
||||
}
|
||||
});
|
||||
this.fakeTimersModern = new (_fakeTimers().ModernFakeTimers)({
|
||||
config: projectConfig,
|
||||
global: global
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
async setup() {}
|
||||
async teardown() {
|
||||
if (this.fakeTimers) {
|
||||
this.fakeTimers.dispose();
|
||||
}
|
||||
if (this.fakeTimersModern) {
|
||||
this.fakeTimersModern.dispose();
|
||||
}
|
||||
if (this.global != null) {
|
||||
if (this.errorEventListener) {
|
||||
this.global.removeEventListener('error', this.errorEventListener);
|
||||
}
|
||||
this.global.close();
|
||||
}
|
||||
this.errorEventListener = null;
|
||||
// @ts-expect-error: this.global not allowed to be `null`
|
||||
this.global = null;
|
||||
this.dom = null;
|
||||
this.fakeTimers = null;
|
||||
this.fakeTimersModern = null;
|
||||
}
|
||||
exportConditions() {
|
||||
return this._configuredExportConditions ?? this.customExportConditions;
|
||||
}
|
||||
getVmContext() {
|
||||
if (this.dom) {
|
||||
return this.dom.getInternalVMContext();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports["default"] = BaseJSDOMEnvironment;
|
||||
})();
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
3
frontend/node_modules/@jest/environment-jsdom-abstract/build/index.mjs
generated
vendored
Normal file
3
frontend/node_modules/@jest/environment-jsdom-abstract/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export default cjsModule.default;
|
||||
49
frontend/node_modules/@jest/environment-jsdom-abstract/package.json
generated
vendored
Normal file
49
frontend/node_modules/@jest/environment-jsdom-abstract/package.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "@jest/environment-jsdom-abstract",
|
||||
"version": "30.0.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-environment-jsdom-abstract"
|
||||
},
|
||||
"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": {
|
||||
"@jest/environment": "30.0.4",
|
||||
"@jest/fake-timers": "30.0.4",
|
||||
"@jest/types": "30.0.1",
|
||||
"@types/jsdom": "^21.1.7",
|
||||
"@types/node": "*",
|
||||
"jest-mock": "30.0.2",
|
||||
"jest-util": "30.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jsdom": "^26.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"canvas": "^3.0.0",
|
||||
"jsdom": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"canvas": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "f4296d2bc85c1405f84ddf613a25d0bc3766b7e5"
|
||||
}
|
||||
22
frontend/node_modules/@jest/environment/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/environment/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.
|
||||
397
frontend/node_modules/@jest/environment/build/index.d.mts
generated
vendored
Normal file
397
frontend/node_modules/@jest/environment/build/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,397 @@
|
||||
import { Context } from "vm";
|
||||
import { LegacyFakeTimers, ModernFakeTimers } from "@jest/fake-timers";
|
||||
import { Circus, Config, Global } from "@jest/types";
|
||||
import { Mocked, ModuleMocker } from "jest-mock";
|
||||
|
||||
//#region src/index.d.ts
|
||||
|
||||
type EnvironmentContext = {
|
||||
console: Console;
|
||||
docblockPragmas: Record<string, string | Array<string>>;
|
||||
testPath: string;
|
||||
};
|
||||
type ModuleWrapper = (this: Module['exports'], module: Module, exports: Module['exports'], require: Module['require'], __dirname: string, __filename: Module['filename'], jest?: Jest, ...sandboxInjectedGlobals: Array<Global.Global[keyof Global.Global]>) => unknown;
|
||||
interface JestImportMeta extends ImportMeta {
|
||||
jest: Jest;
|
||||
}
|
||||
interface JestEnvironmentConfig {
|
||||
projectConfig: Config.ProjectConfig;
|
||||
globalConfig: Config.GlobalConfig;
|
||||
}
|
||||
declare class JestEnvironment<Timer = unknown> {
|
||||
constructor(config: JestEnvironmentConfig, context: EnvironmentContext);
|
||||
global: Global.Global;
|
||||
fakeTimers: LegacyFakeTimers<Timer> | null;
|
||||
fakeTimersModern: ModernFakeTimers | null;
|
||||
moduleMocker: ModuleMocker | null;
|
||||
getVmContext(): Context | null;
|
||||
setup(): Promise<void>;
|
||||
teardown(): Promise<void>;
|
||||
handleTestEvent?: Circus.EventHandler;
|
||||
exportConditions?: () => Array<string>;
|
||||
}
|
||||
type Module = NodeModule;
|
||||
interface Jest {
|
||||
/**
|
||||
* Advances all timers by `msToRun` milliseconds. All pending "macro-tasks"
|
||||
* that have been queued via `setTimeout()` or `setInterval()`, and would be
|
||||
* executed within this time frame will be executed.
|
||||
*/
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
/**
|
||||
* Advances all timers by `msToRun` milliseconds, firing callbacks if necessary.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
advanceTimersByTimeAsync(msToRun: number): Promise<void>;
|
||||
/**
|
||||
* Advances all timers by the needed milliseconds to execute callbacks currently scheduled with `requestAnimationFrame`.
|
||||
* `advanceTimersToNextFrame()` is a helpful way to execute code that is scheduled using `requestAnimationFrame`.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
advanceTimersToNextFrame(): void;
|
||||
/**
|
||||
* Advances all timers by the needed milliseconds so that only the next
|
||||
* timeouts/intervals will run. Optionally, you can provide steps, so it will
|
||||
* run steps amount of next timeouts/intervals.
|
||||
*/
|
||||
advanceTimersToNextTimer(steps?: number): void;
|
||||
/**
|
||||
* Advances the clock to the moment of the first scheduled timer, firing it.
|
||||
* Optionally, you can provide steps, so it will run steps amount of
|
||||
* next timeouts/intervals.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
advanceTimersToNextTimerAsync(steps?: number): Promise<void>;
|
||||
/**
|
||||
* Disables automatic mocking in the module loader.
|
||||
*/
|
||||
autoMockOff(): Jest;
|
||||
/**
|
||||
* Enables automatic mocking in the module loader.
|
||||
*/
|
||||
autoMockOn(): Jest;
|
||||
/**
|
||||
* Clears the `mock.calls`, `mock.instances`, `mock.contexts` and `mock.results` properties of
|
||||
* all mocks. Equivalent to calling `.mockClear()` on every mocked function.
|
||||
*/
|
||||
clearAllMocks(): Jest;
|
||||
/**
|
||||
* Removes any pending timers from the timer system. If any timers have been
|
||||
* scheduled, they will be cleared and will never have the opportunity to
|
||||
* execute in the future.
|
||||
*/
|
||||
clearAllTimers(): void;
|
||||
/**
|
||||
* Given the name of a module, use the automatic mocking system to generate a
|
||||
* mocked version of the module for you.
|
||||
*
|
||||
* This is useful when you want to create a manual mock that extends the
|
||||
* automatic mock's behavior.
|
||||
*/
|
||||
createMockFromModule<T = unknown>(moduleName: string): Mocked<T>;
|
||||
/**
|
||||
* Indicates that the module system should never return a mocked version of
|
||||
* the specified module and its dependencies.
|
||||
*/
|
||||
deepUnmock(moduleName: string): Jest;
|
||||
/**
|
||||
* Disables automatic mocking in the module loader.
|
||||
*
|
||||
* After this method is called, all `require()`s will return the real
|
||||
* versions of each module (rather than a mocked version).
|
||||
*/
|
||||
disableAutomock(): Jest;
|
||||
/**
|
||||
* When using `babel-jest`, calls to `jest.mock()` will automatically be hoisted
|
||||
* to the top of the code block. Use this method if you want to explicitly
|
||||
* avoid this behavior.
|
||||
*/
|
||||
doMock<T = unknown>(moduleName: string, moduleFactory?: () => T, options?: {
|
||||
virtual?: boolean;
|
||||
}): Jest;
|
||||
/**
|
||||
* When using `babel-jest`, calls to `jest.unmock()` will automatically be hoisted
|
||||
* to the top of the code block. Use this method if you want to explicitly
|
||||
* avoid this behavior.
|
||||
*/
|
||||
dontMock(moduleName: string): Jest;
|
||||
/**
|
||||
* Enables automatic mocking in the module loader.
|
||||
*/
|
||||
enableAutomock(): Jest;
|
||||
/**
|
||||
* Creates a mock function. Optionally takes a mock implementation.
|
||||
*/
|
||||
fn: ModuleMocker['fn'];
|
||||
/**
|
||||
* When mocking time, `Date.now()` will also be mocked. If you for some reason
|
||||
* need access to the real current time, you can invoke this function.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
getRealSystemTime(): number;
|
||||
/**
|
||||
* Retrieves the seed value. It will be randomly generated for each test run
|
||||
* or can be manually set via the `--seed` CLI argument.
|
||||
*/
|
||||
getSeed(): number;
|
||||
/**
|
||||
* Returns the number of fake timers still left to run.
|
||||
*/
|
||||
getTimerCount(): number;
|
||||
/**
|
||||
* Returns `true` if test environment has been torn down.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* if (jest.isEnvironmentTornDown()) {
|
||||
* // The Jest environment has been torn down, so stop doing work
|
||||
* return;
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
isEnvironmentTornDown(): boolean;
|
||||
/**
|
||||
* Determines if the given function is a mocked function.
|
||||
*/
|
||||
isMockFunction: ModuleMocker['isMockFunction'];
|
||||
/**
|
||||
* `jest.isolateModules()` goes a step further than `jest.resetModules()` and
|
||||
* creates a sandbox registry for the modules that are loaded inside the callback
|
||||
* function. This is useful to isolate specific modules for every test so that
|
||||
* local module state doesn't conflict between tests.
|
||||
*/
|
||||
isolateModules(fn: () => void): Jest;
|
||||
/**
|
||||
* `jest.isolateModulesAsync()` is the equivalent of `jest.isolateModules()`, but for
|
||||
* async functions to be wrapped. The caller is expected to `await` the completion of
|
||||
* `isolateModulesAsync`.
|
||||
*/
|
||||
isolateModulesAsync(fn: () => Promise<void>): Promise<void>;
|
||||
/**
|
||||
* Mocks a module with an auto-mocked version when it is being required.
|
||||
*/
|
||||
mock<T = unknown>(moduleName: string, moduleFactory?: () => T, options?: {
|
||||
virtual?: boolean;
|
||||
}): Jest;
|
||||
/**
|
||||
* Mocks a module with the provided module factory when it is being imported.
|
||||
*/
|
||||
unstable_mockModule<T = unknown>(moduleName: string, moduleFactory: () => T | Promise<T>, options?: {
|
||||
virtual?: boolean;
|
||||
}): Jest;
|
||||
/**
|
||||
* Wraps types of the `source` object and its deep members with type definitions
|
||||
* of Jest mock function. Pass `{shallow: true}` option to disable the deeply
|
||||
* mocked behavior.
|
||||
*/
|
||||
mocked: ModuleMocker['mocked'];
|
||||
/**
|
||||
* Returns the current time in ms of the fake timer clock.
|
||||
*/
|
||||
now(): number;
|
||||
/**
|
||||
* Registers a callback function that is invoked whenever a mock is generated for a module.
|
||||
* This callback is passed the module path and the newly created mock object, and must return
|
||||
* the (potentially modified) mock object.
|
||||
*
|
||||
* If multiple callbacks are registered, they will be called in the order they were added.
|
||||
* Each callback receives the result of the previous callback as the `moduleMock` parameter,
|
||||
* making it possible to apply sequential transformations.
|
||||
*/
|
||||
onGenerateMock<T>(cb: (modulePath: string, moduleMock: T) => T): Jest;
|
||||
/**
|
||||
* Replaces property on an object with another value.
|
||||
*
|
||||
* @remarks
|
||||
* For mocking functions or 'get' or 'set' accessors, use `jest.spyOn()` instead.
|
||||
*/
|
||||
replaceProperty: ModuleMocker['replaceProperty'];
|
||||
/**
|
||||
* Returns the actual module instead of a mock, bypassing all checks on
|
||||
* whether the module should receive a mock implementation or not.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* jest.mock('../myModule', () => {
|
||||
* // Require the original module to not be mocked...
|
||||
* const originalModule = jest.requireActual('../myModule');
|
||||
*
|
||||
* return {
|
||||
* __esModule: true, // Use it when dealing with esModules
|
||||
* ...originalModule,
|
||||
* getRandom: jest.fn().mockReturnValue(10),
|
||||
* };
|
||||
* });
|
||||
*
|
||||
* const getRandom = require('../myModule').getRandom;
|
||||
*
|
||||
* getRandom(); // Always returns 10
|
||||
* ```
|
||||
*/
|
||||
requireActual<T = unknown>(moduleName: string): T;
|
||||
/**
|
||||
* Returns a mock module instead of the actual module, bypassing all checks
|
||||
* on whether the module should be required normally or not.
|
||||
*/
|
||||
requireMock<T = unknown>(moduleName: string): T;
|
||||
/**
|
||||
* Resets the state of all mocks. Equivalent to calling `.mockReset()` on
|
||||
* every mocked function.
|
||||
*/
|
||||
resetAllMocks(): Jest;
|
||||
/**
|
||||
* Resets the module registry - the cache of all required modules. This is
|
||||
* useful to isolate modules where local state might conflict between tests.
|
||||
*/
|
||||
resetModules(): Jest;
|
||||
/**
|
||||
* Restores all mocks and replaced properties back to their original value.
|
||||
* Equivalent to calling `.mockRestore()` on every mocked function
|
||||
* and `.restore()` on every replaced property.
|
||||
*
|
||||
* Beware that `jest.restoreAllMocks()` only works when the mock was created
|
||||
* with `jest.spyOn()`; other mocks will require you to manually restore them.
|
||||
*/
|
||||
restoreAllMocks(): Jest;
|
||||
/**
|
||||
* Runs failed tests n-times until they pass or until the max number of
|
||||
* retries is exhausted.
|
||||
*
|
||||
* If `logErrorsBeforeRetry` is enabled, Jest will log the error(s) that caused
|
||||
* the test to fail to the console, providing visibility on why a retry occurred.
|
||||
* retries is exhausted.
|
||||
*
|
||||
* `waitBeforeRetry` is the number of milliseconds to wait before retrying
|
||||
*
|
||||
* `retryImmediately` is the flag to retry the failed test immediately after
|
||||
* failure
|
||||
*
|
||||
* @remarks
|
||||
* Only available with `jest-circus` runner.
|
||||
*/
|
||||
retryTimes(numRetries: number, options?: {
|
||||
logErrorsBeforeRetry?: boolean;
|
||||
retryImmediately?: boolean;
|
||||
waitBeforeRetry?: number;
|
||||
}): Jest;
|
||||
/**
|
||||
* Exhausts tasks queued by `setImmediate()`.
|
||||
*
|
||||
* @remarks
|
||||
* Only available when using legacy fake timers implementation.
|
||||
*/
|
||||
runAllImmediates(): void;
|
||||
/**
|
||||
* Exhausts the micro-task queue (usually interfaced in node via
|
||||
* `process.nextTick()`).
|
||||
*/
|
||||
runAllTicks(): void;
|
||||
/**
|
||||
* Exhausts the macro-task queue (i.e., all tasks queued by `setTimeout()`
|
||||
* and `setInterval()`).
|
||||
*/
|
||||
runAllTimers(): void;
|
||||
/**
|
||||
* Exhausts the macro-task queue (i.e., all tasks queued by `setTimeout()`
|
||||
* and `setInterval()`).
|
||||
*
|
||||
* @remarks
|
||||
* If new timers are added while it is executing they will be run as well.
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
runAllTimersAsync(): Promise<void>;
|
||||
/**
|
||||
* Executes only the macro-tasks that are currently pending (i.e., only the
|
||||
* tasks that have been queued by `setTimeout()` or `setInterval()` up to this
|
||||
* point). If any of the currently pending macro-tasks schedule new
|
||||
* macro-tasks, those new tasks will not be executed by this call.
|
||||
*/
|
||||
runOnlyPendingTimers(): void;
|
||||
/**
|
||||
* Executes only the macro-tasks that are currently pending (i.e., only the
|
||||
* tasks that have been queued by `setTimeout()` or `setInterval()` up to this
|
||||
* point). If any of the currently pending macro-tasks schedule new
|
||||
* macro-tasks, those new tasks will not be executed by this call.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
runOnlyPendingTimersAsync(): Promise<void>;
|
||||
/**
|
||||
* Explicitly supplies the mock object that the module system should return
|
||||
* for the specified module.
|
||||
*
|
||||
* @remarks
|
||||
* It is recommended to use `jest.mock()` instead. The `jest.mock()` API's second
|
||||
* argument is a module factory instead of the expected exported module object.
|
||||
*/
|
||||
setMock(moduleName: string, moduleExports: unknown): Jest;
|
||||
/**
|
||||
* Set the current system time used by fake timers. Simulates a user changing
|
||||
* the system clock while your program is running. It affects the current time,
|
||||
* but it does not in itself cause e.g. timers to fire; they will fire exactly
|
||||
* as they would have done without the call to `jest.setSystemTime()`.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
setSystemTime(now?: number | Date): void;
|
||||
/**
|
||||
* Set the default timeout interval for tests and before/after hooks in
|
||||
* milliseconds.
|
||||
*
|
||||
* @remarks
|
||||
* The default timeout interval is 5 seconds if this method is not called.
|
||||
*/
|
||||
setTimeout(timeout: number): Jest;
|
||||
/**
|
||||
* Creates a mock function similar to `jest.fn()` but also tracks calls to
|
||||
* `object[methodName]`.
|
||||
*
|
||||
* Optional third argument of `accessType` can be either 'get' or 'set', which
|
||||
* proves to be useful when you want to spy on a getter or a setter, respectively.
|
||||
*
|
||||
* @remarks
|
||||
* By default, `jest.spyOn()` also calls the spied method. This is different
|
||||
* behavior from most other test libraries.
|
||||
*/
|
||||
spyOn: ModuleMocker['spyOn'];
|
||||
/**
|
||||
* Indicates that the module system should never return a mocked version of
|
||||
* the specified module from `require()` (e.g. that it should always return the
|
||||
* real module).
|
||||
*/
|
||||
unmock(moduleName: string): Jest;
|
||||
/**
|
||||
* Indicates that the module system should never return a mocked version of
|
||||
* the specified module when it is being imported (e.g. that it should always
|
||||
* return the real module).
|
||||
*/
|
||||
unstable_unmockModule(moduleName: string): Jest;
|
||||
/**
|
||||
* Instructs Jest to use fake versions of the global date, performance,
|
||||
* time and timer APIs. Fake timers implementation is backed by
|
||||
* [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers).
|
||||
*
|
||||
* @remarks
|
||||
* Calling `jest.useFakeTimers()` once again in the same test file would reinstall
|
||||
* fake timers using the provided options.
|
||||
*/
|
||||
useFakeTimers(fakeTimersConfig?: Config.FakeTimersConfig | Config.LegacyFakeTimersConfig): Jest;
|
||||
/**
|
||||
* Instructs Jest to restore the original implementations of the global date,
|
||||
* performance, time and timer APIs.
|
||||
*/
|
||||
useRealTimers(): Jest;
|
||||
}
|
||||
//#endregion
|
||||
export { EnvironmentContext, Jest, JestEnvironment, JestEnvironmentConfig, JestImportMeta, Module, ModuleWrapper };
|
||||
434
frontend/node_modules/@jest/environment/build/index.d.ts
generated
vendored
Normal file
434
frontend/node_modules/@jest/environment/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,434 @@
|
||||
/**
|
||||
* 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 {Context} from 'vm';
|
||||
import {LegacyFakeTimers, ModernFakeTimers} from '@jest/fake-timers';
|
||||
import {Circus, Config, Global as Global_2} from '@jest/types';
|
||||
import {Mocked, ModuleMocker} from 'jest-mock';
|
||||
|
||||
export declare type EnvironmentContext = {
|
||||
console: Console;
|
||||
docblockPragmas: Record<string, string | Array<string>>;
|
||||
testPath: string;
|
||||
};
|
||||
|
||||
export declare interface Jest {
|
||||
/**
|
||||
* Advances all timers by `msToRun` milliseconds. All pending "macro-tasks"
|
||||
* that have been queued via `setTimeout()` or `setInterval()`, and would be
|
||||
* executed within this time frame will be executed.
|
||||
*/
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
/**
|
||||
* Advances all timers by `msToRun` milliseconds, firing callbacks if necessary.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
advanceTimersByTimeAsync(msToRun: number): Promise<void>;
|
||||
/**
|
||||
* Advances all timers by the needed milliseconds to execute callbacks currently scheduled with `requestAnimationFrame`.
|
||||
* `advanceTimersToNextFrame()` is a helpful way to execute code that is scheduled using `requestAnimationFrame`.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
advanceTimersToNextFrame(): void;
|
||||
/**
|
||||
* Advances all timers by the needed milliseconds so that only the next
|
||||
* timeouts/intervals will run. Optionally, you can provide steps, so it will
|
||||
* run steps amount of next timeouts/intervals.
|
||||
*/
|
||||
advanceTimersToNextTimer(steps?: number): void;
|
||||
/**
|
||||
* Advances the clock to the moment of the first scheduled timer, firing it.
|
||||
* Optionally, you can provide steps, so it will run steps amount of
|
||||
* next timeouts/intervals.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
advanceTimersToNextTimerAsync(steps?: number): Promise<void>;
|
||||
/**
|
||||
* Disables automatic mocking in the module loader.
|
||||
*/
|
||||
autoMockOff(): Jest;
|
||||
/**
|
||||
* Enables automatic mocking in the module loader.
|
||||
*/
|
||||
autoMockOn(): Jest;
|
||||
/**
|
||||
* Clears the `mock.calls`, `mock.instances`, `mock.contexts` and `mock.results` properties of
|
||||
* all mocks. Equivalent to calling `.mockClear()` on every mocked function.
|
||||
*/
|
||||
clearAllMocks(): Jest;
|
||||
/**
|
||||
* Removes any pending timers from the timer system. If any timers have been
|
||||
* scheduled, they will be cleared and will never have the opportunity to
|
||||
* execute in the future.
|
||||
*/
|
||||
clearAllTimers(): void;
|
||||
/**
|
||||
* Given the name of a module, use the automatic mocking system to generate a
|
||||
* mocked version of the module for you.
|
||||
*
|
||||
* This is useful when you want to create a manual mock that extends the
|
||||
* automatic mock's behavior.
|
||||
*/
|
||||
createMockFromModule<T = unknown>(moduleName: string): Mocked<T>;
|
||||
/**
|
||||
* Indicates that the module system should never return a mocked version of
|
||||
* the specified module and its dependencies.
|
||||
*/
|
||||
deepUnmock(moduleName: string): Jest;
|
||||
/**
|
||||
* Disables automatic mocking in the module loader.
|
||||
*
|
||||
* After this method is called, all `require()`s will return the real
|
||||
* versions of each module (rather than a mocked version).
|
||||
*/
|
||||
disableAutomock(): Jest;
|
||||
/**
|
||||
* When using `babel-jest`, calls to `jest.mock()` will automatically be hoisted
|
||||
* to the top of the code block. Use this method if you want to explicitly
|
||||
* avoid this behavior.
|
||||
*/
|
||||
doMock<T = unknown>(
|
||||
moduleName: string,
|
||||
moduleFactory?: () => T,
|
||||
options?: {
|
||||
virtual?: boolean;
|
||||
},
|
||||
): Jest;
|
||||
/**
|
||||
* When using `babel-jest`, calls to `jest.unmock()` will automatically be hoisted
|
||||
* to the top of the code block. Use this method if you want to explicitly
|
||||
* avoid this behavior.
|
||||
*/
|
||||
dontMock(moduleName: string): Jest;
|
||||
/**
|
||||
* Enables automatic mocking in the module loader.
|
||||
*/
|
||||
enableAutomock(): Jest;
|
||||
/**
|
||||
* Creates a mock function. Optionally takes a mock implementation.
|
||||
*/
|
||||
fn: ModuleMocker['fn'];
|
||||
/**
|
||||
* When mocking time, `Date.now()` will also be mocked. If you for some reason
|
||||
* need access to the real current time, you can invoke this function.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
getRealSystemTime(): number;
|
||||
/**
|
||||
* Retrieves the seed value. It will be randomly generated for each test run
|
||||
* or can be manually set via the `--seed` CLI argument.
|
||||
*/
|
||||
getSeed(): number;
|
||||
/**
|
||||
* Returns the number of fake timers still left to run.
|
||||
*/
|
||||
getTimerCount(): number;
|
||||
/**
|
||||
* Returns `true` if test environment has been torn down.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* if (jest.isEnvironmentTornDown()) {
|
||||
* // The Jest environment has been torn down, so stop doing work
|
||||
* return;
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
isEnvironmentTornDown(): boolean;
|
||||
/**
|
||||
* Determines if the given function is a mocked function.
|
||||
*/
|
||||
isMockFunction: ModuleMocker['isMockFunction'];
|
||||
/**
|
||||
* `jest.isolateModules()` goes a step further than `jest.resetModules()` and
|
||||
* creates a sandbox registry for the modules that are loaded inside the callback
|
||||
* function. This is useful to isolate specific modules for every test so that
|
||||
* local module state doesn't conflict between tests.
|
||||
*/
|
||||
isolateModules(fn: () => void): Jest;
|
||||
/**
|
||||
* `jest.isolateModulesAsync()` is the equivalent of `jest.isolateModules()`, but for
|
||||
* async functions to be wrapped. The caller is expected to `await` the completion of
|
||||
* `isolateModulesAsync`.
|
||||
*/
|
||||
isolateModulesAsync(fn: () => Promise<void>): Promise<void>;
|
||||
/**
|
||||
* Mocks a module with an auto-mocked version when it is being required.
|
||||
*/
|
||||
mock<T = unknown>(
|
||||
moduleName: string,
|
||||
moduleFactory?: () => T,
|
||||
options?: {
|
||||
virtual?: boolean;
|
||||
},
|
||||
): Jest;
|
||||
/**
|
||||
* Mocks a module with the provided module factory when it is being imported.
|
||||
*/
|
||||
unstable_mockModule<T = unknown>(
|
||||
moduleName: string,
|
||||
moduleFactory: () => T | Promise<T>,
|
||||
options?: {
|
||||
virtual?: boolean;
|
||||
},
|
||||
): Jest;
|
||||
/**
|
||||
* Wraps types of the `source` object and its deep members with type definitions
|
||||
* of Jest mock function. Pass `{shallow: true}` option to disable the deeply
|
||||
* mocked behavior.
|
||||
*/
|
||||
mocked: ModuleMocker['mocked'];
|
||||
/**
|
||||
* Returns the current time in ms of the fake timer clock.
|
||||
*/
|
||||
now(): number;
|
||||
/**
|
||||
* Registers a callback function that is invoked whenever a mock is generated for a module.
|
||||
* This callback is passed the module path and the newly created mock object, and must return
|
||||
* the (potentially modified) mock object.
|
||||
*
|
||||
* If multiple callbacks are registered, they will be called in the order they were added.
|
||||
* Each callback receives the result of the previous callback as the `moduleMock` parameter,
|
||||
* making it possible to apply sequential transformations.
|
||||
*/
|
||||
onGenerateMock<T>(cb: (modulePath: string, moduleMock: T) => T): Jest;
|
||||
/**
|
||||
* Replaces property on an object with another value.
|
||||
*
|
||||
* @remarks
|
||||
* For mocking functions or 'get' or 'set' accessors, use `jest.spyOn()` instead.
|
||||
*/
|
||||
replaceProperty: ModuleMocker['replaceProperty'];
|
||||
/**
|
||||
* Returns the actual module instead of a mock, bypassing all checks on
|
||||
* whether the module should receive a mock implementation or not.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* jest.mock('../myModule', () => {
|
||||
* // Require the original module to not be mocked...
|
||||
* const originalModule = jest.requireActual('../myModule');
|
||||
*
|
||||
* return {
|
||||
* __esModule: true, // Use it when dealing with esModules
|
||||
* ...originalModule,
|
||||
* getRandom: jest.fn().mockReturnValue(10),
|
||||
* };
|
||||
* });
|
||||
*
|
||||
* const getRandom = require('../myModule').getRandom;
|
||||
*
|
||||
* getRandom(); // Always returns 10
|
||||
* ```
|
||||
*/
|
||||
requireActual<T = unknown>(moduleName: string): T;
|
||||
/**
|
||||
* Returns a mock module instead of the actual module, bypassing all checks
|
||||
* on whether the module should be required normally or not.
|
||||
*/
|
||||
requireMock<T = unknown>(moduleName: string): T;
|
||||
/**
|
||||
* Resets the state of all mocks. Equivalent to calling `.mockReset()` on
|
||||
* every mocked function.
|
||||
*/
|
||||
resetAllMocks(): Jest;
|
||||
/**
|
||||
* Resets the module registry - the cache of all required modules. This is
|
||||
* useful to isolate modules where local state might conflict between tests.
|
||||
*/
|
||||
resetModules(): Jest;
|
||||
/**
|
||||
* Restores all mocks and replaced properties back to their original value.
|
||||
* Equivalent to calling `.mockRestore()` on every mocked function
|
||||
* and `.restore()` on every replaced property.
|
||||
*
|
||||
* Beware that `jest.restoreAllMocks()` only works when the mock was created
|
||||
* with `jest.spyOn()`; other mocks will require you to manually restore them.
|
||||
*/
|
||||
restoreAllMocks(): Jest;
|
||||
/**
|
||||
* Runs failed tests n-times until they pass or until the max number of
|
||||
* retries is exhausted.
|
||||
*
|
||||
* If `logErrorsBeforeRetry` is enabled, Jest will log the error(s) that caused
|
||||
* the test to fail to the console, providing visibility on why a retry occurred.
|
||||
* retries is exhausted.
|
||||
*
|
||||
* `waitBeforeRetry` is the number of milliseconds to wait before retrying
|
||||
*
|
||||
* `retryImmediately` is the flag to retry the failed test immediately after
|
||||
* failure
|
||||
*
|
||||
* @remarks
|
||||
* Only available with `jest-circus` runner.
|
||||
*/
|
||||
retryTimes(
|
||||
numRetries: number,
|
||||
options?: {
|
||||
logErrorsBeforeRetry?: boolean;
|
||||
retryImmediately?: boolean;
|
||||
waitBeforeRetry?: number;
|
||||
},
|
||||
): Jest;
|
||||
/**
|
||||
* Exhausts tasks queued by `setImmediate()`.
|
||||
*
|
||||
* @remarks
|
||||
* Only available when using legacy fake timers implementation.
|
||||
*/
|
||||
runAllImmediates(): void;
|
||||
/**
|
||||
* Exhausts the micro-task queue (usually interfaced in node via
|
||||
* `process.nextTick()`).
|
||||
*/
|
||||
runAllTicks(): void;
|
||||
/**
|
||||
* Exhausts the macro-task queue (i.e., all tasks queued by `setTimeout()`
|
||||
* and `setInterval()`).
|
||||
*/
|
||||
runAllTimers(): void;
|
||||
/**
|
||||
* Exhausts the macro-task queue (i.e., all tasks queued by `setTimeout()`
|
||||
* and `setInterval()`).
|
||||
*
|
||||
* @remarks
|
||||
* If new timers are added while it is executing they will be run as well.
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
runAllTimersAsync(): Promise<void>;
|
||||
/**
|
||||
* Executes only the macro-tasks that are currently pending (i.e., only the
|
||||
* tasks that have been queued by `setTimeout()` or `setInterval()` up to this
|
||||
* point). If any of the currently pending macro-tasks schedule new
|
||||
* macro-tasks, those new tasks will not be executed by this call.
|
||||
*/
|
||||
runOnlyPendingTimers(): void;
|
||||
/**
|
||||
* Executes only the macro-tasks that are currently pending (i.e., only the
|
||||
* tasks that have been queued by `setTimeout()` or `setInterval()` up to this
|
||||
* point). If any of the currently pending macro-tasks schedule new
|
||||
* macro-tasks, those new tasks will not be executed by this call.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
runOnlyPendingTimersAsync(): Promise<void>;
|
||||
/**
|
||||
* Explicitly supplies the mock object that the module system should return
|
||||
* for the specified module.
|
||||
*
|
||||
* @remarks
|
||||
* It is recommended to use `jest.mock()` instead. The `jest.mock()` API's second
|
||||
* argument is a module factory instead of the expected exported module object.
|
||||
*/
|
||||
setMock(moduleName: string, moduleExports: unknown): Jest;
|
||||
/**
|
||||
* Set the current system time used by fake timers. Simulates a user changing
|
||||
* the system clock while your program is running. It affects the current time,
|
||||
* but it does not in itself cause e.g. timers to fire; they will fire exactly
|
||||
* as they would have done without the call to `jest.setSystemTime()`.
|
||||
*
|
||||
* @remarks
|
||||
* Not available when using legacy fake timers implementation.
|
||||
*/
|
||||
setSystemTime(now?: number | Date): void;
|
||||
/**
|
||||
* Set the default timeout interval for tests and before/after hooks in
|
||||
* milliseconds.
|
||||
*
|
||||
* @remarks
|
||||
* The default timeout interval is 5 seconds if this method is not called.
|
||||
*/
|
||||
setTimeout(timeout: number): Jest;
|
||||
/**
|
||||
* Creates a mock function similar to `jest.fn()` but also tracks calls to
|
||||
* `object[methodName]`.
|
||||
*
|
||||
* Optional third argument of `accessType` can be either 'get' or 'set', which
|
||||
* proves to be useful when you want to spy on a getter or a setter, respectively.
|
||||
*
|
||||
* @remarks
|
||||
* By default, `jest.spyOn()` also calls the spied method. This is different
|
||||
* behavior from most other test libraries.
|
||||
*/
|
||||
spyOn: ModuleMocker['spyOn'];
|
||||
/**
|
||||
* Indicates that the module system should never return a mocked version of
|
||||
* the specified module from `require()` (e.g. that it should always return the
|
||||
* real module).
|
||||
*/
|
||||
unmock(moduleName: string): Jest;
|
||||
/**
|
||||
* Indicates that the module system should never return a mocked version of
|
||||
* the specified module when it is being imported (e.g. that it should always
|
||||
* return the real module).
|
||||
*/
|
||||
unstable_unmockModule(moduleName: string): Jest;
|
||||
/**
|
||||
* Instructs Jest to use fake versions of the global date, performance,
|
||||
* time and timer APIs. Fake timers implementation is backed by
|
||||
* [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers).
|
||||
*
|
||||
* @remarks
|
||||
* Calling `jest.useFakeTimers()` once again in the same test file would reinstall
|
||||
* fake timers using the provided options.
|
||||
*/
|
||||
useFakeTimers(
|
||||
fakeTimersConfig?: Config.FakeTimersConfig | Config.LegacyFakeTimersConfig,
|
||||
): Jest;
|
||||
/**
|
||||
* Instructs Jest to restore the original implementations of the global date,
|
||||
* performance, time and timer APIs.
|
||||
*/
|
||||
useRealTimers(): Jest;
|
||||
}
|
||||
|
||||
export declare class JestEnvironment<Timer = unknown> {
|
||||
constructor(config: JestEnvironmentConfig, context: EnvironmentContext);
|
||||
global: Global_2.Global;
|
||||
fakeTimers: LegacyFakeTimers<Timer> | null;
|
||||
fakeTimersModern: ModernFakeTimers | null;
|
||||
moduleMocker: ModuleMocker | null;
|
||||
getVmContext(): Context | null;
|
||||
setup(): Promise<void>;
|
||||
teardown(): Promise<void>;
|
||||
handleTestEvent?: Circus.EventHandler;
|
||||
exportConditions?: () => Array<string>;
|
||||
}
|
||||
|
||||
export declare interface JestEnvironmentConfig {
|
||||
projectConfig: Config.ProjectConfig;
|
||||
globalConfig: Config.GlobalConfig;
|
||||
}
|
||||
|
||||
export declare interface JestImportMeta extends ImportMeta {
|
||||
jest: Jest;
|
||||
}
|
||||
|
||||
export declare type Module = NodeModule;
|
||||
|
||||
export declare type ModuleWrapper = (
|
||||
this: Module['exports'],
|
||||
module: Module,
|
||||
exports: Module['exports'],
|
||||
require: Module['require'],
|
||||
__dirname: string,
|
||||
__filename: Module['filename'],
|
||||
jest?: Jest,
|
||||
...sandboxInjectedGlobals: Array<Global_2.Global[keyof Global_2.Global]>
|
||||
) => unknown;
|
||||
|
||||
export {};
|
||||
15
frontend/node_modules/@jest/environment/build/index.js
generated
vendored
Normal file
15
frontend/node_modules/@jest/environment/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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_exports__ = {};
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
0
frontend/node_modules/@jest/environment/build/index.mjs
generated
vendored
Normal file
0
frontend/node_modules/@jest/environment/build/index.mjs
generated
vendored
Normal file
32
frontend/node_modules/@jest/environment/package.json
generated
vendored
Normal file
32
frontend/node_modules/@jest/environment/package.json
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "@jest/environment",
|
||||
"version": "30.0.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-environment"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "./build/index.js",
|
||||
"types": "./build/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./build/index.d.ts",
|
||||
"default": "./build/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/fake-timers": "30.0.4",
|
||||
"@jest/types": "30.0.1",
|
||||
"@types/node": "*",
|
||||
"jest-mock": "30.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "f4296d2bc85c1405f84ddf613a25d0bc3766b7e5"
|
||||
}
|
||||
22
frontend/node_modules/@jest/expect-utils/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/expect-utils/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.
|
||||
5
frontend/node_modules/@jest/expect-utils/README.md
generated
vendored
Normal file
5
frontend/node_modules/@jest/expect-utils/README.md
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# `@jest/expect-utils`
|
||||
|
||||
This module exports some utils for the `expect` function used in [Jest](https://jestjs.io/).
|
||||
|
||||
You probably don't want to use this package directly. E.g. if you're writing [custom matcher](https://jestjs.io/docs/expect#expectextendmatchers), you should use the injected [`this.equals`](https://jestjs.io/docs/expect#thisequalsa-b).
|
||||
35
frontend/node_modules/@jest/expect-utils/build/index.d.mts
generated
vendored
Normal file
35
frontend/node_modules/@jest/expect-utils/build/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
//#region src/types.d.ts
|
||||
|
||||
type Tester = (this: TesterContext, a: any, b: any, customTesters: Array<Tester>) => boolean | undefined;
|
||||
interface TesterContext {
|
||||
equals: EqualsFunction;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/jasmineUtils.d.ts
|
||||
type EqualsFunction = (a: unknown, b: unknown, customTesters?: Array<Tester>, strictCheck?: boolean) => boolean;
|
||||
declare const equals: EqualsFunction;
|
||||
declare function isA<T>(typeName: string, value: unknown): value is T;
|
||||
//#endregion
|
||||
//#region src/utils.d.ts
|
||||
type GetPath = {
|
||||
hasEndProp?: boolean;
|
||||
endPropIsDefined?: boolean;
|
||||
lastTraversedObject: unknown;
|
||||
traversedPath: Array<string>;
|
||||
value?: unknown;
|
||||
};
|
||||
declare const getObjectKeys: (object: object) => Array<string | symbol>;
|
||||
declare const getPath: (object: Record<string, any>, propertyPath: string | Array<string>) => GetPath;
|
||||
declare const getObjectSubset: (object: any, subset: any, customTesters?: Array<Tester>, seenReferences?: WeakMap<object, boolean>) => any;
|
||||
declare const iterableEquality: (a: any, b: any, customTesters?: Array<Tester>, aStack?: Array<any>, bStack?: Array<any>) => boolean | undefined;
|
||||
declare const subsetEquality: (object: unknown, subset: unknown, customTesters?: Array<Tester>) => boolean | undefined;
|
||||
declare const typeEquality: (a: any, b: any) => boolean | undefined;
|
||||
declare const arrayBufferEquality: (a: unknown, b: unknown) => boolean | undefined;
|
||||
declare const sparseArrayEquality: (a: unknown, b: unknown, customTesters?: Array<Tester>) => boolean | undefined;
|
||||
declare const partition: <T>(items: Array<T>, predicate: (arg: T) => boolean) => [Array<T>, Array<T>];
|
||||
declare const pathAsArray: (propertyPath: string) => Array<any>;
|
||||
declare const isError: (value: unknown) => value is Error;
|
||||
declare function emptyObject(obj: unknown): boolean;
|
||||
declare const isOneline: (expected: unknown, received: unknown) => boolean;
|
||||
//#endregion
|
||||
export { EqualsFunction, Tester, TesterContext, arrayBufferEquality, emptyObject, equals, getObjectKeys, getObjectSubset, getPath, isA, isError, isOneline, iterableEquality, partition, pathAsArray, sparseArrayEquality, subsetEquality, typeEquality };
|
||||
95
frontend/node_modules/@jest/expect-utils/build/index.d.ts
generated
vendored
Normal file
95
frontend/node_modules/@jest/expect-utils/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export declare const arrayBufferEquality: (
|
||||
a: unknown,
|
||||
b: unknown,
|
||||
) => boolean | undefined;
|
||||
|
||||
export declare function emptyObject(obj: unknown): boolean;
|
||||
|
||||
export declare const equals: EqualsFunction;
|
||||
|
||||
export declare type EqualsFunction = (
|
||||
a: unknown,
|
||||
b: unknown,
|
||||
customTesters?: Array<Tester>,
|
||||
strictCheck?: boolean,
|
||||
) => boolean;
|
||||
|
||||
export declare const getObjectKeys: (object: object) => Array<string | symbol>;
|
||||
|
||||
export declare const getObjectSubset: (
|
||||
object: any,
|
||||
subset: any,
|
||||
customTesters?: Array<Tester>,
|
||||
seenReferences?: WeakMap<object, boolean>,
|
||||
) => any;
|
||||
|
||||
declare type GetPath = {
|
||||
hasEndProp?: boolean;
|
||||
endPropIsDefined?: boolean;
|
||||
lastTraversedObject: unknown;
|
||||
traversedPath: Array<string>;
|
||||
value?: unknown;
|
||||
};
|
||||
|
||||
export declare const getPath: (
|
||||
object: Record<string, any>,
|
||||
propertyPath: string | Array<string>,
|
||||
) => GetPath;
|
||||
|
||||
export declare function isA<T>(typeName: string, value: unknown): value is T;
|
||||
|
||||
export declare const isError: (value: unknown) => value is Error;
|
||||
|
||||
export declare const isOneline: (
|
||||
expected: unknown,
|
||||
received: unknown,
|
||||
) => boolean;
|
||||
|
||||
export declare const iterableEquality: (
|
||||
a: any,
|
||||
b: any,
|
||||
customTesters?: Array<Tester>,
|
||||
aStack?: Array<any>,
|
||||
bStack?: Array<any>,
|
||||
) => boolean | undefined;
|
||||
|
||||
export declare const partition: <T>(
|
||||
items: Array<T>,
|
||||
predicate: (arg: T) => boolean,
|
||||
) => [Array<T>, Array<T>];
|
||||
|
||||
export declare const pathAsArray: (propertyPath: string) => Array<any>;
|
||||
|
||||
export declare const sparseArrayEquality: (
|
||||
a: unknown,
|
||||
b: unknown,
|
||||
customTesters?: Array<Tester>,
|
||||
) => boolean | undefined;
|
||||
|
||||
export declare const subsetEquality: (
|
||||
object: unknown,
|
||||
subset: unknown,
|
||||
customTesters?: Array<Tester>,
|
||||
) => boolean | undefined;
|
||||
|
||||
export declare type Tester = (
|
||||
this: TesterContext,
|
||||
a: any,
|
||||
b: any,
|
||||
customTesters: Array<Tester>,
|
||||
) => boolean | undefined;
|
||||
|
||||
export declare interface TesterContext {
|
||||
equals: EqualsFunction;
|
||||
}
|
||||
|
||||
export declare const typeEquality: (a: any, b: any) => boolean | undefined;
|
||||
|
||||
export {};
|
||||
707
frontend/node_modules/@jest/expect-utils/build/index.js
generated
vendored
Normal file
707
frontend/node_modules/@jest/expect-utils/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,707 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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/immutableUtils.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.isImmutableList = isImmutableList;
|
||||
exports.isImmutableOrderedKeyed = isImmutableOrderedKeyed;
|
||||
exports.isImmutableOrderedSet = isImmutableOrderedSet;
|
||||
exports.isImmutableRecord = isImmutableRecord;
|
||||
exports.isImmutableUnorderedKeyed = isImmutableUnorderedKeyed;
|
||||
exports.isImmutableUnorderedSet = isImmutableUnorderedSet;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
// SENTINEL constants are from https://github.com/immutable-js/immutable-js/tree/main/src/predicates
|
||||
const IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
|
||||
const IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
|
||||
const IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
|
||||
const IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
|
||||
const IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@';
|
||||
function isObjectLiteral(source) {
|
||||
return source != null && typeof source === 'object' && !Array.isArray(source);
|
||||
}
|
||||
function isImmutableUnorderedKeyed(source) {
|
||||
return Boolean(source && isObjectLiteral(source) && source[IS_KEYED_SENTINEL] && !source[IS_ORDERED_SENTINEL]);
|
||||
}
|
||||
function isImmutableUnorderedSet(source) {
|
||||
return Boolean(source && isObjectLiteral(source) && source[IS_SET_SENTINEL] && !source[IS_ORDERED_SENTINEL]);
|
||||
}
|
||||
function isImmutableList(source) {
|
||||
return Boolean(source && isObjectLiteral(source) && source[IS_LIST_SENTINEL]);
|
||||
}
|
||||
function isImmutableOrderedKeyed(source) {
|
||||
return Boolean(source && isObjectLiteral(source) && source[IS_KEYED_SENTINEL] && source[IS_ORDERED_SENTINEL]);
|
||||
}
|
||||
function isImmutableOrderedSet(source) {
|
||||
return Boolean(source && isObjectLiteral(source) && source[IS_SET_SENTINEL] && source[IS_ORDERED_SENTINEL]);
|
||||
}
|
||||
function isImmutableRecord(source) {
|
||||
return Boolean(source && isObjectLiteral(source) && source[IS_RECORD_SYMBOL]);
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/index.ts":
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
var _exportNames = {
|
||||
equals: true,
|
||||
isA: true
|
||||
};
|
||||
Object.defineProperty(exports, "equals", ({
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _jasmineUtils.equals;
|
||||
}
|
||||
}));
|
||||
Object.defineProperty(exports, "isA", ({
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _jasmineUtils.isA;
|
||||
}
|
||||
}));
|
||||
var _jasmineUtils = __webpack_require__("./src/jasmineUtils.ts");
|
||||
var _utils = __webpack_require__("./src/utils.ts");
|
||||
Object.keys(_utils).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _utils[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _utils[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/jasmineUtils.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.equals = void 0;
|
||||
exports.isA = isA;
|
||||
/*
|
||||
Copyright (c) 2008-2016 Pivotal Labs
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
// Extracted out of jasmine 2.5.2
|
||||
const equals = (a, b, customTesters, strictCheck) => {
|
||||
customTesters = customTesters || [];
|
||||
return eq(a, b, [], [], customTesters, strictCheck);
|
||||
};
|
||||
exports.equals = equals;
|
||||
function isAsymmetric(obj) {
|
||||
return !!obj && isA('Function', obj.asymmetricMatch);
|
||||
}
|
||||
function asymmetricMatch(a, b) {
|
||||
const asymmetricA = isAsymmetric(a);
|
||||
const asymmetricB = isAsymmetric(b);
|
||||
if (asymmetricA && asymmetricB) {
|
||||
return undefined;
|
||||
}
|
||||
if (asymmetricA) {
|
||||
return a.asymmetricMatch(b);
|
||||
}
|
||||
if (asymmetricB) {
|
||||
return b.asymmetricMatch(a);
|
||||
}
|
||||
}
|
||||
|
||||
// Equality function lovingly adapted from isEqual in
|
||||
// [Underscore](http://underscorejs.org)
|
||||
function eq(a, b, aStack, bStack, customTesters, strictCheck) {
|
||||
let result = true;
|
||||
const asymmetricResult = asymmetricMatch(a, b);
|
||||
if (asymmetricResult !== undefined) {
|
||||
return asymmetricResult;
|
||||
}
|
||||
const testerContext = {
|
||||
equals
|
||||
};
|
||||
for (const item of customTesters) {
|
||||
const customTesterResult = item.call(testerContext, a, b, customTesters);
|
||||
if (customTesterResult !== undefined) {
|
||||
return customTesterResult;
|
||||
}
|
||||
}
|
||||
if (a instanceof Error && b instanceof Error) {
|
||||
return a.message === b.message;
|
||||
}
|
||||
if (Object.is(a, b)) {
|
||||
return true;
|
||||
}
|
||||
// A strict comparison is necessary because `null == undefined`.
|
||||
if (a === null || b === null) {
|
||||
return false;
|
||||
}
|
||||
const className = Object.prototype.toString.call(a);
|
||||
if (className !== Object.prototype.toString.call(b)) {
|
||||
return false;
|
||||
}
|
||||
switch (className) {
|
||||
case '[object Boolean]':
|
||||
case '[object String]':
|
||||
case '[object Number]':
|
||||
if (typeof a !== typeof b) {
|
||||
// One is a primitive, one a `new Primitive()`
|
||||
return false;
|
||||
} else if (typeof a !== 'object' && typeof b !== 'object') {
|
||||
// both are proper primitives
|
||||
return false;
|
||||
} else {
|
||||
// both are `new Primitive()`s
|
||||
return Object.is(a.valueOf(), b.valueOf());
|
||||
}
|
||||
case '[object Date]':
|
||||
// Coerce dates to numeric primitive values. Dates are compared by their
|
||||
// millisecond representations. Note that invalid dates with millisecond representations
|
||||
// of `NaN` are not equivalent.
|
||||
return +a === +b;
|
||||
// RegExps are compared by their source patterns and flags.
|
||||
case '[object RegExp]':
|
||||
return a.source === b.source && a.flags === b.flags;
|
||||
// URLs are compared by their href property which contains the entire url string.
|
||||
case '[object URL]':
|
||||
return a.href === b.href;
|
||||
}
|
||||
if (typeof a !== 'object' || typeof b !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Use DOM3 method isEqualNode (IE>=9)
|
||||
if (isDomNode(a) && isDomNode(b)) {
|
||||
return a.isEqualNode(b);
|
||||
}
|
||||
|
||||
// Used to detect circular references.
|
||||
let length = aStack.length;
|
||||
while (length--) {
|
||||
// Linear search. Performance is inversely proportional to the number of
|
||||
// unique nested structures.
|
||||
// circular references at same depth are equal
|
||||
// circular reference is not equal to non-circular one
|
||||
if (aStack[length] === a) {
|
||||
return bStack[length] === b;
|
||||
} else if (bStack[length] === b) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Add the first object to the stack of traversed objects.
|
||||
aStack.push(a);
|
||||
bStack.push(b);
|
||||
// Recursively compare objects and arrays.
|
||||
// Compare array lengths to determine if a deep comparison is necessary.
|
||||
if (strictCheck && className === '[object Array]' && a.length !== b.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Deep compare objects.
|
||||
const aKeys = keys(a, hasKey);
|
||||
let key;
|
||||
const bKeys = keys(b, hasKey);
|
||||
// Add keys corresponding to asymmetric matchers if they miss in non strict check mode
|
||||
if (!strictCheck) {
|
||||
for (let index = 0; index !== bKeys.length; ++index) {
|
||||
key = bKeys[index];
|
||||
if ((isAsymmetric(b[key]) || b[key] === undefined) && !hasKey(a, key)) {
|
||||
aKeys.push(key);
|
||||
}
|
||||
}
|
||||
for (let index = 0; index !== aKeys.length; ++index) {
|
||||
key = aKeys[index];
|
||||
if ((isAsymmetric(a[key]) || a[key] === undefined) && !hasKey(b, key)) {
|
||||
bKeys.push(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that both objects contain the same number of properties before comparing deep equality.
|
||||
let size = aKeys.length;
|
||||
if (bKeys.length !== size) {
|
||||
return false;
|
||||
}
|
||||
while (size--) {
|
||||
key = aKeys[size];
|
||||
|
||||
// Deep compare each member
|
||||
if (strictCheck) result = hasKey(b, key) && eq(a[key], b[key], aStack, bStack, customTesters, strictCheck);else result = (hasKey(b, key) || isAsymmetric(a[key]) || a[key] === undefined) && eq(a[key], b[key], aStack, bStack, customTesters, strictCheck);
|
||||
if (!result) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Remove the first object from the stack of traversed objects.
|
||||
aStack.pop();
|
||||
bStack.pop();
|
||||
return result;
|
||||
}
|
||||
function keys(obj, hasKey) {
|
||||
const keys = [];
|
||||
for (const key in obj) {
|
||||
if (hasKey(obj, key)) {
|
||||
keys.push(key);
|
||||
}
|
||||
}
|
||||
return [...keys, ...Object.getOwnPropertySymbols(obj).filter(symbol => Object.getOwnPropertyDescriptor(obj, symbol).enumerable)];
|
||||
}
|
||||
function hasKey(obj, key) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
function isA(typeName, value) {
|
||||
return Object.prototype.toString.apply(value) === `[object ${typeName}]`;
|
||||
}
|
||||
function isDomNode(obj) {
|
||||
return obj !== null && typeof obj === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string' && typeof obj.isEqualNode === 'function';
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/utils.ts":
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.arrayBufferEquality = void 0;
|
||||
exports.emptyObject = emptyObject;
|
||||
exports.typeEquality = exports.subsetEquality = exports.sparseArrayEquality = exports.pathAsArray = exports.partition = exports.iterableEquality = exports.isOneline = exports.isError = exports.getPath = exports.getObjectSubset = exports.getObjectKeys = void 0;
|
||||
var _getType = require("@jest/get-type");
|
||||
var _immutableUtils = __webpack_require__("./src/immutableUtils.ts");
|
||||
var _jasmineUtils = __webpack_require__("./src/jasmineUtils.ts");
|
||||
var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Checks if `hasOwnProperty(object, key)` up the prototype chain, stopping at `Object.prototype`.
|
||||
*/
|
||||
const hasPropertyInObject = (object, key) => {
|
||||
const shouldTerminate = !object || typeof object !== 'object' || object === Object.prototype;
|
||||
if (shouldTerminate) {
|
||||
return false;
|
||||
}
|
||||
return Object.prototype.hasOwnProperty.call(object, key) || hasPropertyInObject(Object.getPrototypeOf(object), key);
|
||||
};
|
||||
|
||||
// Retrieves an object's keys for evaluation by getObjectSubset. This evaluates
|
||||
// the prototype chain for string keys but not for non-enumerable symbols.
|
||||
// (Otherwise, it could find values such as a Set or Map's Symbol.toStringTag,
|
||||
// with unexpected results.)
|
||||
const getObjectKeys = object => {
|
||||
return [...Object.keys(object), ...Object.getOwnPropertySymbols(object).filter(s => Object.getOwnPropertyDescriptor(object, s)?.enumerable)];
|
||||
};
|
||||
exports.getObjectKeys = getObjectKeys;
|
||||
const getPath = (object, propertyPath) => {
|
||||
if (!Array.isArray(propertyPath)) {
|
||||
propertyPath = pathAsArray(propertyPath);
|
||||
}
|
||||
if (propertyPath.length > 0) {
|
||||
const lastProp = propertyPath.length === 1;
|
||||
const prop = propertyPath[0];
|
||||
const newObject = object[prop];
|
||||
if (!lastProp && (newObject === null || newObject === undefined)) {
|
||||
// This is not the last prop in the chain. If we keep recursing it will
|
||||
// hit a `can't access property X of undefined | null`. At this point we
|
||||
// know that the chain has broken and we can return right away.
|
||||
return {
|
||||
hasEndProp: false,
|
||||
lastTraversedObject: object,
|
||||
traversedPath: []
|
||||
};
|
||||
}
|
||||
const result = getPath(newObject, propertyPath.slice(1));
|
||||
if (result.lastTraversedObject === null) {
|
||||
result.lastTraversedObject = object;
|
||||
}
|
||||
result.traversedPath.unshift(prop);
|
||||
if (lastProp) {
|
||||
// Does object have the property with an undefined value?
|
||||
// Although primitive values support bracket notation (above)
|
||||
// they would throw TypeError for in operator (below).
|
||||
result.endPropIsDefined = !(0, _getType.isPrimitive)(object) && prop in object;
|
||||
result.hasEndProp = newObject !== undefined || result.endPropIsDefined;
|
||||
if (!result.hasEndProp) {
|
||||
result.traversedPath.shift();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return {
|
||||
lastTraversedObject: null,
|
||||
traversedPath: [],
|
||||
value: object
|
||||
};
|
||||
};
|
||||
|
||||
// Strip properties from object that are not present in the subset. Useful for
|
||||
// printing the diff for toMatchObject() without adding unrelated noise.
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
exports.getPath = getPath;
|
||||
const getObjectSubset = (object, subset, customTesters = [], seenReferences = new WeakMap()) => {
|
||||
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
|
||||
if (Array.isArray(object)) {
|
||||
if (Array.isArray(subset) && subset.length === object.length) {
|
||||
// The map method returns correct subclass of subset.
|
||||
return subset.map((sub, i) => getObjectSubset(object[i], sub, customTesters));
|
||||
}
|
||||
} else if (object instanceof Date) {
|
||||
return object;
|
||||
} else if (isObject(object) && isObject(subset)) {
|
||||
if ((0, _jasmineUtils.equals)(object, subset, [...customTesters, iterableEquality, subsetEquality])) {
|
||||
// Avoid unnecessary copy which might return Object instead of subclass.
|
||||
return subset;
|
||||
}
|
||||
const trimmed = {};
|
||||
seenReferences.set(object, trimmed);
|
||||
for (const key of getObjectKeys(object).filter(key => hasPropertyInObject(subset, key))) {
|
||||
trimmed[key] = seenReferences.has(object[key]) ? seenReferences.get(object[key]) : getObjectSubset(object[key], subset[key], customTesters, seenReferences);
|
||||
}
|
||||
if (getObjectKeys(trimmed).length > 0) {
|
||||
return trimmed;
|
||||
}
|
||||
}
|
||||
return object;
|
||||
};
|
||||
exports.getObjectSubset = getObjectSubset;
|
||||
const IteratorSymbol = Symbol.iterator;
|
||||
const hasIterator = object => !!(object != null && object[IteratorSymbol]);
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
const iterableEquality = (a, b, customTesters = [], /* eslint-enable @typescript-eslint/explicit-module-boundary-types */
|
||||
aStack = [], bStack = []) => {
|
||||
if (typeof a !== 'object' || typeof b !== 'object' || Array.isArray(a) || Array.isArray(b) || ArrayBuffer.isView(a) || ArrayBuffer.isView(b) || !hasIterator(a) || !hasIterator(b)) {
|
||||
return undefined;
|
||||
}
|
||||
if (a.constructor !== b.constructor) {
|
||||
return false;
|
||||
}
|
||||
let length = aStack.length;
|
||||
while (length--) {
|
||||
// Linear search. Performance is inversely proportional to the number of
|
||||
// unique nested structures.
|
||||
// circular references at same depth are equal
|
||||
// circular reference is not equal to non-circular one
|
||||
if (aStack[length] === a) {
|
||||
return bStack[length] === b;
|
||||
}
|
||||
}
|
||||
aStack.push(a);
|
||||
bStack.push(b);
|
||||
const iterableEqualityWithStack = (a, b) => iterableEquality(a, b, [...filteredCustomTesters], [...aStack], [...bStack]);
|
||||
|
||||
// Replace any instance of iterableEquality with the new
|
||||
// iterableEqualityWithStack so we can do circular detection
|
||||
const filteredCustomTesters = [...customTesters.filter(t => t !== iterableEquality), iterableEqualityWithStack];
|
||||
if (a.size !== undefined) {
|
||||
if (a.size !== b.size) {
|
||||
return false;
|
||||
} else if ((0, _jasmineUtils.isA)('Set', a) || (0, _immutableUtils.isImmutableUnorderedSet)(a)) {
|
||||
let allFound = true;
|
||||
for (const aValue of a) {
|
||||
if (!b.has(aValue)) {
|
||||
let has = false;
|
||||
for (const bValue of b) {
|
||||
const isEqual = (0, _jasmineUtils.equals)(aValue, bValue, filteredCustomTesters);
|
||||
if (isEqual === true) {
|
||||
has = true;
|
||||
}
|
||||
}
|
||||
if (has === false) {
|
||||
allFound = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Remove the first value from the stack of traversed values.
|
||||
aStack.pop();
|
||||
bStack.pop();
|
||||
return allFound;
|
||||
} else if ((0, _jasmineUtils.isA)('Map', a) || (0, _immutableUtils.isImmutableUnorderedKeyed)(a)) {
|
||||
let allFound = true;
|
||||
for (const aEntry of a) {
|
||||
if (!b.has(aEntry[0]) || !(0, _jasmineUtils.equals)(aEntry[1], b.get(aEntry[0]), filteredCustomTesters)) {
|
||||
let has = false;
|
||||
for (const bEntry of b) {
|
||||
const matchedKey = (0, _jasmineUtils.equals)(aEntry[0], bEntry[0], filteredCustomTesters);
|
||||
let matchedValue = false;
|
||||
if (matchedKey === true) {
|
||||
matchedValue = (0, _jasmineUtils.equals)(aEntry[1], bEntry[1], filteredCustomTesters);
|
||||
}
|
||||
if (matchedValue === true) {
|
||||
has = true;
|
||||
}
|
||||
}
|
||||
if (has === false) {
|
||||
allFound = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Remove the first value from the stack of traversed values.
|
||||
aStack.pop();
|
||||
bStack.pop();
|
||||
return allFound;
|
||||
}
|
||||
}
|
||||
const bIterator = b[IteratorSymbol]();
|
||||
for (const aValue of a) {
|
||||
const nextB = bIterator.next();
|
||||
if (nextB.done || !(0, _jasmineUtils.equals)(aValue, nextB.value, filteredCustomTesters)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!bIterator.next().done) {
|
||||
return false;
|
||||
}
|
||||
if (!(0, _immutableUtils.isImmutableList)(a) && !(0, _immutableUtils.isImmutableOrderedKeyed)(a) && !(0, _immutableUtils.isImmutableOrderedSet)(a) && !(0, _immutableUtils.isImmutableRecord)(a)) {
|
||||
const aEntries = entries(a);
|
||||
const bEntries = entries(b);
|
||||
if (!(0, _jasmineUtils.equals)(aEntries, bEntries)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the first value from the stack of traversed values.
|
||||
aStack.pop();
|
||||
bStack.pop();
|
||||
return true;
|
||||
};
|
||||
exports.iterableEquality = iterableEquality;
|
||||
const entries = obj => {
|
||||
if (!isObject(obj)) return [];
|
||||
const symbolProperties = Object.getOwnPropertySymbols(obj).filter(key => key !== Symbol.iterator).map(key => [key, obj[key]]);
|
||||
return [...symbolProperties, ...Object.entries(obj)];
|
||||
};
|
||||
const isObject = a => a !== null && typeof a === 'object';
|
||||
const isObjectWithKeys = a => isObject(a) && !(a instanceof Error) && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof Set) && !(a instanceof Map);
|
||||
const subsetEquality = (object, subset, customTesters = []) => {
|
||||
const filteredCustomTesters = customTesters.filter(t => t !== subsetEquality);
|
||||
|
||||
// subsetEquality needs to keep track of the references
|
||||
// it has already visited to avoid infinite loops in case
|
||||
// there are circular references in the subset passed to it.
|
||||
const subsetEqualityWithContext = (seenReferences = new WeakMap()) => (object, subset) => {
|
||||
if (!isObjectWithKeys(subset)) {
|
||||
return undefined;
|
||||
}
|
||||
if (seenReferences.has(subset)) return undefined;
|
||||
seenReferences.set(subset, true);
|
||||
const matchResult = getObjectKeys(subset).every(key => {
|
||||
if (isObjectWithKeys(subset[key])) {
|
||||
if (seenReferences.has(subset[key])) {
|
||||
return (0, _jasmineUtils.equals)(object[key], subset[key], filteredCustomTesters);
|
||||
}
|
||||
}
|
||||
const result = object != null && hasPropertyInObject(object, key) && (0, _jasmineUtils.equals)(object[key], subset[key], [...filteredCustomTesters, subsetEqualityWithContext(seenReferences)]);
|
||||
// The main goal of using seenReference is to avoid circular node on tree.
|
||||
// It will only happen within a parent and its child, not a node and nodes next to it (same level)
|
||||
// We should keep the reference for a parent and its child only
|
||||
// Thus we should delete the reference immediately so that it doesn't interfere
|
||||
// other nodes within the same level on tree.
|
||||
seenReferences.delete(subset[key]);
|
||||
return result;
|
||||
});
|
||||
seenReferences.delete(subset);
|
||||
return matchResult;
|
||||
};
|
||||
return subsetEqualityWithContext()(object, subset);
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
exports.subsetEquality = subsetEquality;
|
||||
const typeEquality = (a, b) => {
|
||||
if (a == null || b == null || a.constructor === b.constructor ||
|
||||
// Since Jest globals are different from Node globals,
|
||||
// constructors are different even between arrays when comparing properties of mock objects.
|
||||
// Both of them should be able to compare correctly when they are array-to-array.
|
||||
// https://github.com/jestjs/jest/issues/2549
|
||||
Array.isArray(a) && Array.isArray(b)) {
|
||||
return undefined;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
exports.typeEquality = typeEquality;
|
||||
const arrayBufferEquality = (a, b) => {
|
||||
let dataViewA = a;
|
||||
let dataViewB = b;
|
||||
if (isArrayBuffer(a) && isArrayBuffer(b)) {
|
||||
dataViewA = new DataView(a);
|
||||
dataViewB = new DataView(b);
|
||||
} else if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
||||
dataViewA = new DataView(a.buffer, a.byteOffset, a.byteLength);
|
||||
dataViewB = new DataView(b.buffer, b.byteOffset, b.byteLength);
|
||||
}
|
||||
if (!(dataViewA instanceof DataView && dataViewB instanceof DataView)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Buffers are not equal when they do not have the same byte length
|
||||
if (dataViewA.byteLength !== dataViewB.byteLength) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if every byte value is equal to each other
|
||||
for (let i = 0; i < dataViewA.byteLength; i++) {
|
||||
if (dataViewA.getUint8(i) !== dataViewB.getUint8(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
exports.arrayBufferEquality = arrayBufferEquality;
|
||||
function isArrayBuffer(obj) {
|
||||
return Object.prototype.toString.call(obj) === '[object ArrayBuffer]';
|
||||
}
|
||||
const sparseArrayEquality = (a, b, customTesters = []) => {
|
||||
if (!Array.isArray(a) || !Array.isArray(b)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// A sparse array [, , 1] will have keys ["2"] whereas [undefined, undefined, 1] will have keys ["0", "1", "2"]
|
||||
const aKeys = Object.keys(a);
|
||||
const bKeys = Object.keys(b);
|
||||
return (0, _jasmineUtils.equals)(a, b, customTesters.filter(t => t !== sparseArrayEquality), true) && (0, _jasmineUtils.equals)(aKeys, bKeys);
|
||||
};
|
||||
exports.sparseArrayEquality = sparseArrayEquality;
|
||||
const partition = (items, predicate) => {
|
||||
const result = [[], []];
|
||||
for (const item of items) result[predicate(item) ? 0 : 1].push(item);
|
||||
return result;
|
||||
};
|
||||
exports.partition = partition;
|
||||
const pathAsArray = propertyPath => {
|
||||
const properties = [];
|
||||
if (propertyPath === '') {
|
||||
properties.push('');
|
||||
return properties;
|
||||
}
|
||||
|
||||
// will match everything that's not a dot or a bracket, and "" for consecutive dots.
|
||||
const pattern = new RegExp('[^.[\\]]+|(?=(?:\\.)(?:\\.|$))', 'g');
|
||||
|
||||
// Because the regex won't match a dot in the beginning of the path, if present.
|
||||
if (propertyPath[0] === '.') {
|
||||
properties.push('');
|
||||
}
|
||||
propertyPath.replaceAll(pattern, match => {
|
||||
properties.push(match);
|
||||
return match;
|
||||
});
|
||||
return properties;
|
||||
};
|
||||
|
||||
// Copied from https://github.com/graingert/angular.js/blob/a43574052e9775cbc1d7dd8a086752c979b0f020/src/Angular.js#L685-L693
|
||||
exports.pathAsArray = pathAsArray;
|
||||
const isError = value => {
|
||||
switch (Object.prototype.toString.call(value)) {
|
||||
case '[object Error]':
|
||||
case '[object Exception]':
|
||||
case '[object DOMException]':
|
||||
return true;
|
||||
default:
|
||||
return value instanceof Error;
|
||||
}
|
||||
};
|
||||
exports.isError = isError;
|
||||
function emptyObject(obj) {
|
||||
return obj && typeof obj === 'object' ? Object.keys(obj).length === 0 : false;
|
||||
}
|
||||
const MULTILINE_REGEXP = /[\n\r]/;
|
||||
const isOneline = (expected, received) => typeof expected === 'string' && typeof received === 'string' && (!MULTILINE_REGEXP.test(expected) || !MULTILINE_REGEXP.test(received));
|
||||
exports.isOneline = isOneline;
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // 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;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/
|
||||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||
/******/ var __webpack_exports__ = __webpack_require__("./src/index.ts");
|
||||
/******/ module.exports = __webpack_exports__;
|
||||
/******/
|
||||
/******/ })()
|
||||
;
|
||||
17
frontend/node_modules/@jest/expect-utils/build/index.mjs
generated
vendored
Normal file
17
frontend/node_modules/@jest/expect-utils/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const equals = cjsModule.equals;
|
||||
export const isA = cjsModule.isA;
|
||||
export const arrayBufferEquality = cjsModule.arrayBufferEquality;
|
||||
export const emptyObject = cjsModule.emptyObject;
|
||||
export const getObjectKeys = cjsModule.getObjectKeys;
|
||||
export const getObjectSubset = cjsModule.getObjectSubset;
|
||||
export const getPath = cjsModule.getPath;
|
||||
export const isError = cjsModule.isError;
|
||||
export const isOneline = cjsModule.isOneline;
|
||||
export const iterableEquality = cjsModule.iterableEquality;
|
||||
export const partition = cjsModule.partition;
|
||||
export const pathAsArray = cjsModule.pathAsArray;
|
||||
export const sparseArrayEquality = cjsModule.sparseArrayEquality;
|
||||
export const subsetEquality = cjsModule.subsetEquality;
|
||||
export const typeEquality = cjsModule.typeEquality;
|
||||
35
frontend/node_modules/@jest/expect-utils/package.json
generated
vendored
Normal file
35
frontend/node_modules/@jest/expect-utils/package.json
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@jest/expect-utils",
|
||||
"version": "30.0.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/expect-utils"
|
||||
},
|
||||
"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": {
|
||||
"@jest/get-type": "30.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"immutable": "^5.1.2",
|
||||
"jest-matcher-utils": "30.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "f4296d2bc85c1405f84ddf613a25d0bc3766b7e5"
|
||||
}
|
||||
22
frontend/node_modules/@jest/expect/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/expect/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.
|
||||
5
frontend/node_modules/@jest/expect/README.md
generated
vendored
Normal file
5
frontend/node_modules/@jest/expect/README.md
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# @jest/expect
|
||||
|
||||
This package extends `expect` library with `jest-snapshot` matchers. It exports `jestExpect` object, which can be used as standalone replacement of `expect`.
|
||||
|
||||
The `jestExpect` function used in [Jest](https://jestjs.io/). You can find its documentation [on Jest's website](https://jestjs.io/docs/expect).
|
||||
43
frontend/node_modules/@jest/expect/build/index.d.mts
generated
vendored
Normal file
43
frontend/node_modules/@jest/expect/build/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import { AsymmetricMatchers, AsymmetricMatchers as AsymmetricMatchers$1, BaseExpect, MatcherContext, MatcherFunction, MatcherFunctionWithContext, MatcherState, MatcherUtils, Matchers, Matchers as Matchers$1 } from "expect";
|
||||
import { SnapshotMatchers, SnapshotState, addSerializer } from "jest-snapshot";
|
||||
|
||||
//#region src/types.d.ts
|
||||
|
||||
type JestExpect = {
|
||||
<T = unknown>(actual: T): JestMatchers<void, T> & Inverse<JestMatchers<void, T>> & PromiseMatchers<T>;
|
||||
addSnapshotSerializer: typeof addSerializer;
|
||||
} & BaseExpect & AsymmetricMatchers$1 & Inverse<Omit<AsymmetricMatchers$1, 'any' | 'anything'>>;
|
||||
type Inverse<Matchers> = {
|
||||
/**
|
||||
* Inverse next matcher. If you know how to test something, `.not` lets you test its opposite.
|
||||
*/
|
||||
not: Matchers$1;
|
||||
};
|
||||
type JestMatchers<R extends void | Promise<void>, T> = Matchers$1<R, T> & SnapshotMatchers<R, T>;
|
||||
type PromiseMatchers<T = unknown> = {
|
||||
/**
|
||||
* Unwraps the reason of a rejected promise so any other matcher can be chained.
|
||||
* If the promise is fulfilled the assertion fails.
|
||||
*/
|
||||
rejects: JestMatchers<Promise<void>, T> & Inverse<JestMatchers<Promise<void>, T>>;
|
||||
/**
|
||||
* Unwraps the value of a fulfilled promise so any other matcher can be chained.
|
||||
* If the promise is rejected the assertion fails.
|
||||
*/
|
||||
resolves: JestMatchers<Promise<void>, T> & Inverse<JestMatchers<Promise<void>, T>>;
|
||||
};
|
||||
declare module 'expect' {
|
||||
interface MatcherState {
|
||||
snapshotState: SnapshotState;
|
||||
/** Whether the test was called with `test.failing()` */
|
||||
testFailing?: boolean;
|
||||
}
|
||||
interface BaseExpect {
|
||||
addSnapshotSerializer: typeof addSerializer;
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
//#region src/index.d.ts
|
||||
declare const jestExpect: JestExpect;
|
||||
//#endregion
|
||||
export { AsymmetricMatchers, JestExpect, MatcherContext, MatcherFunction, MatcherFunctionWithContext, MatcherState, MatcherUtils, Matchers, jestExpect };
|
||||
66
frontend/node_modules/@jest/expect/build/index.d.ts
generated
vendored
Normal file
66
frontend/node_modules/@jest/expect/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* 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 {
|
||||
AsymmetricMatchers,
|
||||
BaseExpect,
|
||||
Inverse,
|
||||
MatcherContext,
|
||||
MatcherFunction,
|
||||
MatcherFunctionWithContext,
|
||||
MatcherState,
|
||||
MatcherUtils,
|
||||
Matchers,
|
||||
} from 'expect';
|
||||
import {SnapshotMatchers, addSerializer} from 'jest-snapshot';
|
||||
|
||||
export {AsymmetricMatchers};
|
||||
|
||||
export declare type JestExpect = {
|
||||
<T = unknown>(
|
||||
actual: T,
|
||||
): JestMatchers<void, T> &
|
||||
Inverse<JestMatchers<void, T>> &
|
||||
PromiseMatchers<T>;
|
||||
addSnapshotSerializer: typeof addSerializer;
|
||||
} & BaseExpect &
|
||||
AsymmetricMatchers &
|
||||
Inverse<Omit<AsymmetricMatchers, 'any' | 'anything'>>;
|
||||
|
||||
export declare const jestExpect: JestExpect;
|
||||
|
||||
declare type JestMatchers<R extends void | Promise<void>, T> = Matchers<R, T> &
|
||||
SnapshotMatchers<R, T>;
|
||||
|
||||
export {MatcherContext};
|
||||
|
||||
export {MatcherFunction};
|
||||
|
||||
export {MatcherFunctionWithContext};
|
||||
|
||||
export {Matchers};
|
||||
|
||||
export {MatcherState};
|
||||
|
||||
export {MatcherUtils};
|
||||
|
||||
declare type PromiseMatchers<T = unknown> = {
|
||||
/**
|
||||
* Unwraps the reason of a rejected promise so any other matcher can be chained.
|
||||
* If the promise is fulfilled the assertion fails.
|
||||
*/
|
||||
rejects: JestMatchers<Promise<void>, T> &
|
||||
Inverse<JestMatchers<Promise<void>, T>>;
|
||||
/**
|
||||
* Unwraps the value of a fulfilled promise so any other matcher can be chained.
|
||||
* If the promise is rejected the assertion fails.
|
||||
*/
|
||||
resolves: JestMatchers<Promise<void>, T> &
|
||||
Inverse<JestMatchers<Promise<void>, T>>;
|
||||
};
|
||||
|
||||
export {};
|
||||
57
frontend/node_modules/@jest/expect/build/index.js
generated
vendored
Normal file
57
frontend/node_modules/@jest/expect/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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_exports__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
|
||||
(() => {
|
||||
var exports = __webpack_exports__;
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.jestExpect = void 0;
|
||||
function _expect() {
|
||||
const data = require("expect");
|
||||
_expect = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestSnapshot() {
|
||||
const data = require("jest-snapshot");
|
||||
_jestSnapshot = 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 createJestExpect() {
|
||||
_expect().expect.extend({
|
||||
toMatchInlineSnapshot: _jestSnapshot().toMatchInlineSnapshot,
|
||||
toMatchSnapshot: _jestSnapshot().toMatchSnapshot,
|
||||
toThrowErrorMatchingInlineSnapshot: _jestSnapshot().toThrowErrorMatchingInlineSnapshot,
|
||||
toThrowErrorMatchingSnapshot: _jestSnapshot().toThrowErrorMatchingSnapshot
|
||||
});
|
||||
_expect().expect.addSnapshotSerializer = _jestSnapshot().addSerializer;
|
||||
return _expect().expect;
|
||||
}
|
||||
const jestExpect = exports.jestExpect = createJestExpect();
|
||||
})();
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
3
frontend/node_modules/@jest/expect/build/index.mjs
generated
vendored
Normal file
3
frontend/node_modules/@jest/expect/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const jestExpect = cjsModule.jestExpect;
|
||||
32
frontend/node_modules/@jest/expect/package.json
generated
vendored
Normal file
32
frontend/node_modules/@jest/expect/package.json
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "@jest/expect",
|
||||
"version": "30.0.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-expect"
|
||||
},
|
||||
"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": {
|
||||
"expect": "30.0.4",
|
||||
"jest-snapshot": "30.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "f4296d2bc85c1405f84ddf613a25d0bc3766b7e5"
|
||||
}
|
||||
22
frontend/node_modules/@jest/fake-timers/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/fake-timers/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.
|
||||
107
frontend/node_modules/@jest/fake-timers/build/index.d.mts
generated
vendored
Normal file
107
frontend/node_modules/@jest/fake-timers/build/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
import { StackTraceConfig } from "jest-message-util";
|
||||
import { ModuleMocker } from "jest-mock";
|
||||
import { Config } from "@jest/types";
|
||||
|
||||
//#region src/legacyFakeTimers.d.ts
|
||||
|
||||
type Callback = (...args: Array<unknown>) => void;
|
||||
type TimerConfig<Ref> = {
|
||||
idToRef: (id: number) => Ref;
|
||||
refToId: (ref: Ref) => number | void;
|
||||
};
|
||||
declare class FakeTimers<TimerRef = unknown> {
|
||||
#private;
|
||||
private _cancelledTicks;
|
||||
private readonly _config;
|
||||
private _disposed;
|
||||
private _fakeTimerAPIs;
|
||||
private _fakingTime;
|
||||
private readonly _global;
|
||||
private _immediates;
|
||||
private readonly _maxLoops;
|
||||
private readonly _moduleMocker;
|
||||
private _now;
|
||||
private _ticks;
|
||||
private readonly _timerAPIs;
|
||||
private _timers;
|
||||
private _uuidCounter;
|
||||
private readonly _timerConfig;
|
||||
constructor({
|
||||
global,
|
||||
moduleMocker,
|
||||
timerConfig,
|
||||
config,
|
||||
maxLoops
|
||||
}: {
|
||||
global: typeof globalThis;
|
||||
moduleMocker: ModuleMocker;
|
||||
timerConfig: TimerConfig<TimerRef>;
|
||||
config: StackTraceConfig;
|
||||
maxLoops?: number;
|
||||
});
|
||||
clearAllTimers(): void;
|
||||
dispose(): void;
|
||||
reset(): void;
|
||||
now(): number;
|
||||
runAllTicks(): void;
|
||||
runAllImmediates(): void;
|
||||
private _runImmediate;
|
||||
runAllTimers(): void;
|
||||
runOnlyPendingTimers(): void;
|
||||
advanceTimersToNextTimer(steps?: number): void;
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
runWithRealTimers(cb: Callback): void;
|
||||
useRealTimers(): void;
|
||||
useFakeTimers(): void;
|
||||
getTimerCount(): number;
|
||||
private _checkFakeTimers;
|
||||
private _createMocks;
|
||||
private _fakeClearTimer;
|
||||
private _fakeClearImmediate;
|
||||
private _fakeNextTick;
|
||||
private _fakeRequestAnimationFrame;
|
||||
private _fakeSetImmediate;
|
||||
private _fakeSetInterval;
|
||||
private _fakeSetTimeout;
|
||||
private _getNextTimerHandleAndExpiry;
|
||||
private _runTimerHandle;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/modernFakeTimers.d.ts
|
||||
declare class FakeTimers$1 {
|
||||
private _clock;
|
||||
private readonly _config;
|
||||
private _fakingTime;
|
||||
private readonly _global;
|
||||
private readonly _fakeTimers;
|
||||
constructor({
|
||||
global,
|
||||
config
|
||||
}: {
|
||||
global: typeof globalThis;
|
||||
config: Config.ProjectConfig;
|
||||
});
|
||||
clearAllTimers(): void;
|
||||
dispose(): void;
|
||||
runAllTimers(): void;
|
||||
runAllTimersAsync(): Promise<void>;
|
||||
runOnlyPendingTimers(): void;
|
||||
runOnlyPendingTimersAsync(): Promise<void>;
|
||||
advanceTimersToNextTimer(steps?: number): void;
|
||||
advanceTimersToNextTimerAsync(steps?: number): Promise<void>;
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
advanceTimersByTimeAsync(msToRun: number): Promise<void>;
|
||||
advanceTimersToNextFrame(): void;
|
||||
runAllTicks(): void;
|
||||
useRealTimers(): void;
|
||||
useFakeTimers(fakeTimersConfig?: Config.FakeTimersConfig): void;
|
||||
reset(): void;
|
||||
setSystemTime(now?: number | Date): void;
|
||||
getRealSystemTime(): number;
|
||||
now(): number;
|
||||
getTimerCount(): number;
|
||||
private _checkFakeTimers;
|
||||
private _toSinonFakeTimersConfig;
|
||||
}
|
||||
//#endregion
|
||||
export { FakeTimers as LegacyFakeTimers, FakeTimers$1 as ModernFakeTimers };
|
||||
113
frontend/node_modules/@jest/fake-timers/build/index.d.ts
generated
vendored
Normal file
113
frontend/node_modules/@jest/fake-timers/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* 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 {Config} from '@jest/types';
|
||||
import {StackTraceConfig} from 'jest-message-util';
|
||||
import {ModuleMocker} from 'jest-mock';
|
||||
|
||||
declare type Callback = (...args: Array<unknown>) => void;
|
||||
|
||||
export declare class LegacyFakeTimers<TimerRef = unknown> {
|
||||
#private;
|
||||
private _cancelledTicks;
|
||||
private readonly _config;
|
||||
private _disposed;
|
||||
private _fakeTimerAPIs;
|
||||
private _fakingTime;
|
||||
private readonly _global;
|
||||
private _immediates;
|
||||
private readonly _maxLoops;
|
||||
private readonly _moduleMocker;
|
||||
private _now;
|
||||
private _ticks;
|
||||
private readonly _timerAPIs;
|
||||
private _timers;
|
||||
private _uuidCounter;
|
||||
private readonly _timerConfig;
|
||||
constructor({
|
||||
global,
|
||||
moduleMocker,
|
||||
timerConfig,
|
||||
config,
|
||||
maxLoops,
|
||||
}: {
|
||||
global: typeof globalThis;
|
||||
moduleMocker: ModuleMocker;
|
||||
timerConfig: TimerConfig<TimerRef>;
|
||||
config: StackTraceConfig;
|
||||
maxLoops?: number;
|
||||
});
|
||||
clearAllTimers(): void;
|
||||
dispose(): void;
|
||||
reset(): void;
|
||||
now(): number;
|
||||
runAllTicks(): void;
|
||||
runAllImmediates(): void;
|
||||
private _runImmediate;
|
||||
runAllTimers(): void;
|
||||
runOnlyPendingTimers(): void;
|
||||
advanceTimersToNextTimer(steps?: number): void;
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
runWithRealTimers(cb: Callback): void;
|
||||
useRealTimers(): void;
|
||||
useFakeTimers(): void;
|
||||
getTimerCount(): number;
|
||||
private _checkFakeTimers;
|
||||
private _createMocks;
|
||||
private _fakeClearTimer;
|
||||
private _fakeClearImmediate;
|
||||
private _fakeNextTick;
|
||||
private _fakeRequestAnimationFrame;
|
||||
private _fakeSetImmediate;
|
||||
private _fakeSetInterval;
|
||||
private _fakeSetTimeout;
|
||||
private _getNextTimerHandleAndExpiry;
|
||||
private _runTimerHandle;
|
||||
}
|
||||
|
||||
export declare class ModernFakeTimers {
|
||||
private _clock;
|
||||
private readonly _config;
|
||||
private _fakingTime;
|
||||
private readonly _global;
|
||||
private readonly _fakeTimers;
|
||||
constructor({
|
||||
global,
|
||||
config,
|
||||
}: {
|
||||
global: typeof globalThis;
|
||||
config: Config.ProjectConfig;
|
||||
});
|
||||
clearAllTimers(): void;
|
||||
dispose(): void;
|
||||
runAllTimers(): void;
|
||||
runAllTimersAsync(): Promise<void>;
|
||||
runOnlyPendingTimers(): void;
|
||||
runOnlyPendingTimersAsync(): Promise<void>;
|
||||
advanceTimersToNextTimer(steps?: number): void;
|
||||
advanceTimersToNextTimerAsync(steps?: number): Promise<void>;
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
advanceTimersByTimeAsync(msToRun: number): Promise<void>;
|
||||
advanceTimersToNextFrame(): void;
|
||||
runAllTicks(): void;
|
||||
useRealTimers(): void;
|
||||
useFakeTimers(fakeTimersConfig?: Config.FakeTimersConfig): void;
|
||||
reset(): void;
|
||||
setSystemTime(now?: number | Date): void;
|
||||
getRealSystemTime(): number;
|
||||
now(): number;
|
||||
getTimerCount(): number;
|
||||
private _checkFakeTimers;
|
||||
private _toSinonFakeTimersConfig;
|
||||
}
|
||||
|
||||
declare type TimerConfig<Ref> = {
|
||||
idToRef: (id: number) => Ref;
|
||||
refToId: (ref: Ref) => number | void;
|
||||
};
|
||||
|
||||
export {};
|
||||
726
frontend/node_modules/@jest/fake-timers/build/index.js
generated
vendored
Normal file
726
frontend/node_modules/@jest/fake-timers/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,726 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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/legacyFakeTimers.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = void 0;
|
||||
function _util() {
|
||||
const data = require("util");
|
||||
_util = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestMessageUtil() {
|
||||
const data = require("jest-message-util");
|
||||
_jestMessageUtil = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestUtil() {
|
||||
const data = require("jest-util");
|
||||
_jestUtil = 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.
|
||||
*/
|
||||
|
||||
/* eslint-disable local/prefer-spread-eventually */
|
||||
|
||||
const MS_IN_A_YEAR = 31_536_000_000;
|
||||
class FakeTimers {
|
||||
_cancelledTicks;
|
||||
_config;
|
||||
_disposed;
|
||||
_fakeTimerAPIs;
|
||||
_fakingTime = false;
|
||||
_global;
|
||||
_immediates;
|
||||
_maxLoops;
|
||||
_moduleMocker;
|
||||
_now;
|
||||
_ticks;
|
||||
_timerAPIs;
|
||||
_timers;
|
||||
_uuidCounter;
|
||||
_timerConfig;
|
||||
constructor({
|
||||
global,
|
||||
moduleMocker,
|
||||
timerConfig,
|
||||
config,
|
||||
maxLoops
|
||||
}) {
|
||||
this._global = global;
|
||||
this._timerConfig = timerConfig;
|
||||
this._config = config;
|
||||
this._maxLoops = maxLoops || 100_000;
|
||||
this._uuidCounter = 1;
|
||||
this._moduleMocker = moduleMocker;
|
||||
|
||||
// Store original timer APIs for future reference
|
||||
this._timerAPIs = {
|
||||
cancelAnimationFrame: global.cancelAnimationFrame,
|
||||
clearImmediate: global.clearImmediate,
|
||||
clearInterval: global.clearInterval,
|
||||
clearTimeout: global.clearTimeout,
|
||||
nextTick: global.process && global.process.nextTick,
|
||||
requestAnimationFrame: global.requestAnimationFrame,
|
||||
setImmediate: global.setImmediate,
|
||||
setInterval: global.setInterval,
|
||||
setTimeout: global.setTimeout
|
||||
};
|
||||
this._disposed = false;
|
||||
this.reset();
|
||||
}
|
||||
clearAllTimers() {
|
||||
this._immediates = [];
|
||||
this._timers.clear();
|
||||
}
|
||||
dispose() {
|
||||
this._disposed = true;
|
||||
this.clearAllTimers();
|
||||
}
|
||||
reset() {
|
||||
this._cancelledTicks = {};
|
||||
this._now = 0;
|
||||
this._ticks = [];
|
||||
this._immediates = [];
|
||||
this._timers = new Map();
|
||||
}
|
||||
now() {
|
||||
if (this._fakingTime) {
|
||||
return this._now;
|
||||
}
|
||||
return Date.now();
|
||||
}
|
||||
runAllTicks() {
|
||||
this._checkFakeTimers();
|
||||
// Only run a generous number of ticks and then bail.
|
||||
// This is just to help avoid recursive loops
|
||||
let i;
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const tick = this._ticks.shift();
|
||||
if (tick === undefined) {
|
||||
break;
|
||||
}
|
||||
if (!Object.prototype.hasOwnProperty.call(this._cancelledTicks, tick.uuid)) {
|
||||
// Callback may throw, so update the map prior calling.
|
||||
this._cancelledTicks[tick.uuid] = true;
|
||||
tick.callback();
|
||||
}
|
||||
}
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(`Ran ${this._maxLoops} ticks, and there are still more! ` + "Assuming we've hit an infinite recursion and bailing out...");
|
||||
}
|
||||
}
|
||||
runAllImmediates() {
|
||||
this._checkFakeTimers();
|
||||
// Only run a generous number of immediates and then bail.
|
||||
let i;
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const immediate = this._immediates.shift();
|
||||
if (immediate === undefined) {
|
||||
break;
|
||||
}
|
||||
this._runImmediate(immediate);
|
||||
}
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(`Ran ${this._maxLoops} immediates, and there are still more! Assuming ` + "we've hit an infinite recursion and bailing out...");
|
||||
}
|
||||
}
|
||||
_runImmediate(immediate) {
|
||||
try {
|
||||
immediate.callback();
|
||||
} finally {
|
||||
this._fakeClearImmediate(immediate.uuid);
|
||||
}
|
||||
}
|
||||
runAllTimers() {
|
||||
this._checkFakeTimers();
|
||||
this.runAllTicks();
|
||||
this.runAllImmediates();
|
||||
|
||||
// Only run a generous number of timers and then bail.
|
||||
// This is just to help avoid recursive loops
|
||||
let i;
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const nextTimerHandleAndExpiry = this._getNextTimerHandleAndExpiry();
|
||||
|
||||
// If there are no more timer handles, stop!
|
||||
if (nextTimerHandleAndExpiry === null) {
|
||||
break;
|
||||
}
|
||||
const [nextTimerHandle, expiry] = nextTimerHandleAndExpiry;
|
||||
this._now = expiry;
|
||||
this._runTimerHandle(nextTimerHandle);
|
||||
|
||||
// Some of the immediate calls could be enqueued
|
||||
// during the previous handling of the timers, we should
|
||||
// run them as well.
|
||||
if (this._immediates.length > 0) {
|
||||
this.runAllImmediates();
|
||||
}
|
||||
if (this._ticks.length > 0) {
|
||||
this.runAllTicks();
|
||||
}
|
||||
}
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(`Ran ${this._maxLoops} timers, and there are still more! ` + "Assuming we've hit an infinite recursion and bailing out...");
|
||||
}
|
||||
}
|
||||
runOnlyPendingTimers() {
|
||||
// We need to hold the current shape of `this._timers` because existing
|
||||
// timers can add new ones to the map and hence would run more than necessary.
|
||||
// See https://github.com/jestjs/jest/pull/4608 for details
|
||||
const timerEntries = [...this._timers.entries()];
|
||||
this._checkFakeTimers();
|
||||
for (const _immediate of this._immediates) this._runImmediate(_immediate);
|
||||
for (const [timerHandle, timer] of timerEntries.sort(([, left], [, right]) => left.expiry - right.expiry)) {
|
||||
this._now = timer.expiry;
|
||||
this._runTimerHandle(timerHandle);
|
||||
}
|
||||
}
|
||||
advanceTimersToNextTimer(steps = 1) {
|
||||
if (steps < 1) {
|
||||
return;
|
||||
}
|
||||
const nextExpiry = [...this._timers.values()].reduce((minExpiry, timer) => {
|
||||
if (minExpiry === null || timer.expiry < minExpiry) return timer.expiry;
|
||||
return minExpiry;
|
||||
}, null);
|
||||
if (nextExpiry !== null) {
|
||||
this.advanceTimersByTime(nextExpiry - this._now);
|
||||
this.advanceTimersToNextTimer(steps - 1);
|
||||
}
|
||||
}
|
||||
advanceTimersByTime(msToRun) {
|
||||
this._checkFakeTimers();
|
||||
// Only run a generous number of timers and then bail.
|
||||
// This is just to help avoid recursive loops
|
||||
let i;
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const timerHandleAndExpiry = this._getNextTimerHandleAndExpiry();
|
||||
|
||||
// If there are no more timer handles, stop!
|
||||
if (timerHandleAndExpiry === null) {
|
||||
break;
|
||||
}
|
||||
const [timerHandle, nextTimerExpiry] = timerHandleAndExpiry;
|
||||
if (this._now + msToRun < nextTimerExpiry) {
|
||||
// There are no timers between now and the target we're running to
|
||||
break;
|
||||
} else {
|
||||
msToRun -= nextTimerExpiry - this._now;
|
||||
this._now = nextTimerExpiry;
|
||||
this._runTimerHandle(timerHandle);
|
||||
}
|
||||
}
|
||||
|
||||
// Advance the clock by whatever time we still have left to run
|
||||
this._now += msToRun;
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(`Ran ${this._maxLoops} timers, and there are still more! ` + "Assuming we've hit an infinite recursion and bailing out...");
|
||||
}
|
||||
}
|
||||
runWithRealTimers(cb) {
|
||||
const prevClearImmediate = this._global.clearImmediate;
|
||||
const prevClearInterval = this._global.clearInterval;
|
||||
const prevClearTimeout = this._global.clearTimeout;
|
||||
const prevNextTick = this._global.process.nextTick;
|
||||
const prevSetImmediate = this._global.setImmediate;
|
||||
const prevSetInterval = this._global.setInterval;
|
||||
const prevSetTimeout = this._global.setTimeout;
|
||||
this.useRealTimers();
|
||||
let cbErr = null;
|
||||
let errThrown = false;
|
||||
try {
|
||||
cb();
|
||||
} catch (error) {
|
||||
errThrown = true;
|
||||
cbErr = error;
|
||||
}
|
||||
this._global.clearImmediate = prevClearImmediate;
|
||||
this._global.clearInterval = prevClearInterval;
|
||||
this._global.clearTimeout = prevClearTimeout;
|
||||
this._global.process.nextTick = prevNextTick;
|
||||
this._global.setImmediate = prevSetImmediate;
|
||||
this._global.setInterval = prevSetInterval;
|
||||
this._global.setTimeout = prevSetTimeout;
|
||||
if (errThrown) {
|
||||
throw cbErr;
|
||||
}
|
||||
}
|
||||
useRealTimers() {
|
||||
const global = this._global;
|
||||
if (typeof global.cancelAnimationFrame === 'function') {
|
||||
(0, _jestUtil().setGlobal)(global, 'cancelAnimationFrame', this._timerAPIs.cancelAnimationFrame);
|
||||
}
|
||||
if (typeof global.clearImmediate === 'function') {
|
||||
(0, _jestUtil().setGlobal)(global, 'clearImmediate', this._timerAPIs.clearImmediate);
|
||||
}
|
||||
(0, _jestUtil().setGlobal)(global, 'clearInterval', this._timerAPIs.clearInterval);
|
||||
(0, _jestUtil().setGlobal)(global, 'clearTimeout', this._timerAPIs.clearTimeout);
|
||||
if (typeof global.requestAnimationFrame === 'function') {
|
||||
(0, _jestUtil().setGlobal)(global, 'requestAnimationFrame', this._timerAPIs.requestAnimationFrame);
|
||||
}
|
||||
if (typeof global.setImmediate === 'function') {
|
||||
(0, _jestUtil().setGlobal)(global, 'setImmediate', this._timerAPIs.setImmediate);
|
||||
}
|
||||
(0, _jestUtil().setGlobal)(global, 'setInterval', this._timerAPIs.setInterval);
|
||||
(0, _jestUtil().setGlobal)(global, 'setTimeout', this._timerAPIs.setTimeout);
|
||||
global.process.nextTick = this._timerAPIs.nextTick;
|
||||
this._fakingTime = false;
|
||||
}
|
||||
useFakeTimers() {
|
||||
this._createMocks();
|
||||
const global = this._global;
|
||||
if (typeof global.cancelAnimationFrame === 'function') {
|
||||
(0, _jestUtil().setGlobal)(global, 'cancelAnimationFrame', this._fakeTimerAPIs.cancelAnimationFrame);
|
||||
}
|
||||
if (typeof global.clearImmediate === 'function') {
|
||||
(0, _jestUtil().setGlobal)(global, 'clearImmediate', this._fakeTimerAPIs.clearImmediate);
|
||||
}
|
||||
(0, _jestUtil().setGlobal)(global, 'clearInterval', this._fakeTimerAPIs.clearInterval);
|
||||
(0, _jestUtil().setGlobal)(global, 'clearTimeout', this._fakeTimerAPIs.clearTimeout);
|
||||
if (typeof global.requestAnimationFrame === 'function') {
|
||||
(0, _jestUtil().setGlobal)(global, 'requestAnimationFrame', this._fakeTimerAPIs.requestAnimationFrame);
|
||||
}
|
||||
if (typeof global.setImmediate === 'function') {
|
||||
(0, _jestUtil().setGlobal)(global, 'setImmediate', this._fakeTimerAPIs.setImmediate);
|
||||
}
|
||||
(0, _jestUtil().setGlobal)(global, 'setInterval', this._fakeTimerAPIs.setInterval);
|
||||
(0, _jestUtil().setGlobal)(global, 'setTimeout', this._fakeTimerAPIs.setTimeout);
|
||||
global.process.nextTick = this._fakeTimerAPIs.nextTick;
|
||||
this._fakingTime = true;
|
||||
}
|
||||
getTimerCount() {
|
||||
this._checkFakeTimers();
|
||||
return this._timers.size + this._immediates.length + this._ticks.length;
|
||||
}
|
||||
_checkFakeTimers() {
|
||||
if (!this._fakingTime) {
|
||||
this._global.console.warn('A function to advance timers was called but the timers APIs are not mocked ' + 'with fake timers. Call `jest.useFakeTimers({legacyFakeTimers: true})` ' + 'in this test file or enable fake timers for all tests by setting ' + "{'enableGlobally': true, 'legacyFakeTimers': true} in " + `Jest configuration file.\nStack Trace:\n${(0, _jestMessageUtil().formatStackTrace)(
|
||||
// eslint-disable-next-line unicorn/error-message
|
||||
new Error().stack, this._config, {
|
||||
noStackTrace: false
|
||||
})}`);
|
||||
}
|
||||
}
|
||||
#createMockFunction(implementation) {
|
||||
return this._moduleMocker.fn(implementation.bind(this));
|
||||
}
|
||||
_createMocks() {
|
||||
const promisifiableFakeSetTimeout = this.#createMockFunction(this._fakeSetTimeout);
|
||||
// @ts-expect-error: no index
|
||||
promisifiableFakeSetTimeout[_util().promisify.custom] = (delay, arg) => new Promise(resolve => promisifiableFakeSetTimeout(resolve, delay, arg));
|
||||
this._fakeTimerAPIs = {
|
||||
cancelAnimationFrame: this.#createMockFunction(this._fakeClearTimer),
|
||||
clearImmediate: this.#createMockFunction(this._fakeClearImmediate),
|
||||
clearInterval: this.#createMockFunction(this._fakeClearTimer),
|
||||
clearTimeout: this.#createMockFunction(this._fakeClearTimer),
|
||||
nextTick: this.#createMockFunction(this._fakeNextTick),
|
||||
requestAnimationFrame: this.#createMockFunction(this._fakeRequestAnimationFrame),
|
||||
setImmediate: this.#createMockFunction(this._fakeSetImmediate),
|
||||
setInterval: this.#createMockFunction(this._fakeSetInterval),
|
||||
setTimeout: promisifiableFakeSetTimeout
|
||||
};
|
||||
}
|
||||
_fakeClearTimer(timerRef) {
|
||||
const uuid = this._timerConfig.refToId(timerRef);
|
||||
if (uuid) {
|
||||
this._timers.delete(String(uuid));
|
||||
}
|
||||
}
|
||||
_fakeClearImmediate(uuid) {
|
||||
this._immediates = this._immediates.filter(immediate => immediate.uuid !== uuid);
|
||||
}
|
||||
_fakeNextTick(callback, ...args) {
|
||||
if (this._disposed) {
|
||||
return;
|
||||
}
|
||||
const uuid = String(this._uuidCounter++);
|
||||
this._ticks.push({
|
||||
callback: () => callback.apply(null, args),
|
||||
uuid
|
||||
});
|
||||
const cancelledTicks = this._cancelledTicks;
|
||||
this._timerAPIs.nextTick(() => {
|
||||
if (!Object.prototype.hasOwnProperty.call(cancelledTicks, uuid)) {
|
||||
// Callback may throw, so update the map prior calling.
|
||||
cancelledTicks[uuid] = true;
|
||||
callback.apply(null, args);
|
||||
}
|
||||
});
|
||||
}
|
||||
_fakeRequestAnimationFrame(callback) {
|
||||
return this._fakeSetTimeout(() => {
|
||||
// TODO: Use performance.now() once it's mocked
|
||||
callback(this._now);
|
||||
}, 1000 / 60);
|
||||
}
|
||||
_fakeSetImmediate(callback, ...args) {
|
||||
if (this._disposed) {
|
||||
return null;
|
||||
}
|
||||
const uuid = String(this._uuidCounter++);
|
||||
this._immediates.push({
|
||||
callback: () => callback.apply(null, args),
|
||||
uuid
|
||||
});
|
||||
this._timerAPIs.setImmediate(() => {
|
||||
if (!this._disposed) {
|
||||
if (this._immediates.some(x => x.uuid === uuid)) {
|
||||
try {
|
||||
callback.apply(null, args);
|
||||
} finally {
|
||||
this._fakeClearImmediate(uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return uuid;
|
||||
}
|
||||
_fakeSetInterval(callback, intervalDelay, ...args) {
|
||||
if (this._disposed) {
|
||||
return null;
|
||||
}
|
||||
if (intervalDelay == null) {
|
||||
intervalDelay = 0;
|
||||
}
|
||||
const uuid = this._uuidCounter++;
|
||||
this._timers.set(String(uuid), {
|
||||
callback: () => callback.apply(null, args),
|
||||
expiry: this._now + intervalDelay,
|
||||
interval: intervalDelay,
|
||||
type: 'interval'
|
||||
});
|
||||
return this._timerConfig.idToRef(uuid);
|
||||
}
|
||||
_fakeSetTimeout(callback, delay, ...args) {
|
||||
if (this._disposed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-bitwise,unicorn/prefer-math-trunc
|
||||
delay = Number(delay) | 0;
|
||||
const uuid = this._uuidCounter++;
|
||||
this._timers.set(String(uuid), {
|
||||
callback: () => callback.apply(null, args),
|
||||
expiry: this._now + delay,
|
||||
interval: undefined,
|
||||
type: 'timeout'
|
||||
});
|
||||
return this._timerConfig.idToRef(uuid);
|
||||
}
|
||||
_getNextTimerHandleAndExpiry() {
|
||||
let nextTimerHandle = null;
|
||||
let soonestTime = MS_IN_A_YEAR;
|
||||
for (const [uuid, timer] of this._timers.entries()) {
|
||||
if (timer.expiry < soonestTime) {
|
||||
soonestTime = timer.expiry;
|
||||
nextTimerHandle = uuid;
|
||||
}
|
||||
}
|
||||
if (nextTimerHandle === null) {
|
||||
return null;
|
||||
}
|
||||
return [nextTimerHandle, soonestTime];
|
||||
}
|
||||
_runTimerHandle(timerHandle) {
|
||||
const timer = this._timers.get(timerHandle);
|
||||
if (!timer) {
|
||||
// Timer has been cleared - we'll hit this when a timer is cleared within
|
||||
// another timer in runOnlyPendingTimers
|
||||
return;
|
||||
}
|
||||
switch (timer.type) {
|
||||
case 'timeout':
|
||||
this._timers.delete(timerHandle);
|
||||
timer.callback();
|
||||
break;
|
||||
case 'interval':
|
||||
timer.expiry = this._now + (timer.interval || 0);
|
||||
timer.callback();
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unexpected timer type: ${timer.type}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports["default"] = FakeTimers;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/modernFakeTimers.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = void 0;
|
||||
function _fakeTimers() {
|
||||
const data = require("@sinonjs/fake-timers");
|
||||
_fakeTimers = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestMessageUtil() {
|
||||
const data = require("jest-message-util");
|
||||
_jestMessageUtil = 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.
|
||||
*/
|
||||
|
||||
class FakeTimers {
|
||||
_clock;
|
||||
_config;
|
||||
_fakingTime;
|
||||
_global;
|
||||
_fakeTimers;
|
||||
constructor({
|
||||
global,
|
||||
config
|
||||
}) {
|
||||
this._global = global;
|
||||
this._config = config;
|
||||
this._fakingTime = false;
|
||||
this._fakeTimers = (0, _fakeTimers().withGlobal)(global);
|
||||
}
|
||||
clearAllTimers() {
|
||||
if (this._fakingTime) {
|
||||
this._clock.reset();
|
||||
}
|
||||
}
|
||||
dispose() {
|
||||
this.useRealTimers();
|
||||
}
|
||||
runAllTimers() {
|
||||
if (this._checkFakeTimers()) {
|
||||
this._clock.runAll();
|
||||
}
|
||||
}
|
||||
async runAllTimersAsync() {
|
||||
if (this._checkFakeTimers()) {
|
||||
await this._clock.runAllAsync();
|
||||
}
|
||||
}
|
||||
runOnlyPendingTimers() {
|
||||
if (this._checkFakeTimers()) {
|
||||
this._clock.runToLast();
|
||||
}
|
||||
}
|
||||
async runOnlyPendingTimersAsync() {
|
||||
if (this._checkFakeTimers()) {
|
||||
await this._clock.runToLastAsync();
|
||||
}
|
||||
}
|
||||
advanceTimersToNextTimer(steps = 1) {
|
||||
if (this._checkFakeTimers()) {
|
||||
for (let i = steps; i > 0; i--) {
|
||||
this._clock.next();
|
||||
// Fire all timers at this point: https://github.com/sinonjs/fake-timers/issues/250
|
||||
this._clock.tick(0);
|
||||
if (this._clock.countTimers() === 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async advanceTimersToNextTimerAsync(steps = 1) {
|
||||
if (this._checkFakeTimers()) {
|
||||
for (let i = steps; i > 0; i--) {
|
||||
await this._clock.nextAsync();
|
||||
// Fire all timers at this point: https://github.com/sinonjs/fake-timers/issues/250
|
||||
await this._clock.tickAsync(0);
|
||||
if (this._clock.countTimers() === 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
advanceTimersByTime(msToRun) {
|
||||
if (this._checkFakeTimers()) {
|
||||
this._clock.tick(msToRun);
|
||||
}
|
||||
}
|
||||
async advanceTimersByTimeAsync(msToRun) {
|
||||
if (this._checkFakeTimers()) {
|
||||
await this._clock.tickAsync(msToRun);
|
||||
}
|
||||
}
|
||||
advanceTimersToNextFrame() {
|
||||
if (this._checkFakeTimers()) {
|
||||
this._clock.runToFrame();
|
||||
}
|
||||
}
|
||||
runAllTicks() {
|
||||
if (this._checkFakeTimers()) {
|
||||
// @ts-expect-error - doesn't exist?
|
||||
this._clock.runMicrotasks();
|
||||
}
|
||||
}
|
||||
useRealTimers() {
|
||||
if (this._fakingTime) {
|
||||
this._clock.uninstall();
|
||||
this._fakingTime = false;
|
||||
}
|
||||
}
|
||||
useFakeTimers(fakeTimersConfig) {
|
||||
if (this._fakingTime) {
|
||||
this._clock.uninstall();
|
||||
}
|
||||
this._clock = this._fakeTimers.install(this._toSinonFakeTimersConfig(fakeTimersConfig));
|
||||
this._fakingTime = true;
|
||||
}
|
||||
reset() {
|
||||
if (this._checkFakeTimers()) {
|
||||
const {
|
||||
now
|
||||
} = this._clock;
|
||||
this._clock.reset();
|
||||
this._clock.setSystemTime(now);
|
||||
}
|
||||
}
|
||||
setSystemTime(now) {
|
||||
if (this._checkFakeTimers()) {
|
||||
this._clock.setSystemTime(now);
|
||||
}
|
||||
}
|
||||
getRealSystemTime() {
|
||||
return Date.now();
|
||||
}
|
||||
now() {
|
||||
if (this._fakingTime) {
|
||||
return this._clock.now;
|
||||
}
|
||||
return Date.now();
|
||||
}
|
||||
getTimerCount() {
|
||||
if (this._checkFakeTimers()) {
|
||||
return this._clock.countTimers();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
_checkFakeTimers() {
|
||||
if (!this._fakingTime) {
|
||||
this._global.console.warn('A function to advance timers was called but the timers APIs are not replaced ' + 'with fake timers. Call `jest.useFakeTimers()` in this test file or enable ' + "fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} " + `in Jest configuration file.\nStack Trace:\n${(0, _jestMessageUtil().formatStackTrace)(
|
||||
// eslint-disable-next-line unicorn/error-message
|
||||
new Error().stack, this._config, {
|
||||
noStackTrace: false
|
||||
})}`);
|
||||
}
|
||||
return this._fakingTime;
|
||||
}
|
||||
_toSinonFakeTimersConfig(fakeTimersConfig = {}) {
|
||||
fakeTimersConfig = {
|
||||
...this._config.fakeTimers,
|
||||
...fakeTimersConfig
|
||||
};
|
||||
const advanceTimeDelta = typeof fakeTimersConfig.advanceTimers === 'number' ? fakeTimersConfig.advanceTimers : undefined;
|
||||
const toFake = new Set(Object.keys(this._fakeTimers.timers));
|
||||
if (fakeTimersConfig.doNotFake) for (const nameOfFakeableAPI of fakeTimersConfig.doNotFake) {
|
||||
toFake.delete(nameOfFakeableAPI);
|
||||
}
|
||||
return {
|
||||
advanceTimeDelta,
|
||||
loopLimit: fakeTimersConfig.timerLimit || 100_000,
|
||||
now: fakeTimersConfig.now ?? Date.now(),
|
||||
shouldAdvanceTime: Boolean(fakeTimersConfig.advanceTimers),
|
||||
shouldClearNativeTimers: true,
|
||||
toFake: [...toFake]
|
||||
};
|
||||
}
|
||||
}
|
||||
exports["default"] = FakeTimers;
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // 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__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
|
||||
(() => {
|
||||
var exports = __webpack_exports__;
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
Object.defineProperty(exports, "LegacyFakeTimers", ({
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _legacyFakeTimers.default;
|
||||
}
|
||||
}));
|
||||
Object.defineProperty(exports, "ModernFakeTimers", ({
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _modernFakeTimers.default;
|
||||
}
|
||||
}));
|
||||
var _legacyFakeTimers = _interopRequireDefault(__webpack_require__("./src/legacyFakeTimers.ts"));
|
||||
var _modernFakeTimers = _interopRequireDefault(__webpack_require__("./src/modernFakeTimers.ts"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
})();
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
4
frontend/node_modules/@jest/fake-timers/build/index.mjs
generated
vendored
Normal file
4
frontend/node_modules/@jest/fake-timers/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const LegacyFakeTimers = cjsModule.LegacyFakeTimers;
|
||||
export const ModernFakeTimers = cjsModule.ModernFakeTimers;
|
||||
40
frontend/node_modules/@jest/fake-timers/package.json
generated
vendored
Normal file
40
frontend/node_modules/@jest/fake-timers/package.json
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "@jest/fake-timers",
|
||||
"version": "30.0.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-fake-timers"
|
||||
},
|
||||
"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": {
|
||||
"@jest/types": "30.0.1",
|
||||
"@sinonjs/fake-timers": "^13.0.0",
|
||||
"@types/node": "*",
|
||||
"jest-message-util": "30.0.2",
|
||||
"jest-mock": "30.0.2",
|
||||
"jest-util": "30.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/test-utils": "30.0.4",
|
||||
"@types/sinonjs__fake-timers": "^8.1.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "f4296d2bc85c1405f84ddf613a25d0bc3766b7e5"
|
||||
}
|
||||
22
frontend/node_modules/@jest/get-type/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/get-type/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.
|
||||
28
frontend/node_modules/@jest/get-type/build/index.d.ts
generated
vendored
Normal file
28
frontend/node_modules/@jest/get-type/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export declare function getType(value: unknown): ValueType;
|
||||
|
||||
export declare const isPrimitive: (value: unknown) => boolean;
|
||||
|
||||
declare type ValueType =
|
||||
| 'array'
|
||||
| 'bigint'
|
||||
| 'boolean'
|
||||
| 'function'
|
||||
| 'null'
|
||||
| 'number'
|
||||
| 'object'
|
||||
| 'regexp'
|
||||
| 'map'
|
||||
| 'set'
|
||||
| 'date'
|
||||
| 'string'
|
||||
| 'symbol'
|
||||
| 'undefined';
|
||||
|
||||
export {};
|
||||
70
frontend/node_modules/@jest/get-type/build/index.js
generated
vendored
Normal file
70
frontend/node_modules/@jest/get-type/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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_exports__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
|
||||
(() => {
|
||||
var exports = __webpack_exports__;
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.getType = getType;
|
||||
exports.isPrimitive = 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.
|
||||
*/
|
||||
|
||||
// get the type of a value with handling the edge cases like `typeof []`
|
||||
// and `typeof null`
|
||||
function getType(value) {
|
||||
if (value === undefined) {
|
||||
return 'undefined';
|
||||
} else if (value === null) {
|
||||
return 'null';
|
||||
} else if (Array.isArray(value)) {
|
||||
return 'array';
|
||||
} else if (typeof value === 'boolean') {
|
||||
return 'boolean';
|
||||
} else if (typeof value === 'function') {
|
||||
return 'function';
|
||||
} else if (typeof value === 'number') {
|
||||
return 'number';
|
||||
} else if (typeof value === 'string') {
|
||||
return 'string';
|
||||
} else if (typeof value === 'bigint') {
|
||||
return 'bigint';
|
||||
} else if (typeof value === 'object') {
|
||||
if (value.constructor === RegExp) {
|
||||
return 'regexp';
|
||||
} else if (value.constructor === Map) {
|
||||
return 'map';
|
||||
} else if (value.constructor === Set) {
|
||||
return 'set';
|
||||
} else if (value.constructor === Date) {
|
||||
return 'date';
|
||||
}
|
||||
return 'object';
|
||||
} else if (typeof value === 'symbol') {
|
||||
return 'symbol';
|
||||
}
|
||||
throw new Error(`value of unknown type: ${value}`);
|
||||
}
|
||||
const isPrimitive = value => Object(value) !== value;
|
||||
exports.isPrimitive = isPrimitive;
|
||||
})();
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
4
frontend/node_modules/@jest/get-type/build/index.mjs
generated
vendored
Normal file
4
frontend/node_modules/@jest/get-type/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const getType = cjsModule.getType;
|
||||
export const isPrimitive = cjsModule.isPrimitive;
|
||||
29
frontend/node_modules/@jest/get-type/package.json
generated
vendored
Normal file
29
frontend/node_modules/@jest/get-type/package.json
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "@jest/get-type",
|
||||
"description": "A utility function to get the type of a value",
|
||||
"version": "30.0.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-get-type"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "5ce865b4060189fe74cd486544816c079194a0f7"
|
||||
}
|
||||
22
frontend/node_modules/@jest/globals/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/globals/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.
|
||||
71
frontend/node_modules/@jest/globals/build/index.d.ts
generated
vendored
Normal file
71
frontend/node_modules/@jest/globals/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* 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 type { Jest } from '@jest/environment';
|
||||
import type { JestExpect } from '@jest/expect';
|
||||
import type { Global } from '@jest/types';
|
||||
import type { ClassLike, FunctionLike, Mock as JestMock, Mocked as JestMocked, MockedClass as JestMockedClass, MockedFunction as JestMockedFunction, MockedObject as JestMockedObject, Replaced as JestReplaced, Spied as JestSpied, SpiedClass as JestSpiedClass, SpiedFunction as JestSpiedFunction, SpiedGetter as JestSpiedGetter, SpiedSetter as JestSpiedSetter, UnknownFunction } from 'jest-mock';
|
||||
export declare const expect: JestExpect;
|
||||
export declare const it: Global.GlobalAdditions['it'];
|
||||
export declare const test: Global.GlobalAdditions['test'];
|
||||
export declare const fit: Global.GlobalAdditions['fit'];
|
||||
export declare const xit: Global.GlobalAdditions['xit'];
|
||||
export declare const xtest: Global.GlobalAdditions['xtest'];
|
||||
export declare const describe: Global.GlobalAdditions['describe'];
|
||||
export declare const xdescribe: Global.GlobalAdditions['xdescribe'];
|
||||
export declare const fdescribe: Global.GlobalAdditions['fdescribe'];
|
||||
export declare const beforeAll: Global.GlobalAdditions['beforeAll'];
|
||||
export declare const beforeEach: Global.GlobalAdditions['beforeEach'];
|
||||
export declare const afterEach: Global.GlobalAdditions['afterEach'];
|
||||
export declare const afterAll: Global.GlobalAdditions['afterAll'];
|
||||
declare const jest: Jest;
|
||||
declare namespace jest {
|
||||
/**
|
||||
* Constructs the type of a mock function, e.g. the return type of `jest.fn()`.
|
||||
*/
|
||||
type Mock<T extends FunctionLike = UnknownFunction> = JestMock<T>;
|
||||
/**
|
||||
* Wraps a class, function or object type with Jest mock type definitions.
|
||||
*/
|
||||
type Mocked<T extends object> = JestMocked<T>;
|
||||
/**
|
||||
* Wraps a class type with Jest mock type definitions.
|
||||
*/
|
||||
type MockedClass<T extends ClassLike> = JestMockedClass<T>;
|
||||
/**
|
||||
* Wraps a function type with Jest mock type definitions.
|
||||
*/
|
||||
type MockedFunction<T extends FunctionLike> = JestMockedFunction<T>;
|
||||
/**
|
||||
* Wraps an object type with Jest mock type definitions.
|
||||
*/
|
||||
type MockedObject<T extends object> = JestMockedObject<T>;
|
||||
/**
|
||||
* Constructs the type of a replaced property.
|
||||
*/
|
||||
type Replaced<T> = JestReplaced<T>;
|
||||
/**
|
||||
* Constructs the type of a spied class or function.
|
||||
*/
|
||||
type Spied<T extends ClassLike | FunctionLike> = JestSpied<T>;
|
||||
/**
|
||||
* Constructs the type of a spied class.
|
||||
*/
|
||||
type SpiedClass<T extends ClassLike> = JestSpiedClass<T>;
|
||||
/**
|
||||
* Constructs the type of a spied function.
|
||||
*/
|
||||
type SpiedFunction<T extends FunctionLike> = JestSpiedFunction<T>;
|
||||
/**
|
||||
* Constructs the type of a spied getter.
|
||||
*/
|
||||
type SpiedGetter<T> = JestSpiedGetter<T>;
|
||||
/**
|
||||
* Constructs the type of a spied setter.
|
||||
*/
|
||||
type SpiedSetter<T> = JestSpiedSetter<T>;
|
||||
}
|
||||
export { jest };
|
||||
26
frontend/node_modules/@jest/globals/build/index.js
generated
vendored
Normal file
26
frontend/node_modules/@jest/globals/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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_exports__ = {};
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
|
||||
throw new Error('Do not import `@jest/globals` outside of the Jest test environment');
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
32
frontend/node_modules/@jest/globals/package.json
generated
vendored
Normal file
32
frontend/node_modules/@jest/globals/package.json
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "@jest/globals",
|
||||
"version": "30.0.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-globals"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "./build/index.js",
|
||||
"types": "./build/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./build/index.d.ts",
|
||||
"default": "./build/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/environment": "30.0.4",
|
||||
"@jest/expect": "30.0.4",
|
||||
"@jest/types": "30.0.1",
|
||||
"jest-mock": "30.0.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "f4296d2bc85c1405f84ddf613a25d0bc3766b7e5"
|
||||
}
|
||||
22
frontend/node_modules/@jest/pattern/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/pattern/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.
|
||||
3
frontend/node_modules/@jest/pattern/README.md
generated
vendored
Normal file
3
frontend/node_modules/@jest/pattern/README.md
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# @jest/pattern
|
||||
|
||||
`@jest/pattern` is a helper library for the jest library that implements the logic for parsing and matching patterns.
|
||||
5
frontend/node_modules/@jest/pattern/api-extractor.json
generated
vendored
Normal file
5
frontend/node_modules/@jest/pattern/api-extractor.json
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "../../api-extractor.json",
|
||||
"mainEntryPointFilePath": "/Users/cpojer/Dropbox/Projects/jest/packages/jest-pattern/build/index.d.ts",
|
||||
"projectFolder": "/Users/cpojer/Dropbox/Projects/jest/packages/jest-pattern"
|
||||
}
|
||||
65
frontend/node_modules/@jest/pattern/build/index.d.ts
generated
vendored
Normal file
65
frontend/node_modules/@jest/pattern/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export declare class TestPathPatterns {
|
||||
readonly patterns: Array<string>;
|
||||
constructor(patterns: Array<string>);
|
||||
/**
|
||||
* Return true if there are any patterns.
|
||||
*/
|
||||
isSet(): boolean;
|
||||
/**
|
||||
* Return true if the patterns are valid.
|
||||
*/
|
||||
isValid(): boolean;
|
||||
/**
|
||||
* Return a human-friendly version of the pattern regex.
|
||||
*/
|
||||
toPretty(): string;
|
||||
/**
|
||||
* Return a TestPathPatternsExecutor that can execute the patterns.
|
||||
*/
|
||||
toExecutor(
|
||||
options: TestPathPatternsExecutorOptions,
|
||||
): TestPathPatternsExecutor;
|
||||
/** For jest serializers */
|
||||
toJSON(): any;
|
||||
}
|
||||
|
||||
export declare class TestPathPatternsExecutor {
|
||||
readonly patterns: TestPathPatterns;
|
||||
private readonly options;
|
||||
constructor(
|
||||
patterns: TestPathPatterns,
|
||||
options: TestPathPatternsExecutorOptions,
|
||||
);
|
||||
private toRegex;
|
||||
/**
|
||||
* Return true if there are any patterns.
|
||||
*/
|
||||
isSet(): boolean;
|
||||
/**
|
||||
* Return true if the patterns are valid.
|
||||
*/
|
||||
isValid(): boolean;
|
||||
/**
|
||||
* Return true if the given ABSOLUTE path matches the patterns.
|
||||
*
|
||||
* Throws an error if the patterns form an invalid regex (see `validate`).
|
||||
*/
|
||||
isMatch(absPath: string): boolean;
|
||||
/**
|
||||
* Return a human-friendly version of the pattern regex.
|
||||
*/
|
||||
toPretty(): string;
|
||||
}
|
||||
|
||||
export declare type TestPathPatternsExecutorOptions = {
|
||||
rootDir: string;
|
||||
};
|
||||
|
||||
export {};
|
||||
214
frontend/node_modules/@jest/pattern/build/index.js
generated
vendored
Normal file
214
frontend/node_modules/@jest/pattern/build/index.js
generated
vendored
Normal file
@@ -0,0 +1,214 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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/TestPathPatterns.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.TestPathPatternsExecutor = exports.TestPathPatterns = void 0;
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require("path"));
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestRegexUtil() {
|
||||
const data = require("jest-regex-util");
|
||||
_jestRegexUtil = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
class TestPathPatterns {
|
||||
constructor(patterns) {
|
||||
this.patterns = patterns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if there are any patterns.
|
||||
*/
|
||||
isSet() {
|
||||
return this.patterns.length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the patterns are valid.
|
||||
*/
|
||||
isValid() {
|
||||
return this.toExecutor({
|
||||
// isValid() doesn't require rootDir to be accurate, so just
|
||||
// specify a dummy rootDir here
|
||||
rootDir: '/'
|
||||
}).isValid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a human-friendly version of the pattern regex.
|
||||
*/
|
||||
toPretty() {
|
||||
return this.patterns.join('|');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a TestPathPatternsExecutor that can execute the patterns.
|
||||
*/
|
||||
toExecutor(options) {
|
||||
return new TestPathPatternsExecutor(this, options);
|
||||
}
|
||||
|
||||
/** For jest serializers */
|
||||
toJSON() {
|
||||
return {
|
||||
patterns: this.patterns,
|
||||
type: 'TestPathPatterns'
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.TestPathPatterns = TestPathPatterns;
|
||||
class TestPathPatternsExecutor {
|
||||
constructor(patterns, options) {
|
||||
this.patterns = patterns;
|
||||
this.options = options;
|
||||
}
|
||||
toRegex(s) {
|
||||
return new RegExp(s, 'i');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if there are any patterns.
|
||||
*/
|
||||
isSet() {
|
||||
return this.patterns.isSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the patterns are valid.
|
||||
*/
|
||||
isValid() {
|
||||
try {
|
||||
for (const p of this.patterns.patterns) {
|
||||
this.toRegex(p);
|
||||
}
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the given ABSOLUTE path matches the patterns.
|
||||
*
|
||||
* Throws an error if the patterns form an invalid regex (see `validate`).
|
||||
*/
|
||||
isMatch(absPath) {
|
||||
const relPath = path().relative(this.options.rootDir || '/', absPath);
|
||||
if (this.patterns.patterns.length === 0) {
|
||||
return true;
|
||||
}
|
||||
for (const p of this.patterns.patterns) {
|
||||
const pathToTest = path().isAbsolute(p) ? absPath : relPath;
|
||||
|
||||
// special case: ./foo.spec.js (and .\foo.spec.js on Windows) should
|
||||
// match /^foo.spec.js/ after stripping root dir
|
||||
let regexStr = p.replace(/^\.\//, '^');
|
||||
if (path().sep === '\\') {
|
||||
regexStr = regexStr.replace(/^\.\\/, '^');
|
||||
}
|
||||
regexStr = (0, _jestRegexUtil().replacePathSepForRegex)(regexStr);
|
||||
if (this.toRegex(regexStr).test(pathToTest)) {
|
||||
return true;
|
||||
}
|
||||
if (this.toRegex(regexStr).test(absPath)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a human-friendly version of the pattern regex.
|
||||
*/
|
||||
toPretty() {
|
||||
return this.patterns.toPretty();
|
||||
}
|
||||
}
|
||||
exports.TestPathPatternsExecutor = TestPathPatternsExecutor;
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // 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__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
|
||||
(() => {
|
||||
var exports = __webpack_exports__;
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
Object.defineProperty(exports, "TestPathPatterns", ({
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TestPathPatterns.TestPathPatterns;
|
||||
}
|
||||
}));
|
||||
Object.defineProperty(exports, "TestPathPatternsExecutor", ({
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TestPathPatterns.TestPathPatternsExecutor;
|
||||
}
|
||||
}));
|
||||
var _TestPathPatterns = __webpack_require__("./src/TestPathPatterns.ts");
|
||||
})();
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
4
frontend/node_modules/@jest/pattern/build/index.mjs
generated
vendored
Normal file
4
frontend/node_modules/@jest/pattern/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const TestPathPatterns = cjsModule.TestPathPatterns;
|
||||
export const TestPathPatternsExecutor = cjsModule.TestPathPatternsExecutor;
|
||||
32
frontend/node_modules/@jest/pattern/package.json
generated
vendored
Normal file
32
frontend/node_modules/@jest/pattern/package.json
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "@jest/pattern",
|
||||
"version": "30.0.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-pattern"
|
||||
},
|
||||
"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": "*",
|
||||
"jest-regex-util": "30.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "5ce865b4060189fe74cd486544816c079194a0f7"
|
||||
}
|
||||
132
frontend/node_modules/@jest/pattern/src/TestPathPatterns.ts
generated
vendored
Normal file
132
frontend/node_modules/@jest/pattern/src/TestPathPatterns.ts
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* 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 * as path from 'path';
|
||||
import {replacePathSepForRegex} from 'jest-regex-util';
|
||||
|
||||
export class TestPathPatterns {
|
||||
constructor(readonly patterns: Array<string>) {}
|
||||
|
||||
/**
|
||||
* Return true if there are any patterns.
|
||||
*/
|
||||
isSet(): boolean {
|
||||
return this.patterns.length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the patterns are valid.
|
||||
*/
|
||||
isValid(): boolean {
|
||||
return this.toExecutor({
|
||||
// isValid() doesn't require rootDir to be accurate, so just
|
||||
// specify a dummy rootDir here
|
||||
rootDir: '/',
|
||||
}).isValid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a human-friendly version of the pattern regex.
|
||||
*/
|
||||
toPretty(): string {
|
||||
return this.patterns.join('|');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a TestPathPatternsExecutor that can execute the patterns.
|
||||
*/
|
||||
toExecutor(
|
||||
options: TestPathPatternsExecutorOptions,
|
||||
): TestPathPatternsExecutor {
|
||||
return new TestPathPatternsExecutor(this, options);
|
||||
}
|
||||
|
||||
/** For jest serializers */
|
||||
toJSON(): any {
|
||||
return {
|
||||
patterns: this.patterns,
|
||||
type: 'TestPathPatterns',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export type TestPathPatternsExecutorOptions = {
|
||||
rootDir: string;
|
||||
};
|
||||
|
||||
export class TestPathPatternsExecutor {
|
||||
constructor(
|
||||
readonly patterns: TestPathPatterns,
|
||||
private readonly options: TestPathPatternsExecutorOptions,
|
||||
) {}
|
||||
|
||||
private toRegex(s: string): RegExp {
|
||||
return new RegExp(s, 'i');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if there are any patterns.
|
||||
*/
|
||||
isSet(): boolean {
|
||||
return this.patterns.isSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the patterns are valid.
|
||||
*/
|
||||
isValid(): boolean {
|
||||
try {
|
||||
for (const p of this.patterns.patterns) {
|
||||
this.toRegex(p);
|
||||
}
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the given ABSOLUTE path matches the patterns.
|
||||
*
|
||||
* Throws an error if the patterns form an invalid regex (see `validate`).
|
||||
*/
|
||||
isMatch(absPath: string): boolean {
|
||||
const relPath = path.relative(this.options.rootDir || '/', absPath);
|
||||
|
||||
if (this.patterns.patterns.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const p of this.patterns.patterns) {
|
||||
const pathToTest = path.isAbsolute(p) ? absPath : relPath;
|
||||
|
||||
// special case: ./foo.spec.js (and .\foo.spec.js on Windows) should
|
||||
// match /^foo.spec.js/ after stripping root dir
|
||||
let regexStr = p.replace(/^\.\//, '^');
|
||||
if (path.sep === '\\') {
|
||||
regexStr = regexStr.replace(/^\.\\/, '^');
|
||||
}
|
||||
|
||||
regexStr = replacePathSepForRegex(regexStr);
|
||||
if (this.toRegex(regexStr).test(pathToTest)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.toRegex(regexStr).test(absPath)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a human-friendly version of the pattern regex.
|
||||
*/
|
||||
toPretty(): string {
|
||||
return this.patterns.toPretty();
|
||||
}
|
||||
}
|
||||
259
frontend/node_modules/@jest/pattern/src/__tests__/TestPathPatterns.test.ts
generated
vendored
Normal file
259
frontend/node_modules/@jest/pattern/src/__tests__/TestPathPatterns.test.ts
generated
vendored
Normal file
@@ -0,0 +1,259 @@
|
||||
/**
|
||||
* 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 * as path from 'path';
|
||||
import {
|
||||
TestPathPatterns,
|
||||
TestPathPatternsExecutor,
|
||||
type TestPathPatternsExecutorOptions,
|
||||
} from '../TestPathPatterns';
|
||||
|
||||
const mockSep: jest.Mock<() => string> = jest.fn();
|
||||
const mockIsAbsolute: jest.Mock<(p: string) => boolean> = jest.fn();
|
||||
const mockRelative: jest.Mock<(from: string, to: string) => string> = jest.fn();
|
||||
jest.mock('path', () => {
|
||||
const actualPath = jest.requireActual('path');
|
||||
return {
|
||||
...actualPath,
|
||||
isAbsolute(p) {
|
||||
return mockIsAbsolute(p) || actualPath.isAbsolute(p);
|
||||
},
|
||||
relative(from, to) {
|
||||
return mockRelative(from, to) || actualPath.relative(from, to);
|
||||
},
|
||||
get sep() {
|
||||
return mockSep() || actualPath.sep;
|
||||
},
|
||||
} as typeof path;
|
||||
});
|
||||
const forcePosix = () => {
|
||||
mockSep.mockReturnValue(path.posix.sep);
|
||||
mockIsAbsolute.mockImplementation(path.posix.isAbsolute);
|
||||
mockRelative.mockImplementation(path.posix.relative);
|
||||
};
|
||||
const forceWindows = () => {
|
||||
mockSep.mockReturnValue(path.win32.sep);
|
||||
mockIsAbsolute.mockImplementation(path.win32.isAbsolute);
|
||||
mockRelative.mockImplementation(path.win32.relative);
|
||||
};
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
forcePosix();
|
||||
});
|
||||
|
||||
const config = {rootDir: ''};
|
||||
|
||||
interface TestPathPatternsLike {
|
||||
isSet(): boolean;
|
||||
isValid(): boolean;
|
||||
toPretty(): string;
|
||||
}
|
||||
|
||||
const testPathPatternsLikeTests = (
|
||||
makePatterns: (
|
||||
patterns: Array<string>,
|
||||
options: TestPathPatternsExecutorOptions,
|
||||
) => TestPathPatternsLike,
|
||||
) => {
|
||||
describe('isSet', () => {
|
||||
it('returns false if no patterns specified', () => {
|
||||
const testPathPatterns = makePatterns([], config);
|
||||
expect(testPathPatterns.isSet()).toBe(false);
|
||||
});
|
||||
|
||||
it('returns true if patterns specified', () => {
|
||||
const testPathPatterns = makePatterns(['a'], config);
|
||||
expect(testPathPatterns.isSet()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isValid', () => {
|
||||
it('succeeds for empty patterns', () => {
|
||||
const testPathPatterns = makePatterns([], config);
|
||||
expect(testPathPatterns.isValid()).toBe(true);
|
||||
});
|
||||
|
||||
it('succeeds for valid patterns', () => {
|
||||
const testPathPatterns = makePatterns(['abc+', 'z.*'], config);
|
||||
expect(testPathPatterns.isValid()).toBe(true);
|
||||
});
|
||||
|
||||
it('fails for at least one invalid pattern', () => {
|
||||
const testPathPatterns = makePatterns(['abc+', '(', 'z.*'], config);
|
||||
expect(testPathPatterns.isValid()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('toPretty', () => {
|
||||
it('renders a human-readable string', () => {
|
||||
const testPathPatterns = makePatterns(['a/b', 'c/d'], config);
|
||||
expect(testPathPatterns.toPretty()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
describe('TestPathPatterns', () => {
|
||||
testPathPatternsLikeTests(
|
||||
(patterns: Array<string>, _: TestPathPatternsExecutorOptions) =>
|
||||
new TestPathPatterns(patterns),
|
||||
);
|
||||
});
|
||||
|
||||
describe('TestPathPatternsExecutor', () => {
|
||||
const makeExecutor = (
|
||||
patterns: Array<string>,
|
||||
options: TestPathPatternsExecutorOptions,
|
||||
) => new TestPathPatternsExecutor(new TestPathPatterns(patterns), options);
|
||||
|
||||
testPathPatternsLikeTests(makeExecutor);
|
||||
|
||||
describe('isMatch', () => {
|
||||
it('returns true with no patterns', () => {
|
||||
const testPathPatterns = makeExecutor([], config);
|
||||
expect(testPathPatterns.isMatch('/a/b')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns true for same path', () => {
|
||||
const testPathPatterns = makeExecutor(['/a/b'], config);
|
||||
expect(testPathPatterns.isMatch('/a/b')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns true for same path with case insensitive', () => {
|
||||
const testPathPatternsUpper = makeExecutor(['/A/B'], config);
|
||||
expect(testPathPatternsUpper.isMatch('/a/b')).toBe(true);
|
||||
expect(testPathPatternsUpper.isMatch('/A/B')).toBe(true);
|
||||
|
||||
const testPathPatternsLower = makeExecutor(['/a/b'], config);
|
||||
expect(testPathPatternsLower.isMatch('/A/B')).toBe(true);
|
||||
expect(testPathPatternsLower.isMatch('/a/b')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns true for contained path', () => {
|
||||
const testPathPatterns = makeExecutor(['b/c'], config);
|
||||
expect(testPathPatterns.isMatch('/a/b/c/d')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns true for explicit relative path', () => {
|
||||
const testPathPatterns = makeExecutor(['./b/c'], {
|
||||
rootDir: '/a',
|
||||
});
|
||||
expect(testPathPatterns.isMatch('/a/b/c')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns true for explicit relative path for Windows with ./', () => {
|
||||
forceWindows();
|
||||
const testPathPatterns = makeExecutor(['./b/c'], {
|
||||
rootDir: 'C:\\a',
|
||||
});
|
||||
expect(testPathPatterns.isMatch('C:\\a\\b\\c')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns true for explicit relative path for Windows with .\\', () => {
|
||||
forceWindows();
|
||||
const testPathPatterns = makeExecutor(['.\\b\\c'], {
|
||||
rootDir: 'C:\\a',
|
||||
});
|
||||
expect(testPathPatterns.isMatch('C:\\a\\b\\c')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns true for partial file match', () => {
|
||||
const testPathPatterns = makeExecutor(['aaa'], config);
|
||||
expect(testPathPatterns.isMatch('/foo/..aaa..')).toBe(true);
|
||||
expect(testPathPatterns.isMatch('/foo/..aaa')).toBe(true);
|
||||
expect(testPathPatterns.isMatch('/foo/aaa..')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns true for path suffix', () => {
|
||||
const testPathPatterns = makeExecutor(['c/d'], config);
|
||||
expect(testPathPatterns.isMatch('/a/b/c/d')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns true if regex matches', () => {
|
||||
const testPathPatterns = makeExecutor(['ab*c?'], config);
|
||||
|
||||
expect(testPathPatterns.isMatch('/foo/a')).toBe(true);
|
||||
expect(testPathPatterns.isMatch('/foo/ab')).toBe(true);
|
||||
expect(testPathPatterns.isMatch('/foo/abb')).toBe(true);
|
||||
expect(testPathPatterns.isMatch('/foo/ac')).toBe(true);
|
||||
expect(testPathPatterns.isMatch('/foo/abc')).toBe(true);
|
||||
expect(testPathPatterns.isMatch('/foo/abbc')).toBe(true);
|
||||
|
||||
expect(testPathPatterns.isMatch('/foo/bc')).toBe(false);
|
||||
});
|
||||
|
||||
it('returns true only if matches relative path', () => {
|
||||
const rootDir = '/home/myuser/';
|
||||
|
||||
const testPathPatterns = makeExecutor(['home'], {
|
||||
rootDir,
|
||||
});
|
||||
expect(
|
||||
testPathPatterns.isMatch(
|
||||
path.relative(rootDir, '/home/myuser/LoginPage.js'),
|
||||
),
|
||||
).toBe(false);
|
||||
expect(
|
||||
testPathPatterns.isMatch(
|
||||
path.relative(rootDir, '/home/myuser/HomePage.js'),
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('matches absolute paths regardless of rootDir', () => {
|
||||
forcePosix();
|
||||
const testPathPatterns = makeExecutor(['/a/b'], {
|
||||
rootDir: '/foo/bar',
|
||||
});
|
||||
expect(testPathPatterns.isMatch('/a/b')).toBe(true);
|
||||
});
|
||||
|
||||
it('matches absolute paths for Windows', () => {
|
||||
forceWindows();
|
||||
const testPathPatterns = makeExecutor(['C:\\a\\b'], {
|
||||
rootDir: 'C:\\foo\\bar',
|
||||
});
|
||||
expect(testPathPatterns.isMatch('C:\\a\\b')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns true if match any paths', () => {
|
||||
const testPathPatterns = makeExecutor(['a/b', 'c/d'], config);
|
||||
|
||||
expect(testPathPatterns.isMatch('/foo/a/b')).toBe(true);
|
||||
expect(testPathPatterns.isMatch('/foo/c/d')).toBe(true);
|
||||
|
||||
expect(testPathPatterns.isMatch('/foo/a')).toBe(false);
|
||||
expect(testPathPatterns.isMatch('/foo/b/c')).toBe(false);
|
||||
});
|
||||
|
||||
it('does not normalize Windows paths on POSIX', () => {
|
||||
forcePosix();
|
||||
const testPathPatterns = makeExecutor(['a\\z', 'a\\\\z'], config);
|
||||
expect(testPathPatterns.isMatch('/foo/a/z')).toBe(false);
|
||||
});
|
||||
|
||||
it('normalizes paths for Windows', () => {
|
||||
forceWindows();
|
||||
const testPathPatterns = makeExecutor(['a/b'], config);
|
||||
expect(testPathPatterns.isMatch('C:\\foo\\a\\b')).toBe(true);
|
||||
});
|
||||
|
||||
it('matches absolute path with absPath', () => {
|
||||
const pattern = '^/home/app/';
|
||||
const rootDir = '/home/app';
|
||||
const absolutePath = '/home/app/packages/';
|
||||
|
||||
const testPathPatterns = makeExecutor([pattern], {
|
||||
rootDir,
|
||||
});
|
||||
|
||||
const relativePath = path.relative(rootDir, absolutePath);
|
||||
|
||||
expect(testPathPatterns.isMatch(relativePath)).toBe(false);
|
||||
expect(testPathPatterns.isMatch(absolutePath)).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
5
frontend/node_modules/@jest/pattern/src/__tests__/__snapshots__/TestPathPatterns.test.ts.snap
generated
vendored
Normal file
5
frontend/node_modules/@jest/pattern/src/__tests__/__snapshots__/TestPathPatterns.test.ts.snap
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`TestPathPatterns toPretty renders a human-readable string 1`] = `"a/b|c/d"`;
|
||||
|
||||
exports[`TestPathPatternsExecutor toPretty renders a human-readable string 1`] = `"a/b|c/d"`;
|
||||
12
frontend/node_modules/@jest/pattern/src/index.ts
generated
vendored
Normal file
12
frontend/node_modules/@jest/pattern/src/index.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export {
|
||||
TestPathPatterns,
|
||||
TestPathPatternsExecutor,
|
||||
type TestPathPatternsExecutorOptions,
|
||||
} from './TestPathPatterns';
|
||||
10
frontend/node_modules/@jest/pattern/tsconfig.json
generated
vendored
Normal file
10
frontend/node_modules/@jest/pattern/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "build"
|
||||
},
|
||||
"include": ["./src/**/*"],
|
||||
"exclude": ["./**/__tests__/**/*"],
|
||||
"references": [{"path": "../jest-regex-util"}]
|
||||
}
|
||||
22
frontend/node_modules/@jest/reporters/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/@jest/reporters/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.
|
||||
BIN
frontend/node_modules/@jest/reporters/assets/jest_logo.png
generated
vendored
Normal file
BIN
frontend/node_modules/@jest/reporters/assets/jest_logo.png
generated
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
43
frontend/node_modules/@jest/reporters/build/CoverageWorker.d.mts
generated
vendored
Normal file
43
frontend/node_modules/@jest/reporters/build/CoverageWorker.d.mts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import { FileCoverage } from "istanbul-lib-coverage";
|
||||
import { Config } from "@jest/types";
|
||||
import { V8Coverage } from "collect-v8-coverage";
|
||||
|
||||
//#region src/generateEmptyCoverage.d.ts
|
||||
|
||||
type SingleV8Coverage = V8Coverage[number];
|
||||
type CoverageWorkerResult = {
|
||||
kind: 'BabelCoverage';
|
||||
coverage: FileCoverage;
|
||||
} | {
|
||||
kind: 'V8Coverage';
|
||||
result: SingleV8Coverage;
|
||||
};
|
||||
//#endregion
|
||||
//#region src/types.d.ts
|
||||
|
||||
type ReporterContext = {
|
||||
firstRun: boolean;
|
||||
previousSuccess: boolean;
|
||||
changedFiles?: Set<string>;
|
||||
sourcesRelatedToTestsInChangedFiles?: Set<string>;
|
||||
startRun?: (globalConfig: Config.GlobalConfig) => unknown;
|
||||
};
|
||||
//#endregion
|
||||
//#region src/CoverageWorker.d.ts
|
||||
type SerializeSet<T> = T extends Set<infer U> ? Array<U> : T;
|
||||
type CoverageReporterContext = Pick<ReporterContext, 'changedFiles' | 'sourcesRelatedToTestsInChangedFiles'>;
|
||||
type CoverageReporterSerializedContext = { [K in keyof CoverageReporterContext]: SerializeSet<ReporterContext[K]> };
|
||||
type CoverageWorkerData = {
|
||||
config: Config.ProjectConfig;
|
||||
context: CoverageReporterSerializedContext;
|
||||
globalConfig: Config.GlobalConfig;
|
||||
path: string;
|
||||
};
|
||||
declare function worker({
|
||||
config,
|
||||
globalConfig,
|
||||
path,
|
||||
context
|
||||
}: CoverageWorkerData): Promise<CoverageWorkerResult | null>;
|
||||
//#endregion
|
||||
export { CoverageWorkerData, worker };
|
||||
196
frontend/node_modules/@jest/reporters/build/CoverageWorker.js
generated
vendored
Normal file
196
frontend/node_modules/@jest/reporters/build/CoverageWorker.js
generated
vendored
Normal file
@@ -0,0 +1,196 @@
|
||||
/*!
|
||||
* /**
|
||||
* * 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/generateEmptyCoverage.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = generateEmptyCoverage;
|
||||
function fs() {
|
||||
const data = _interopRequireWildcard(require("graceful-fs"));
|
||||
fs = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _istanbulLibCoverage() {
|
||||
const data = require("istanbul-lib-coverage");
|
||||
_istanbulLibCoverage = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _istanbulLibInstrument() {
|
||||
const data = require("istanbul-lib-instrument");
|
||||
_istanbulLibInstrument = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _transform() {
|
||||
const data = require("@jest/transform");
|
||||
_transform = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
async function generateEmptyCoverage(source, filename, globalConfig, config, changedFiles, sourcesRelatedToTestsInChangedFiles) {
|
||||
const coverageOptions = {
|
||||
changedFiles,
|
||||
collectCoverage: globalConfig.collectCoverage,
|
||||
collectCoverageFrom: globalConfig.collectCoverageFrom,
|
||||
coverageProvider: globalConfig.coverageProvider,
|
||||
sourcesRelatedToTestsInChangedFiles
|
||||
};
|
||||
let coverageWorkerResult = null;
|
||||
if ((0, _transform().shouldInstrument)(filename, coverageOptions, config)) {
|
||||
if (coverageOptions.coverageProvider === 'v8') {
|
||||
const stat = fs().statSync(filename);
|
||||
return {
|
||||
kind: 'V8Coverage',
|
||||
result: {
|
||||
functions: [{
|
||||
functionName: '(empty-report)',
|
||||
isBlockCoverage: true,
|
||||
ranges: [{
|
||||
count: 0,
|
||||
endOffset: stat.size,
|
||||
startOffset: 0
|
||||
}]
|
||||
}],
|
||||
scriptId: '0',
|
||||
url: filename
|
||||
}
|
||||
};
|
||||
}
|
||||
const scriptTransformer = await (0, _transform().createScriptTransformer)(config);
|
||||
|
||||
// Transform file with instrumentation to make sure initial coverage data is well mapped to original code.
|
||||
const {
|
||||
code
|
||||
} = await scriptTransformer.transformSourceAsync(filename, source, {
|
||||
instrument: true,
|
||||
supportsDynamicImport: true,
|
||||
supportsExportNamespaceFrom: true,
|
||||
supportsStaticESM: true,
|
||||
supportsTopLevelAwait: true
|
||||
});
|
||||
// TODO: consider passing AST
|
||||
const extracted = (0, _istanbulLibInstrument().readInitialCoverage)(code);
|
||||
// Check extracted initial coverage is not null, this can happen when using /* istanbul ignore file */
|
||||
if (extracted) {
|
||||
coverageWorkerResult = {
|
||||
coverage: (0, _istanbulLibCoverage().createFileCoverage)(extracted.coverageData),
|
||||
kind: 'BabelCoverage'
|
||||
};
|
||||
}
|
||||
}
|
||||
return coverageWorkerResult;
|
||||
}
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // 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__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
|
||||
(() => {
|
||||
var exports = __webpack_exports__;
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.worker = worker;
|
||||
function _exitX() {
|
||||
const data = _interopRequireDefault(require("exit-x"));
|
||||
_exitX = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function fs() {
|
||||
const data = _interopRequireWildcard(require("graceful-fs"));
|
||||
fs = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _generateEmptyCoverage = _interopRequireDefault(__webpack_require__("./src/generateEmptyCoverage.ts"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// Make sure uncaught errors are logged before we exit.
|
||||
process.on('uncaughtException', err => {
|
||||
if (err.stack) {
|
||||
console.error(err.stack);
|
||||
} else {
|
||||
console.error(err);
|
||||
}
|
||||
(0, _exitX().default)(1);
|
||||
});
|
||||
function worker({
|
||||
config,
|
||||
globalConfig,
|
||||
path,
|
||||
context
|
||||
}) {
|
||||
return (0, _generateEmptyCoverage.default)(fs().readFileSync(path, 'utf8'), path, globalConfig, config, context.changedFiles && new Set(context.changedFiles), context.sourcesRelatedToTestsInChangedFiles && new Set(context.sourcesRelatedToTestsInChangedFiles));
|
||||
}
|
||||
})();
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
67
frontend/node_modules/@jest/reporters/build/CoverageWorker.mjs
generated
vendored
Normal file
67
frontend/node_modules/@jest/reporters/build/CoverageWorker.mjs
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
import exit from "exit-x";
|
||||
import * as fs$1 from "graceful-fs";
|
||||
import * as fs from "graceful-fs";
|
||||
import { createFileCoverage } from "istanbul-lib-coverage";
|
||||
import { readInitialCoverage } from "istanbul-lib-instrument";
|
||||
import { createScriptTransformer, shouldInstrument } from "@jest/transform";
|
||||
|
||||
//#region src/generateEmptyCoverage.ts
|
||||
async function generateEmptyCoverage(source, filename, globalConfig, config, changedFiles, sourcesRelatedToTestsInChangedFiles) {
|
||||
const coverageOptions = {
|
||||
changedFiles,
|
||||
collectCoverage: globalConfig.collectCoverage,
|
||||
collectCoverageFrom: globalConfig.collectCoverageFrom,
|
||||
coverageProvider: globalConfig.coverageProvider,
|
||||
sourcesRelatedToTestsInChangedFiles
|
||||
};
|
||||
let coverageWorkerResult = null;
|
||||
if (shouldInstrument(filename, coverageOptions, config)) {
|
||||
if (coverageOptions.coverageProvider === "v8") {
|
||||
const stat = fs$1.statSync(filename);
|
||||
return {
|
||||
kind: "V8Coverage",
|
||||
result: {
|
||||
functions: [{
|
||||
functionName: "(empty-report)",
|
||||
isBlockCoverage: true,
|
||||
ranges: [{
|
||||
count: 0,
|
||||
endOffset: stat.size,
|
||||
startOffset: 0
|
||||
}]
|
||||
}],
|
||||
scriptId: "0",
|
||||
url: filename
|
||||
}
|
||||
};
|
||||
}
|
||||
const scriptTransformer = await createScriptTransformer(config);
|
||||
const { code } = await scriptTransformer.transformSourceAsync(filename, source, {
|
||||
instrument: true,
|
||||
supportsDynamicImport: true,
|
||||
supportsExportNamespaceFrom: true,
|
||||
supportsStaticESM: true,
|
||||
supportsTopLevelAwait: true
|
||||
});
|
||||
const extracted = readInitialCoverage(code);
|
||||
if (extracted) coverageWorkerResult = {
|
||||
coverage: createFileCoverage(extracted.coverageData),
|
||||
kind: "BabelCoverage"
|
||||
};
|
||||
}
|
||||
return coverageWorkerResult;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region src/CoverageWorker.ts
|
||||
process.on("uncaughtException", (err) => {
|
||||
if (err.stack) console.error(err.stack);
|
||||
else console.error(err);
|
||||
exit(1);
|
||||
});
|
||||
function worker({ config, globalConfig, path, context }) {
|
||||
return generateEmptyCoverage(fs.readFileSync(path, "utf8"), path, globalConfig, config, context.changedFiles && new Set(context.changedFiles), context.sourcesRelatedToTestsInChangedFiles && new Set(context.sourcesRelatedToTestsInChangedFiles));
|
||||
}
|
||||
|
||||
//#endregion
|
||||
export { worker };
|
||||
209
frontend/node_modules/@jest/reporters/build/index.d.mts
generated
vendored
Normal file
209
frontend/node_modules/@jest/reporters/build/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
import { Circus, Config, Config as Config$1 } from "@jest/types";
|
||||
import { AggregatedResult, AggregatedResult as AggregatedResult$1, AssertionResult, SnapshotSummary, SnapshotSummary as SnapshotSummary$1, Suite, Test, Test as Test$1, TestCaseResult, TestCaseResult as TestCaseResult$1, TestContext, TestContext as TestContext$1, TestResult, TestResult as TestResult$1 } from "@jest/test-result";
|
||||
import { WriteStream } from "tty";
|
||||
|
||||
//#region src/formatTestPath.d.ts
|
||||
|
||||
declare function formatTestPath(config: Config$1.GlobalConfig | Config$1.ProjectConfig, testPath: string): string;
|
||||
//#endregion
|
||||
//#region src/getResultHeader.d.ts
|
||||
declare function getResultHeader(result: TestResult$1, globalConfig: Config$1.GlobalConfig, projectConfig?: Config$1.ProjectConfig): string;
|
||||
//#endregion
|
||||
//#region src/getSnapshotStatus.d.ts
|
||||
declare function getSnapshotStatus(snapshot: TestResult$1['snapshot'], afterUpdate: boolean): Array<string>;
|
||||
//#endregion
|
||||
//#region src/getSnapshotSummary.d.ts
|
||||
declare function getSnapshotSummary(snapshots: SnapshotSummary$1, globalConfig: Config$1.GlobalConfig, updateCommand: string): Array<string>;
|
||||
//#endregion
|
||||
//#region src/types.d.ts
|
||||
type ReporterOnStartOptions = {
|
||||
estimatedTime: number;
|
||||
showStatus: boolean;
|
||||
};
|
||||
interface Reporter {
|
||||
readonly onTestResult?: (test: Test$1, testResult: TestResult$1, aggregatedResult: AggregatedResult$1) => Promise<void> | void;
|
||||
readonly onTestFileResult?: (test: Test$1, testResult: TestResult$1, aggregatedResult: AggregatedResult$1) => Promise<void> | void;
|
||||
/**
|
||||
* Called before running a spec (prior to `before` hooks)
|
||||
* Not called for `skipped` and `todo` specs
|
||||
*/
|
||||
readonly onTestCaseStart?: (test: Test$1, testCaseStartInfo: Circus.TestCaseStartInfo) => Promise<void> | void;
|
||||
readonly onTestCaseResult?: (test: Test$1, testCaseResult: TestCaseResult$1) => Promise<void> | void;
|
||||
readonly onRunStart?: (results: AggregatedResult$1, options: ReporterOnStartOptions) => Promise<void> | void;
|
||||
readonly onTestStart?: (test: Test$1) => Promise<void> | void;
|
||||
readonly onTestFileStart?: (test: Test$1) => Promise<void> | void;
|
||||
readonly onRunComplete?: (testContexts: Set<TestContext$1>, results: AggregatedResult$1) => Promise<void> | void;
|
||||
readonly getLastError?: () => Error | void;
|
||||
}
|
||||
type ReporterContext = {
|
||||
firstRun: boolean;
|
||||
previousSuccess: boolean;
|
||||
changedFiles?: Set<string>;
|
||||
sourcesRelatedToTestsInChangedFiles?: Set<string>;
|
||||
startRun?: (globalConfig: Config$1.GlobalConfig) => unknown;
|
||||
};
|
||||
type SummaryOptions = {
|
||||
currentTestCases?: Array<{
|
||||
test: Test$1;
|
||||
testCaseResult: TestCaseResult$1;
|
||||
}>;
|
||||
estimatedTime?: number;
|
||||
roundTime?: boolean;
|
||||
width?: number;
|
||||
showSeed?: boolean;
|
||||
seed?: number;
|
||||
};
|
||||
//#endregion
|
||||
//#region src/getSummary.d.ts
|
||||
declare function getSummary(aggregatedResults: AggregatedResult$1, options?: SummaryOptions): string;
|
||||
//#endregion
|
||||
//#region src/printDisplayName.d.ts
|
||||
declare function printDisplayName(config: Config$1.ProjectConfig): string;
|
||||
//#endregion
|
||||
//#region src/relativePath.d.ts
|
||||
declare function relativePath(config: Config$1.GlobalConfig | Config$1.ProjectConfig, testPath: string): {
|
||||
basename: string;
|
||||
dirname: string;
|
||||
};
|
||||
//#endregion
|
||||
//#region src/trimAndFormatPath.d.ts
|
||||
declare function trimAndFormatPath(pad: number, config: Config$1.ProjectConfig | Config$1.GlobalConfig, testPath: string, columns: number): string;
|
||||
//#endregion
|
||||
//#region src/BaseReporter.d.ts
|
||||
declare class BaseReporter implements Reporter {
|
||||
private _error?;
|
||||
log(message: string): void;
|
||||
onRunStart(_results?: AggregatedResult$1, _options?: ReporterOnStartOptions): void;
|
||||
onTestCaseResult(_test: Test$1, _testCaseResult: TestCaseResult$1): void;
|
||||
onTestResult(_test?: Test$1, _testResult?: TestResult$1, _results?: AggregatedResult$1): void;
|
||||
onTestStart(_test?: Test$1): void;
|
||||
onRunComplete(_testContexts?: Set<TestContext$1>, _aggregatedResults?: AggregatedResult$1): Promise<void> | void;
|
||||
protected _setError(error: Error): void;
|
||||
getLastError(): Error | undefined;
|
||||
protected __beginSynchronizedUpdate(write: WriteStream['write']): void;
|
||||
protected __endSynchronizedUpdate(write: WriteStream['write']): void;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/CoverageReporter.d.ts
|
||||
declare class CoverageReporter extends BaseReporter {
|
||||
private readonly _context;
|
||||
private readonly _coverageMap;
|
||||
private readonly _globalConfig;
|
||||
private readonly _sourceMapStore;
|
||||
private readonly _v8CoverageResults;
|
||||
static readonly filename: string;
|
||||
constructor(globalConfig: Config$1.GlobalConfig, context: ReporterContext);
|
||||
onTestResult(_test: Test$1, testResult: TestResult$1): void;
|
||||
onRunComplete(testContexts: Set<TestContext$1>, aggregatedResults: AggregatedResult$1): Promise<void>;
|
||||
private _addUntestedFiles;
|
||||
private _checkThreshold;
|
||||
private _getCoverageResult;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/DefaultReporter.d.ts
|
||||
declare class DefaultReporter extends BaseReporter {
|
||||
private _clear;
|
||||
private readonly _err;
|
||||
protected _globalConfig: Config$1.GlobalConfig;
|
||||
private readonly _out;
|
||||
private readonly _status;
|
||||
private readonly _bufferedOutput;
|
||||
static readonly filename: string;
|
||||
constructor(globalConfig: Config$1.GlobalConfig);
|
||||
protected __wrapStdio(stream: NodeJS.WritableStream | WriteStream): void;
|
||||
forceFlushBufferedOutput(): void;
|
||||
protected __clearStatus(): void;
|
||||
protected __printStatus(): void;
|
||||
onRunStart(aggregatedResults: AggregatedResult$1, options: ReporterOnStartOptions): void;
|
||||
onTestStart(test: Test$1): void;
|
||||
onTestCaseResult(test: Test$1, testCaseResult: TestCaseResult$1): void;
|
||||
onRunComplete(): void;
|
||||
onTestResult(test: Test$1, testResult: TestResult$1, aggregatedResults: AggregatedResult$1): void;
|
||||
testFinished(config: Config$1.ProjectConfig, testResult: TestResult$1, aggregatedResults: AggregatedResult$1): void;
|
||||
printTestFileHeader(testPath: string, config: Config$1.ProjectConfig, result: TestResult$1): void;
|
||||
printTestFileFailureMessage(_testPath: string, _config: Config$1.ProjectConfig, result: TestResult$1): void;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/GitHubActionsReporter.d.ts
|
||||
declare class GitHubActionsReporter extends BaseReporter {
|
||||
#private;
|
||||
static readonly filename: string;
|
||||
private readonly options;
|
||||
constructor(_globalConfig: Config$1.GlobalConfig, reporterOptions?: {
|
||||
silent?: boolean;
|
||||
});
|
||||
onTestResult(test: Test$1, testResult: TestResult$1, aggregatedResults: AggregatedResult$1): void;
|
||||
private generateAnnotations;
|
||||
private isLastTestSuite;
|
||||
private printFullResult;
|
||||
private arrayEqual;
|
||||
private arrayChild;
|
||||
private getResultTree;
|
||||
private getResultChildren;
|
||||
private printResultTree;
|
||||
private recursivePrintResultTree;
|
||||
private printFailedTestLogs;
|
||||
private startGroup;
|
||||
private endGroup;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/NotifyReporter.d.ts
|
||||
declare class NotifyReporter extends BaseReporter {
|
||||
private readonly _notifier;
|
||||
private readonly _globalConfig;
|
||||
private readonly _context;
|
||||
static readonly filename: string;
|
||||
constructor(globalConfig: Config$1.GlobalConfig, context: ReporterContext);
|
||||
onRunComplete(testContexts: Set<TestContext$1>, result: AggregatedResult$1): void;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/SummaryReporter.d.ts
|
||||
type SummaryReporterOptions = {
|
||||
summaryThreshold?: number;
|
||||
};
|
||||
declare class SummaryReporter extends BaseReporter {
|
||||
private _estimatedTime;
|
||||
private readonly _globalConfig;
|
||||
private readonly _summaryThreshold;
|
||||
static readonly filename: string;
|
||||
constructor(globalConfig: Config$1.GlobalConfig, options?: SummaryReporterOptions);
|
||||
private _validateOptions;
|
||||
private _write;
|
||||
onRunStart(aggregatedResults: AggregatedResult$1, options: ReporterOnStartOptions): void;
|
||||
onRunComplete(testContexts: Set<TestContext$1>, aggregatedResults: AggregatedResult$1): void;
|
||||
private _printSnapshotSummary;
|
||||
private _printSummary;
|
||||
private _getTestSummary;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/VerboseReporter.d.ts
|
||||
declare class VerboseReporter extends DefaultReporter {
|
||||
protected _globalConfig: Config$1.GlobalConfig;
|
||||
static readonly filename: string;
|
||||
constructor(globalConfig: Config$1.GlobalConfig);
|
||||
protected __wrapStdio(stream: NodeJS.WritableStream | WriteStream): void;
|
||||
static filterTestResults(testResults: Array<AssertionResult>): Array<AssertionResult>;
|
||||
static groupTestsBySuites(testResults: Array<AssertionResult>): Suite;
|
||||
onTestResult(test: Test$1, result: TestResult$1, aggregatedResults: AggregatedResult$1): void;
|
||||
private _logTestResults;
|
||||
private _logSuite;
|
||||
private _getIcon;
|
||||
private _logTest;
|
||||
private _logTests;
|
||||
private _logTodoOrPendingTest;
|
||||
private _logLine;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/index.d.ts
|
||||
declare const utils: {
|
||||
formatTestPath: typeof formatTestPath;
|
||||
getResultHeader: typeof getResultHeader;
|
||||
getSnapshotStatus: typeof getSnapshotStatus;
|
||||
getSnapshotSummary: typeof getSnapshotSummary;
|
||||
getSummary: typeof getSummary;
|
||||
printDisplayName: typeof printDisplayName;
|
||||
relativePath: typeof relativePath;
|
||||
trimAndFormatPath: typeof trimAndFormatPath;
|
||||
};
|
||||
//#endregion
|
||||
export { AggregatedResult, BaseReporter, Config, CoverageReporter, DefaultReporter, GitHubActionsReporter, NotifyReporter, Reporter, ReporterContext, ReporterOnStartOptions, SnapshotSummary, SummaryOptions, SummaryReporter, SummaryReporterOptions, Test, TestCaseResult, TestContext, TestResult, VerboseReporter, utils };
|
||||
324
frontend/node_modules/@jest/reporters/build/index.d.ts
generated
vendored
Normal file
324
frontend/node_modules/@jest/reporters/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,324 @@
|
||||
/**
|
||||
* 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 {WriteStream} from 'tty';
|
||||
import {
|
||||
AggregatedResult,
|
||||
AssertionResult,
|
||||
SnapshotSummary,
|
||||
Suite,
|
||||
Test,
|
||||
TestCaseResult,
|
||||
TestContext,
|
||||
TestResult,
|
||||
} from '@jest/test-result';
|
||||
import {Circus, Config} from '@jest/types';
|
||||
|
||||
export {AggregatedResult};
|
||||
|
||||
export declare class BaseReporter implements Reporter {
|
||||
private _error?;
|
||||
log(message: string): void;
|
||||
onRunStart(
|
||||
_results?: AggregatedResult,
|
||||
_options?: ReporterOnStartOptions,
|
||||
): void;
|
||||
onTestCaseResult(_test: Test, _testCaseResult: TestCaseResult): void;
|
||||
onTestResult(
|
||||
_test?: Test,
|
||||
_testResult?: TestResult,
|
||||
_results?: AggregatedResult,
|
||||
): void;
|
||||
onTestStart(_test?: Test): void;
|
||||
onRunComplete(
|
||||
_testContexts?: Set<TestContext>,
|
||||
_aggregatedResults?: AggregatedResult,
|
||||
): Promise<void> | void;
|
||||
protected _setError(error: Error): void;
|
||||
getLastError(): Error | undefined;
|
||||
protected __beginSynchronizedUpdate(write: WriteStream['write']): void;
|
||||
protected __endSynchronizedUpdate(write: WriteStream['write']): void;
|
||||
}
|
||||
|
||||
export {Config};
|
||||
|
||||
export declare class CoverageReporter extends BaseReporter {
|
||||
private readonly _context;
|
||||
private readonly _coverageMap;
|
||||
private readonly _globalConfig;
|
||||
private readonly _sourceMapStore;
|
||||
private readonly _v8CoverageResults;
|
||||
static readonly filename: string;
|
||||
constructor(globalConfig: Config.GlobalConfig, context: ReporterContext);
|
||||
onTestResult(_test: Test, testResult: TestResult): void;
|
||||
onRunComplete(
|
||||
testContexts: Set<TestContext>,
|
||||
aggregatedResults: AggregatedResult,
|
||||
): Promise<void>;
|
||||
private _addUntestedFiles;
|
||||
private _checkThreshold;
|
||||
private _getCoverageResult;
|
||||
}
|
||||
|
||||
export declare class DefaultReporter extends BaseReporter {
|
||||
private _clear;
|
||||
private readonly _err;
|
||||
protected _globalConfig: Config.GlobalConfig;
|
||||
private readonly _out;
|
||||
private readonly _status;
|
||||
private readonly _bufferedOutput;
|
||||
static readonly filename: string;
|
||||
constructor(globalConfig: Config.GlobalConfig);
|
||||
protected __wrapStdio(stream: NodeJS.WritableStream | WriteStream): void;
|
||||
forceFlushBufferedOutput(): void;
|
||||
protected __clearStatus(): void;
|
||||
protected __printStatus(): void;
|
||||
onRunStart(
|
||||
aggregatedResults: AggregatedResult,
|
||||
options: ReporterOnStartOptions,
|
||||
): void;
|
||||
onTestStart(test: Test): void;
|
||||
onTestCaseResult(test: Test, testCaseResult: TestCaseResult): void;
|
||||
onRunComplete(): void;
|
||||
onTestResult(
|
||||
test: Test,
|
||||
testResult: TestResult,
|
||||
aggregatedResults: AggregatedResult,
|
||||
): void;
|
||||
testFinished(
|
||||
config: Config.ProjectConfig,
|
||||
testResult: TestResult,
|
||||
aggregatedResults: AggregatedResult,
|
||||
): void;
|
||||
printTestFileHeader(
|
||||
testPath: string,
|
||||
config: Config.ProjectConfig,
|
||||
result: TestResult,
|
||||
): void;
|
||||
printTestFileFailureMessage(
|
||||
_testPath: string,
|
||||
_config: Config.ProjectConfig,
|
||||
result: TestResult,
|
||||
): void;
|
||||
}
|
||||
|
||||
declare function formatTestPath(
|
||||
config: Config.GlobalConfig | Config.ProjectConfig,
|
||||
testPath: string,
|
||||
): string;
|
||||
|
||||
declare function getResultHeader(
|
||||
result: TestResult,
|
||||
globalConfig: Config.GlobalConfig,
|
||||
projectConfig?: Config.ProjectConfig,
|
||||
): string;
|
||||
|
||||
declare function getSnapshotStatus(
|
||||
snapshot: TestResult['snapshot'],
|
||||
afterUpdate: boolean,
|
||||
): Array<string>;
|
||||
|
||||
declare function getSnapshotSummary(
|
||||
snapshots: SnapshotSummary,
|
||||
globalConfig: Config.GlobalConfig,
|
||||
updateCommand: string,
|
||||
): Array<string>;
|
||||
|
||||
declare function getSummary(
|
||||
aggregatedResults: AggregatedResult,
|
||||
options?: SummaryOptions,
|
||||
): string;
|
||||
|
||||
export declare class GitHubActionsReporter extends BaseReporter {
|
||||
#private;
|
||||
static readonly filename: string;
|
||||
private readonly options;
|
||||
constructor(
|
||||
_globalConfig: Config.GlobalConfig,
|
||||
reporterOptions?: {
|
||||
silent?: boolean;
|
||||
},
|
||||
);
|
||||
onTestResult(
|
||||
test: Test,
|
||||
testResult: TestResult,
|
||||
aggregatedResults: AggregatedResult,
|
||||
): void;
|
||||
private generateAnnotations;
|
||||
private isLastTestSuite;
|
||||
private printFullResult;
|
||||
private arrayEqual;
|
||||
private arrayChild;
|
||||
private getResultTree;
|
||||
private getResultChildren;
|
||||
private printResultTree;
|
||||
private recursivePrintResultTree;
|
||||
private printFailedTestLogs;
|
||||
private startGroup;
|
||||
private endGroup;
|
||||
}
|
||||
|
||||
export declare class NotifyReporter extends BaseReporter {
|
||||
private readonly _notifier;
|
||||
private readonly _globalConfig;
|
||||
private readonly _context;
|
||||
static readonly filename: string;
|
||||
constructor(globalConfig: Config.GlobalConfig, context: ReporterContext);
|
||||
onRunComplete(testContexts: Set<TestContext>, result: AggregatedResult): void;
|
||||
}
|
||||
|
||||
declare function printDisplayName(config: Config.ProjectConfig): string;
|
||||
|
||||
declare function relativePath(
|
||||
config: Config.GlobalConfig | Config.ProjectConfig,
|
||||
testPath: string,
|
||||
): {
|
||||
basename: string;
|
||||
dirname: string;
|
||||
};
|
||||
|
||||
export declare interface Reporter {
|
||||
readonly onTestResult?: (
|
||||
test: Test,
|
||||
testResult: TestResult,
|
||||
aggregatedResult: AggregatedResult,
|
||||
) => Promise<void> | void;
|
||||
readonly onTestFileResult?: (
|
||||
test: Test,
|
||||
testResult: TestResult,
|
||||
aggregatedResult: AggregatedResult,
|
||||
) => Promise<void> | void;
|
||||
/**
|
||||
* Called before running a spec (prior to `before` hooks)
|
||||
* Not called for `skipped` and `todo` specs
|
||||
*/
|
||||
readonly onTestCaseStart?: (
|
||||
test: Test,
|
||||
testCaseStartInfo: Circus.TestCaseStartInfo,
|
||||
) => Promise<void> | void;
|
||||
readonly onTestCaseResult?: (
|
||||
test: Test,
|
||||
testCaseResult: TestCaseResult,
|
||||
) => Promise<void> | void;
|
||||
readonly onRunStart?: (
|
||||
results: AggregatedResult,
|
||||
options: ReporterOnStartOptions,
|
||||
) => Promise<void> | void;
|
||||
readonly onTestStart?: (test: Test) => Promise<void> | void;
|
||||
readonly onTestFileStart?: (test: Test) => Promise<void> | void;
|
||||
readonly onRunComplete?: (
|
||||
testContexts: Set<TestContext>,
|
||||
results: AggregatedResult,
|
||||
) => Promise<void> | void;
|
||||
readonly getLastError?: () => Error | void;
|
||||
}
|
||||
|
||||
export declare type ReporterContext = {
|
||||
firstRun: boolean;
|
||||
previousSuccess: boolean;
|
||||
changedFiles?: Set<string>;
|
||||
sourcesRelatedToTestsInChangedFiles?: Set<string>;
|
||||
startRun?: (globalConfig: Config.GlobalConfig) => unknown;
|
||||
};
|
||||
|
||||
export declare type ReporterOnStartOptions = {
|
||||
estimatedTime: number;
|
||||
showStatus: boolean;
|
||||
};
|
||||
|
||||
export {SnapshotSummary};
|
||||
|
||||
export declare type SummaryOptions = {
|
||||
currentTestCases?: Array<{
|
||||
test: Test;
|
||||
testCaseResult: TestCaseResult;
|
||||
}>;
|
||||
estimatedTime?: number;
|
||||
roundTime?: boolean;
|
||||
width?: number;
|
||||
showSeed?: boolean;
|
||||
seed?: number;
|
||||
};
|
||||
|
||||
export declare class SummaryReporter extends BaseReporter {
|
||||
private _estimatedTime;
|
||||
private readonly _globalConfig;
|
||||
private readonly _summaryThreshold;
|
||||
static readonly filename: string;
|
||||
constructor(
|
||||
globalConfig: Config.GlobalConfig,
|
||||
options?: SummaryReporterOptions,
|
||||
);
|
||||
private _validateOptions;
|
||||
private _write;
|
||||
onRunStart(
|
||||
aggregatedResults: AggregatedResult,
|
||||
options: ReporterOnStartOptions,
|
||||
): void;
|
||||
onRunComplete(
|
||||
testContexts: Set<TestContext>,
|
||||
aggregatedResults: AggregatedResult,
|
||||
): void;
|
||||
private _printSnapshotSummary;
|
||||
private _printSummary;
|
||||
private _getTestSummary;
|
||||
}
|
||||
|
||||
export declare type SummaryReporterOptions = {
|
||||
summaryThreshold?: number;
|
||||
};
|
||||
|
||||
export {Test};
|
||||
|
||||
export {TestCaseResult};
|
||||
|
||||
export {TestContext};
|
||||
|
||||
export {TestResult};
|
||||
|
||||
declare function trimAndFormatPath(
|
||||
pad: number,
|
||||
config: Config.ProjectConfig | Config.GlobalConfig,
|
||||
testPath: string,
|
||||
columns: number,
|
||||
): string;
|
||||
|
||||
export declare const utils: {
|
||||
formatTestPath: typeof formatTestPath;
|
||||
getResultHeader: typeof getResultHeader;
|
||||
getSnapshotStatus: typeof getSnapshotStatus;
|
||||
getSnapshotSummary: typeof getSnapshotSummary;
|
||||
getSummary: typeof getSummary;
|
||||
printDisplayName: typeof printDisplayName;
|
||||
relativePath: typeof relativePath;
|
||||
trimAndFormatPath: typeof trimAndFormatPath;
|
||||
};
|
||||
|
||||
export declare class VerboseReporter extends DefaultReporter {
|
||||
protected _globalConfig: Config.GlobalConfig;
|
||||
static readonly filename: string;
|
||||
constructor(globalConfig: Config.GlobalConfig);
|
||||
protected __wrapStdio(stream: NodeJS.WritableStream | WriteStream): void;
|
||||
static filterTestResults(
|
||||
testResults: Array<AssertionResult>,
|
||||
): Array<AssertionResult>;
|
||||
static groupTestsBySuites(testResults: Array<AssertionResult>): Suite;
|
||||
onTestResult(
|
||||
test: Test,
|
||||
result: TestResult,
|
||||
aggregatedResults: AggregatedResult,
|
||||
): void;
|
||||
private _logTestResults;
|
||||
private _logSuite;
|
||||
private _getIcon;
|
||||
private _logTest;
|
||||
private _logTests;
|
||||
private _logTodoOrPendingTest;
|
||||
private _logLine;
|
||||
}
|
||||
|
||||
export {};
|
||||
2528
frontend/node_modules/@jest/reporters/build/index.js
generated
vendored
Normal file
2528
frontend/node_modules/@jest/reporters/build/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
frontend/node_modules/@jest/reporters/build/index.mjs
generated
vendored
Normal file
10
frontend/node_modules/@jest/reporters/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const BaseReporter = cjsModule.BaseReporter;
|
||||
export const CoverageReporter = cjsModule.CoverageReporter;
|
||||
export const DefaultReporter = cjsModule.DefaultReporter;
|
||||
export const GitHubActionsReporter = cjsModule.GitHubActionsReporter;
|
||||
export const NotifyReporter = cjsModule.NotifyReporter;
|
||||
export const SummaryReporter = cjsModule.SummaryReporter;
|
||||
export const VerboseReporter = cjsModule.VerboseReporter;
|
||||
export const utils = cjsModule.utils;
|
||||
1
frontend/node_modules/@jest/reporters/node_modules/.bin/glob
generated
vendored
Symbolic link
1
frontend/node_modules/@jest/reporters/node_modules/.bin/glob
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../glob/dist/esm/bin.mjs
|
||||
15
frontend/node_modules/@jest/reporters/node_modules/glob/LICENSE
generated
vendored
Normal file
15
frontend/node_modules/@jest/reporters/node_modules/glob/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) 2009-2023 Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
1265
frontend/node_modules/@jest/reporters/node_modules/glob/README.md
generated
vendored
Normal file
1265
frontend/node_modules/@jest/reporters/node_modules/glob/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
388
frontend/node_modules/@jest/reporters/node_modules/glob/dist/commonjs/glob.d.ts
generated
vendored
Normal file
388
frontend/node_modules/@jest/reporters/node_modules/glob/dist/commonjs/glob.d.ts
generated
vendored
Normal file
@@ -0,0 +1,388 @@
|
||||
import { Minimatch } from 'minimatch';
|
||||
import { Minipass } from 'minipass';
|
||||
import { FSOption, Path, PathScurry } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
export type MatchSet = Minimatch['set'];
|
||||
export type GlobParts = Exclude<Minimatch['globParts'], undefined>;
|
||||
/**
|
||||
* A `GlobOptions` object may be provided to any of the exported methods, and
|
||||
* must be provided to the `Glob` constructor.
|
||||
*
|
||||
* All options are optional, boolean, and false by default, unless otherwise
|
||||
* noted.
|
||||
*
|
||||
* All resolved options are added to the Glob object as properties.
|
||||
*
|
||||
* If you are running many `glob` operations, you can pass a Glob object as the
|
||||
* `options` argument to a subsequent operation to share the previously loaded
|
||||
* cache.
|
||||
*/
|
||||
export interface GlobOptions {
|
||||
/**
|
||||
* Set to `true` to always receive absolute paths for
|
||||
* matched files. Set to `false` to always return relative paths.
|
||||
*
|
||||
* When this option is not set, absolute paths are returned for patterns
|
||||
* that are absolute, and otherwise paths are returned that are relative
|
||||
* to the `cwd` setting.
|
||||
*
|
||||
* This does _not_ make an extra system call to get
|
||||
* the realpath, it only does string path resolution.
|
||||
*
|
||||
* Conflicts with {@link withFileTypes}
|
||||
*/
|
||||
absolute?: boolean;
|
||||
/**
|
||||
* Set to false to enable {@link windowsPathsNoEscape}
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
allowWindowsEscape?: boolean;
|
||||
/**
|
||||
* The current working directory in which to search. Defaults to
|
||||
* `process.cwd()`.
|
||||
*
|
||||
* May be eiher a string path or a `file://` URL object or string.
|
||||
*/
|
||||
cwd?: string | URL;
|
||||
/**
|
||||
* Include `.dot` files in normal matches and `globstar`
|
||||
* matches. Note that an explicit dot in a portion of the pattern
|
||||
* will always match dot files.
|
||||
*/
|
||||
dot?: boolean;
|
||||
/**
|
||||
* Prepend all relative path strings with `./` (or `.\` on Windows).
|
||||
*
|
||||
* Without this option, returned relative paths are "bare", so instead of
|
||||
* returning `'./foo/bar'`, they are returned as `'foo/bar'`.
|
||||
*
|
||||
* Relative patterns starting with `'../'` are not prepended with `./`, even
|
||||
* if this option is set.
|
||||
*/
|
||||
dotRelative?: boolean;
|
||||
/**
|
||||
* Follow symlinked directories when expanding `**`
|
||||
* patterns. This can result in a lot of duplicate references in
|
||||
* the presence of cyclic links, and make performance quite bad.
|
||||
*
|
||||
* By default, a `**` in a pattern will follow 1 symbolic link if
|
||||
* it is not the first item in the pattern, or none if it is the
|
||||
* first item in the pattern, following the same behavior as Bash.
|
||||
*/
|
||||
follow?: boolean;
|
||||
/**
|
||||
* string or string[], or an object with `ignore` and `ignoreChildren`
|
||||
* methods.
|
||||
*
|
||||
* If a string or string[] is provided, then this is treated as a glob
|
||||
* pattern or array of glob patterns to exclude from matches. To ignore all
|
||||
* children within a directory, as well as the entry itself, append `'/**'`
|
||||
* to the ignore pattern.
|
||||
*
|
||||
* **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of
|
||||
* any other settings.
|
||||
*
|
||||
* If an object is provided that has `ignored(path)` and/or
|
||||
* `childrenIgnored(path)` methods, then these methods will be called to
|
||||
* determine whether any Path is a match or if its children should be
|
||||
* traversed, respectively.
|
||||
*/
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
/**
|
||||
* Treat brace expansion like `{a,b}` as a "magic" pattern. Has no
|
||||
* effect if {@link nobrace} is set.
|
||||
*
|
||||
* Only has effect on the {@link hasMagic} function.
|
||||
*/
|
||||
magicalBraces?: boolean;
|
||||
/**
|
||||
* Add a `/` character to directory matches. Note that this requires
|
||||
* additional stat calls in some cases.
|
||||
*/
|
||||
mark?: boolean;
|
||||
/**
|
||||
* Perform a basename-only match if the pattern does not contain any slash
|
||||
* characters. That is, `*.js` would be treated as equivalent to
|
||||
* `**\/*.js`, matching all js files in all directories.
|
||||
*/
|
||||
matchBase?: boolean;
|
||||
/**
|
||||
* Limit the directory traversal to a given depth below the cwd.
|
||||
* Note that this does NOT prevent traversal to sibling folders,
|
||||
* root patterns, and so on. It only limits the maximum folder depth
|
||||
* that the walk will descend, relative to the cwd.
|
||||
*/
|
||||
maxDepth?: number;
|
||||
/**
|
||||
* Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||
*/
|
||||
nobrace?: boolean;
|
||||
/**
|
||||
* Perform a case-insensitive match. This defaults to `true` on macOS and
|
||||
* Windows systems, and `false` on all others.
|
||||
*
|
||||
* **Note** `nocase` should only be explicitly set when it is
|
||||
* known that the filesystem's case sensitivity differs from the
|
||||
* platform default. If set `true` on case-sensitive file
|
||||
* systems, or `false` on case-insensitive file systems, then the
|
||||
* walk may return more or less results than expected.
|
||||
*/
|
||||
nocase?: boolean;
|
||||
/**
|
||||
* Do not match directories, only files. (Note: to match
|
||||
* _only_ directories, put a `/` at the end of the pattern.)
|
||||
*/
|
||||
nodir?: boolean;
|
||||
/**
|
||||
* Do not match "extglob" patterns such as `+(a|b)`.
|
||||
*/
|
||||
noext?: boolean;
|
||||
/**
|
||||
* Do not match `**` against multiple filenames. (Ie, treat it as a normal
|
||||
* `*` instead.)
|
||||
*
|
||||
* Conflicts with {@link matchBase}
|
||||
*/
|
||||
noglobstar?: boolean;
|
||||
/**
|
||||
* Defaults to value of `process.platform` if available, or `'linux'` if
|
||||
* not. Setting `platform:'win32'` on non-Windows systems may cause strange
|
||||
* behavior.
|
||||
*/
|
||||
platform?: NodeJS.Platform;
|
||||
/**
|
||||
* Set to true to call `fs.realpath` on all of the
|
||||
* results. In the case of an entry that cannot be resolved, the
|
||||
* entry is omitted. This incurs a slight performance penalty, of
|
||||
* course, because of the added system calls.
|
||||
*/
|
||||
realpath?: boolean;
|
||||
/**
|
||||
*
|
||||
* A string path resolved against the `cwd` option, which
|
||||
* is used as the starting point for absolute patterns that start
|
||||
* with `/`, (but not drive letters or UNC paths on Windows).
|
||||
*
|
||||
* Note that this _doesn't_ necessarily limit the walk to the
|
||||
* `root` directory, and doesn't affect the cwd starting point for
|
||||
* non-absolute patterns. A pattern containing `..` will still be
|
||||
* able to traverse out of the root directory, if it is not an
|
||||
* actual root directory on the filesystem, and any non-absolute
|
||||
* patterns will be matched in the `cwd`. For example, the
|
||||
* pattern `/../*` with `{root:'/some/path'}` will return all
|
||||
* files in `/some`, not all files in `/some/path`. The pattern
|
||||
* `*` with `{root:'/some/path'}` will return all the entries in
|
||||
* the cwd, not the entries in `/some/path`.
|
||||
*
|
||||
* To start absolute and non-absolute patterns in the same
|
||||
* path, you can use `{root:''}`. However, be aware that on
|
||||
* Windows systems, a pattern like `x:/*` or `//host/share/*` will
|
||||
* _always_ start in the `x:/` or `//host/share` directory,
|
||||
* regardless of the `root` setting.
|
||||
*/
|
||||
root?: string;
|
||||
/**
|
||||
* A [PathScurry](http://npm.im/path-scurry) object used
|
||||
* to traverse the file system. If the `nocase` option is set
|
||||
* explicitly, then any provided `scurry` object must match this
|
||||
* setting.
|
||||
*/
|
||||
scurry?: PathScurry;
|
||||
/**
|
||||
* Call `lstat()` on all entries, whether required or not to determine
|
||||
* if it's a valid match. When used with {@link withFileTypes}, this means
|
||||
* that matches will include data such as modified time, permissions, and
|
||||
* so on. Note that this will incur a performance cost due to the added
|
||||
* system calls.
|
||||
*/
|
||||
stat?: boolean;
|
||||
/**
|
||||
* An AbortSignal which will cancel the Glob walk when
|
||||
* triggered.
|
||||
*/
|
||||
signal?: AbortSignal;
|
||||
/**
|
||||
* Use `\\` as a path separator _only_, and
|
||||
* _never_ as an escape character. If set, all `\\` characters are
|
||||
* replaced with `/` in the pattern.
|
||||
*
|
||||
* Note that this makes it **impossible** to match against paths
|
||||
* containing literal glob pattern characters, but allows matching
|
||||
* with patterns constructed using `path.join()` and
|
||||
* `path.resolve()` on Windows platforms, mimicking the (buggy!)
|
||||
* behavior of Glob v7 and before on Windows. Please use with
|
||||
* caution, and be mindful of [the caveat below about Windows
|
||||
* paths](#windows). (For legacy reasons, this is also set if
|
||||
* `allowWindowsEscape` is set to the exact value `false`.)
|
||||
*/
|
||||
windowsPathsNoEscape?: boolean;
|
||||
/**
|
||||
* Return [PathScurry](http://npm.im/path-scurry)
|
||||
* `Path` objects instead of strings. These are similar to a
|
||||
* NodeJS `Dirent` object, but with additional methods and
|
||||
* properties.
|
||||
*
|
||||
* Conflicts with {@link absolute}
|
||||
*/
|
||||
withFileTypes?: boolean;
|
||||
/**
|
||||
* An fs implementation to override some or all of the defaults. See
|
||||
* http://npm.im/path-scurry for details about what can be overridden.
|
||||
*/
|
||||
fs?: FSOption;
|
||||
/**
|
||||
* Just passed along to Minimatch. Note that this makes all pattern
|
||||
* matching operations slower and *extremely* noisy.
|
||||
*/
|
||||
debug?: boolean;
|
||||
/**
|
||||
* Return `/` delimited paths, even on Windows.
|
||||
*
|
||||
* On posix systems, this has no effect. But, on Windows, it means that
|
||||
* paths will be `/` delimited, and absolute paths will be their full
|
||||
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return
|
||||
* `'//?/C:/foo/bar'`
|
||||
*/
|
||||
posix?: boolean;
|
||||
/**
|
||||
* Do not match any children of any matches. For example, the pattern
|
||||
* `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.
|
||||
*
|
||||
* This is especially useful for cases like "find all `node_modules`
|
||||
* folders, but not the ones in `node_modules`".
|
||||
*
|
||||
* In order to support this, the `Ignore` implementation must support an
|
||||
* `add(pattern: string)` method. If using the default `Ignore` class, then
|
||||
* this is fine, but if this is set to `false`, and a custom `Ignore` is
|
||||
* provided that does not have an `add()` method, then it will throw an
|
||||
* error.
|
||||
*
|
||||
* **Caveat** It *only* ignores matches that would be a descendant of a
|
||||
* previous match, and only if that descendant is matched *after* the
|
||||
* ancestor is encountered. Since the file system walk happens in
|
||||
* indeterminate order, it's possible that a match will already be added
|
||||
* before its ancestor, if multiple or braced patterns are used.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* ```ts
|
||||
* const results = await glob([
|
||||
* // likely to match first, since it's just a stat
|
||||
* 'a/b/c/d/e/f',
|
||||
*
|
||||
* // this pattern is more complicated! It must to various readdir()
|
||||
* // calls and test the results against a regular expression, and that
|
||||
* // is certainly going to take a little bit longer.
|
||||
* //
|
||||
* // So, later on, it encounters a match at 'a/b/c/d/e', but it's too
|
||||
* // late to ignore a/b/c/d/e/f, because it's already been emitted.
|
||||
* 'a/[bdf]/?/[a-z]/*',
|
||||
* ], { includeChildMatches: false })
|
||||
* ```
|
||||
*
|
||||
* It's best to only set this to `false` if you can be reasonably sure that
|
||||
* no components of the pattern will potentially match one another's file
|
||||
* system descendants, or if the occasional included child entry will not
|
||||
* cause problems.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
includeChildMatches?: boolean;
|
||||
}
|
||||
export type GlobOptionsWithFileTypesTrue = GlobOptions & {
|
||||
withFileTypes: true;
|
||||
absolute?: undefined;
|
||||
mark?: undefined;
|
||||
posix?: undefined;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesFalse = GlobOptions & {
|
||||
withFileTypes?: false;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesUnset = GlobOptions & {
|
||||
withFileTypes?: undefined;
|
||||
};
|
||||
export type Result<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path;
|
||||
export type Results<Opts> = Result<Opts>[];
|
||||
export type FileTypes<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean;
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
*/
|
||||
export declare class Glob<Opts extends GlobOptions> implements GlobOptions {
|
||||
absolute?: boolean;
|
||||
cwd: string;
|
||||
root?: string;
|
||||
dot: boolean;
|
||||
dotRelative: boolean;
|
||||
follow: boolean;
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
magicalBraces: boolean;
|
||||
mark?: boolean;
|
||||
matchBase: boolean;
|
||||
maxDepth: number;
|
||||
nobrace: boolean;
|
||||
nocase: boolean;
|
||||
nodir: boolean;
|
||||
noext: boolean;
|
||||
noglobstar: boolean;
|
||||
pattern: string[];
|
||||
platform: NodeJS.Platform;
|
||||
realpath: boolean;
|
||||
scurry: PathScurry;
|
||||
stat: boolean;
|
||||
signal?: AbortSignal;
|
||||
windowsPathsNoEscape: boolean;
|
||||
withFileTypes: FileTypes<Opts>;
|
||||
includeChildMatches: boolean;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
opts: Opts;
|
||||
/**
|
||||
* An array of parsed immutable {@link Pattern} objects.
|
||||
*/
|
||||
patterns: Pattern[];
|
||||
/**
|
||||
* All options are stored as properties on the `Glob` object.
|
||||
*
|
||||
* See {@link GlobOptions} for full options descriptions.
|
||||
*
|
||||
* Note that a previous `Glob` object can be passed as the
|
||||
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
* and caches with a new pattern.
|
||||
*
|
||||
* Traversal functions can be called multiple times to run the walk
|
||||
* again.
|
||||
*/
|
||||
constructor(pattern: string | string[], opts: Opts);
|
||||
/**
|
||||
* Returns a Promise that resolves to the results array.
|
||||
*/
|
||||
walk(): Promise<Results<Opts>>;
|
||||
/**
|
||||
* synchronous {@link Glob.walk}
|
||||
*/
|
||||
walkSync(): Results<Opts>;
|
||||
/**
|
||||
* Stream results asynchronously.
|
||||
*/
|
||||
stream(): Minipass<Result<Opts>, Result<Opts>>;
|
||||
/**
|
||||
* Stream results synchronously.
|
||||
*/
|
||||
streamSync(): Minipass<Result<Opts>, Result<Opts>>;
|
||||
/**
|
||||
* Default sync iteration function. Returns a Generator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterateSync(): Generator<Result<Opts>, void, void>;
|
||||
[Symbol.iterator](): Generator<Result<Opts>, void, void>;
|
||||
/**
|
||||
* Default async iteration function. Returns an AsyncGenerator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterate(): AsyncGenerator<Result<Opts>, void, void>;
|
||||
[Symbol.asyncIterator](): AsyncGenerator<Result<Opts>, void, void>;
|
||||
}
|
||||
//# sourceMappingURL=glob.d.ts.map
|
||||
1
frontend/node_modules/@jest/reporters/node_modules/glob/dist/commonjs/glob.d.ts.map
generated
vendored
Normal file
1
frontend/node_modules/@jest/reporters/node_modules/glob/dist/commonjs/glob.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAA;AAalE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAE5B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAElB;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IAEvC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IAE1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IAEnB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IAEpB;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAE9B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;OAGG;IACH,EAAE,CAAC,EAAE,QAAQ,CAAA;IAEb;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,MAAM,MAAM,4BAA4B,GAAG,WAAW,GAAG;IACvD,aAAa,EAAE,IAAI,CAAA;IAEnB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,WAAW,GAAG;IACxD,aAAa,CAAC,EAAE,KAAK,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,WAAW,GAAG;IACxD,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,MAAM,CAAC,IAAI,IACrB,IAAI,SAAS,4BAA4B,GAAG,IAAI,GAC9C,IAAI,SAAS,6BAA6B,GAAG,MAAM,GACnD,IAAI,SAAS,6BAA6B,GAAG,MAAM,GACnD,MAAM,GAAG,IAAI,CAAA;AACjB,MAAM,MAAM,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAA;AAE1C,MAAM,MAAM,SAAS,CAAC,IAAI,IACxB,IAAI,SAAS,4BAA4B,GAAG,IAAI,GAC9C,IAAI,SAAS,6BAA6B,GAAG,KAAK,GAClD,IAAI,SAAS,6BAA6B,GAAG,KAAK,GAClD,OAAO,CAAA;AAEX;;GAEG;AACH,qBAAa,IAAI,CAAC,IAAI,SAAS,WAAW,CAAE,YAAW,WAAW;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,OAAO,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IACvC,aAAa,EAAE,OAAO,CAAA;IACtB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,UAAU,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;IAC9B,mBAAmB,EAAE,OAAO,CAAA;IAE5B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;IAEV;;OAEG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAA;IAEnB;;;;;;;;;;;OAWG;gBACS,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI;IA2HlD;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAoBpC;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBzB;;OAEG;IACH,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAc9C;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAclD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"}
|
||||
247
frontend/node_modules/@jest/reporters/node_modules/glob/dist/commonjs/glob.js
generated
vendored
Normal file
247
frontend/node_modules/@jest/reporters/node_modules/glob/dist/commonjs/glob.js
generated
vendored
Normal file
@@ -0,0 +1,247 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Glob = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const node_url_1 = require("node:url");
|
||||
const path_scurry_1 = require("path-scurry");
|
||||
const pattern_js_1 = require("./pattern.js");
|
||||
const walker_js_1 = require("./walker.js");
|
||||
// if no process global, just call it linux.
|
||||
// so we default to case-sensitive, / separators
|
||||
const defaultPlatform = (typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string') ?
|
||||
process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
*/
|
||||
class Glob {
|
||||
absolute;
|
||||
cwd;
|
||||
root;
|
||||
dot;
|
||||
dotRelative;
|
||||
follow;
|
||||
ignore;
|
||||
magicalBraces;
|
||||
mark;
|
||||
matchBase;
|
||||
maxDepth;
|
||||
nobrace;
|
||||
nocase;
|
||||
nodir;
|
||||
noext;
|
||||
noglobstar;
|
||||
pattern;
|
||||
platform;
|
||||
realpath;
|
||||
scurry;
|
||||
stat;
|
||||
signal;
|
||||
windowsPathsNoEscape;
|
||||
withFileTypes;
|
||||
includeChildMatches;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
opts;
|
||||
/**
|
||||
* An array of parsed immutable {@link Pattern} objects.
|
||||
*/
|
||||
patterns;
|
||||
/**
|
||||
* All options are stored as properties on the `Glob` object.
|
||||
*
|
||||
* See {@link GlobOptions} for full options descriptions.
|
||||
*
|
||||
* Note that a previous `Glob` object can be passed as the
|
||||
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
* and caches with a new pattern.
|
||||
*
|
||||
* Traversal functions can be called multiple times to run the walk
|
||||
* again.
|
||||
*/
|
||||
constructor(pattern, opts) {
|
||||
/* c8 ignore start */
|
||||
if (!opts)
|
||||
throw new TypeError('glob options required');
|
||||
/* c8 ignore stop */
|
||||
this.withFileTypes = !!opts.withFileTypes;
|
||||
this.signal = opts.signal;
|
||||
this.follow = !!opts.follow;
|
||||
this.dot = !!opts.dot;
|
||||
this.dotRelative = !!opts.dotRelative;
|
||||
this.nodir = !!opts.nodir;
|
||||
this.mark = !!opts.mark;
|
||||
if (!opts.cwd) {
|
||||
this.cwd = '';
|
||||
}
|
||||
else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
|
||||
opts.cwd = (0, node_url_1.fileURLToPath)(opts.cwd);
|
||||
}
|
||||
this.cwd = opts.cwd || '';
|
||||
this.root = opts.root;
|
||||
this.magicalBraces = !!opts.magicalBraces;
|
||||
this.nobrace = !!opts.nobrace;
|
||||
this.noext = !!opts.noext;
|
||||
this.realpath = !!opts.realpath;
|
||||
this.absolute = opts.absolute;
|
||||
this.includeChildMatches = opts.includeChildMatches !== false;
|
||||
this.noglobstar = !!opts.noglobstar;
|
||||
this.matchBase = !!opts.matchBase;
|
||||
this.maxDepth =
|
||||
typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
|
||||
this.stat = !!opts.stat;
|
||||
this.ignore = opts.ignore;
|
||||
if (this.withFileTypes && this.absolute !== undefined) {
|
||||
throw new Error('cannot set absolute and withFileTypes:true');
|
||||
}
|
||||
if (typeof pattern === 'string') {
|
||||
pattern = [pattern];
|
||||
}
|
||||
this.windowsPathsNoEscape =
|
||||
!!opts.windowsPathsNoEscape ||
|
||||
opts.allowWindowsEscape ===
|
||||
false;
|
||||
if (this.windowsPathsNoEscape) {
|
||||
pattern = pattern.map(p => p.replace(/\\/g, '/'));
|
||||
}
|
||||
if (this.matchBase) {
|
||||
if (opts.noglobstar) {
|
||||
throw new TypeError('base matching requires globstar');
|
||||
}
|
||||
pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
|
||||
}
|
||||
this.pattern = pattern;
|
||||
this.platform = opts.platform || defaultPlatform;
|
||||
this.opts = { ...opts, platform: this.platform };
|
||||
if (opts.scurry) {
|
||||
this.scurry = opts.scurry;
|
||||
if (opts.nocase !== undefined &&
|
||||
opts.nocase !== opts.scurry.nocase) {
|
||||
throw new Error('nocase option contradicts provided scurry option');
|
||||
}
|
||||
}
|
||||
else {
|
||||
const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32
|
||||
: opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin
|
||||
: opts.platform ? path_scurry_1.PathScurryPosix
|
||||
: path_scurry_1.PathScurry;
|
||||
this.scurry = new Scurry(this.cwd, {
|
||||
nocase: opts.nocase,
|
||||
fs: opts.fs,
|
||||
});
|
||||
}
|
||||
this.nocase = this.scurry.nocase;
|
||||
// If you do nocase:true on a case-sensitive file system, then
|
||||
// we need to use regexps instead of strings for non-magic
|
||||
// path portions, because statting `aBc` won't return results
|
||||
// for the file `AbC` for example.
|
||||
const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';
|
||||
const mmo = {
|
||||
// default nocase based on platform
|
||||
...opts,
|
||||
dot: this.dot,
|
||||
matchBase: this.matchBase,
|
||||
nobrace: this.nobrace,
|
||||
nocase: this.nocase,
|
||||
nocaseMagicOnly,
|
||||
nocomment: true,
|
||||
noext: this.noext,
|
||||
nonegate: true,
|
||||
optimizationLevel: 2,
|
||||
platform: this.platform,
|
||||
windowsPathsNoEscape: this.windowsPathsNoEscape,
|
||||
debug: !!this.opts.debug,
|
||||
};
|
||||
const mms = this.pattern.map(p => new minimatch_1.Minimatch(p, mmo));
|
||||
const [matchSet, globParts] = mms.reduce((set, m) => {
|
||||
set[0].push(...m.set);
|
||||
set[1].push(...m.globParts);
|
||||
return set;
|
||||
}, [[], []]);
|
||||
this.patterns = matchSet.map((set, i) => {
|
||||
const g = globParts[i];
|
||||
/* c8 ignore start */
|
||||
if (!g)
|
||||
throw new Error('invalid pattern object');
|
||||
/* c8 ignore stop */
|
||||
return new pattern_js_1.Pattern(set, g, 0, this.platform);
|
||||
});
|
||||
}
|
||||
async walk() {
|
||||
// Walkers always return array of Path objects, so we just have to
|
||||
// coerce them into the right shape. It will have already called
|
||||
// realpath() if the option was set to do so, so we know that's cached.
|
||||
// start out knowing the cwd, at least
|
||||
return [
|
||||
...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).walk()),
|
||||
];
|
||||
}
|
||||
walkSync() {
|
||||
return [
|
||||
...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).walkSync(),
|
||||
];
|
||||
}
|
||||
stream() {
|
||||
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).stream();
|
||||
}
|
||||
streamSync() {
|
||||
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).streamSync();
|
||||
}
|
||||
/**
|
||||
* Default sync iteration function. Returns a Generator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterateSync() {
|
||||
return this.streamSync()[Symbol.iterator]();
|
||||
}
|
||||
[Symbol.iterator]() {
|
||||
return this.iterateSync();
|
||||
}
|
||||
/**
|
||||
* Default async iteration function. Returns an AsyncGenerator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterate() {
|
||||
return this.stream()[Symbol.asyncIterator]();
|
||||
}
|
||||
[Symbol.asyncIterator]() {
|
||||
return this.iterate();
|
||||
}
|
||||
}
|
||||
exports.Glob = Glob;
|
||||
//# sourceMappingURL=glob.js.map
|
||||
1
frontend/node_modules/@jest/reporters/node_modules/glob/dist/commonjs/glob.js.map
generated
vendored
Normal file
1
frontend/node_modules/@jest/reporters/node_modules/glob/dist/commonjs/glob.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
14
frontend/node_modules/@jest/reporters/node_modules/glob/dist/commonjs/has-magic.d.ts
generated
vendored
Normal file
14
frontend/node_modules/@jest/reporters/node_modules/glob/dist/commonjs/has-magic.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { GlobOptions } from './glob.js';
|
||||
/**
|
||||
* Return true if the patterns provided contain any magic glob characters,
|
||||
* given the options provided.
|
||||
*
|
||||
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
||||
* is set, as brace expansion just turns one string into an array of strings.
|
||||
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
||||
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
||||
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
||||
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
||||
*/
|
||||
export declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
||||
//# sourceMappingURL=has-magic.d.ts.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user