This commit is contained in:
parent
7a9bf3199a
commit
c294e2e9ae
5702 changed files with 465039 additions and 34 deletions
196
node_modules/@jest/reporters/build/CoverageWorker.js
generated
vendored
Normal file
196
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__;
|
||||
/******/ })()
|
||||
;
|
||||
348
node_modules/@jest/reporters/build/index.d.ts
generated
vendored
Normal file
348
node_modules/@jest/reporters/build/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,348 @@
|
|||
/**
|
||||
* 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';
|
||||
|
||||
/**
|
||||
* A reporter optimized for AI coding agents that reduces token usage by only
|
||||
* printing failing tests and the final summary. Automatically activated when
|
||||
* an AI agent environment is detected (via the AI_AGENT env var or std-env).
|
||||
*/
|
||||
export declare class AgentReporter extends DefaultReporter {
|
||||
static readonly filename: string;
|
||||
protected __wrapStdio(): void;
|
||||
protected __clearStatus(): void;
|
||||
protected __printStatus(): void;
|
||||
onTestStart(_test: Test): void;
|
||||
onTestCaseResult(_test: Test, _testCaseResult: TestCaseResult): void;
|
||||
onRunStart(
|
||||
aggregatedResults: AggregatedResult,
|
||||
options: ReporterOnStartOptions,
|
||||
): void;
|
||||
onTestResult(
|
||||
test: Test,
|
||||
testResult: TestResult,
|
||||
aggregatedResults: AggregatedResult,
|
||||
): void;
|
||||
}
|
||||
|
||||
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;
|
||||
private readonly globalConfig;
|
||||
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 {};
|
||||
2603
node_modules/@jest/reporters/build/index.js
generated
vendored
Normal file
2603
node_modules/@jest/reporters/build/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
11
node_modules/@jest/reporters/build/index.mjs
generated
vendored
Normal file
11
node_modules/@jest/reporters/build/index.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import cjsModule from './index.js';
|
||||
|
||||
export const AgentReporter = cjsModule.AgentReporter;
|
||||
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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue