vitest 5.1.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +6 -5
- package/dist/browser.js +7 -7
- package/dist/chunks/{base.Cof-UHJf.js → base.C2su7_N0.js} +12 -12
- package/dist/chunks/{browser.d.C7tWgUvw.d.ts → browser.d.B-QwH_F6.d.ts} +3 -3
- package/dist/chunks/{cac.BYbt0aJp.js → cac.BK306qhQ.js} +15 -10
- package/dist/chunks/{cli-api.COfZo8lK.js → cli-api.D6E8EtSi.js} +317 -134
- package/dist/chunks/{config.d.B3YV4t0O.d.ts → config.d.BpJq6tRA.d.ts} +7 -1
- package/dist/chunks/{console.CQZ877Hi.js → console.VJUxd1rM.js} +2 -2
- package/dist/chunks/{creator.DHWmytIK.js → creator.CoOCr85O.js} +12 -10
- package/dist/chunks/{display.BlTmubjj.js → display.Cj2h2zsY.js} +1 -1
- package/dist/chunks/{doctor.B-oPbwps.js → doctor.SRjZIZuA.js} +1 -1
- package/dist/chunks/{environment.d.BFQtFKdZ.d.ts → environment.d.rlpAM-ON.d.ts} +1 -1
- package/dist/chunks/{globals.ZKtKSkEf.js → globals.Mxora3_v.js} +10 -10
- package/dist/chunks/{index.Bi0NXYPf.js → index.C7Nn66Gy.js} +21 -9
- package/dist/chunks/{index.DmDMHCg8.js → index.CAmut2NG.js} +25 -1
- package/dist/chunks/{index.CZzC1gGg.js → index.DNcttN5a.js} +31 -20
- package/dist/chunks/{index.w_oBZ9N8.js → index.Da_szXbS.js} +3 -3
- package/dist/chunks/{index.Di8au7q4.js → index.ER9afepi.js} +210 -88
- package/dist/chunks/{index.D0heQG4v.js → index.Or9psEGe.js} +1 -1
- package/dist/chunks/{init-forks.BaDXQSD8.js → init-forks.q4IoGYZe.js} +7 -1
- package/dist/chunks/{init-threads.ZX_Vov0z.js → init-threads.Bf1Frg9S.js} +1 -1
- package/dist/chunks/{init.CO4AB7HZ.js → init.dGO4K2C0.js} +16 -8
- package/dist/chunks/{inspector.CvyFGlXm.js → inspector.D6o1NPo1.js} +12 -1
- package/dist/chunks/{modules.BJuCwlRJ.js → moduleSourceMap.Dp1WduWi.js} +31 -1
- package/dist/chunks/{native.upB-V0CK.js → native.D5q1ylZC.js} +2 -1
- package/dist/chunks/{nativeModuleMocker.Dh5azSB4.js → nativeModuleMocker.ihb3q7Cg.js} +4 -2
- package/dist/chunks/{plugin.d.LRFSN46m.d.ts → plugin.d.Du7hHZwb.d.ts} +32 -29
- package/dist/chunks/{plugins.DPQHVT0p.js → plugins.BPruPOR8.js} +1 -1
- package/dist/chunks/{rawSnapshot.DqSiqIEx.js → rawSnapshot.DvoRLRNr.js} +2 -2
- package/dist/chunks/{rpc.Uhkwr2NM.js → rpc.CNYWPa97.js} +3 -19
- package/dist/chunks/{rpc.d.3FOhdFx8.d.ts → rpc.d.DHfuwqP0.d.ts} +2 -2
- package/dist/chunks/{run.CjdgFZiW.js → run.zBhXlcZQ.js} +113 -49
- package/dist/chunks/{setup-common.CqAQCXzx.js → setup-common.wwc_NYRJ.js} +3 -3
- package/dist/chunks/{source-map.DakdQc29.js → source-map.DPHGMWvM.js} +3 -1
- package/dist/chunks/{source-map.d.BkG8YK_3.d.ts → source-map.d.xB6_75fl.d.ts} +2 -1
- package/dist/chunks/{spy.DDMXghXv.js → spy.BO0hTE3G.js} +76 -53
- package/dist/chunks/{task-utils.d.D-gFPNFi.d.ts → task-utils.d.DgSjIb7r.d.ts} +1 -1
- package/dist/chunks/{utils.BBk_icFG.js → utils.sAsh2ClK.js} +2 -6
- package/dist/chunks/{vm.b4MbCAJQ.js → vm.agn4qnmT.js} +4 -4
- package/dist/chunks/{worker.d.CyJRpyfZ.d.ts → worker.d.BigfbIsH.d.ts} +3 -3
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +8 -8
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/module-evaluator.d.ts +3 -3
- package/dist/module-evaluator.js +1 -1
- package/dist/node.d.ts +11 -10
- package/dist/node.js +17 -15
- package/dist/runtime.d.ts +5 -4
- package/dist/runtime.js +5 -3
- package/dist/spy.js +1 -1
- package/dist/worker.d.ts +4 -4
- package/dist/worker.js +19 -18
- package/dist/workers/forks.js +20 -19
- package/dist/workers/runVmTests.js +14 -14
- package/dist/workers/threads.js +20 -19
- package/dist/workers/vmForks.js +14 -13
- package/dist/workers/vmThreads.js +14 -13
- package/dist/workers/watchdog.js +20 -0
- package/package.json +19 -19
|
@@ -2,13 +2,15 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import module$1, { isBuiltin } from 'node:module';
|
|
3
3
|
import { pathToFileURL } from 'node:url';
|
|
4
4
|
import { EvaluatedModules, ModuleRunner } from 'vite/module-runner';
|
|
5
|
-
import { e as environments, b as VitestTransport } from './index.
|
|
5
|
+
import { e as environments, b as VitestTransport } from './index.C7Nn66Gy.js';
|
|
6
|
+
import { s as splitSourceMap } from './moduleSourceMap.Dp1WduWi.js';
|
|
6
7
|
import { r as resolve } from './pathe.M-eThtNZ.zq3TM4NT.js';
|
|
7
|
-
import { b as serializeValue, c as createStackString, p as parseStacktrace } from './source-map.
|
|
8
|
+
import { b as serializeValue, c as createStackString, p as parseStacktrace } from './source-map.DPHGMWvM.js';
|
|
8
9
|
import { w } from './tinyrainbow.Do8I1XRG.js';
|
|
9
10
|
import { Traces } from '../traces.js';
|
|
10
|
-
import { o as onCancel,
|
|
11
|
-
import { s as setupInspect } from './inspector.
|
|
11
|
+
import { o as onCancel, a as rpcDone, c as createRuntimeRpc } from './rpc.CNYWPa97.js';
|
|
12
|
+
import { s as setupInspect } from './inspector.D6o1NPo1.js';
|
|
13
|
+
import { V as VitestEvaluatedModules } from './index.CAmut2NG.js';
|
|
12
14
|
import { E as EnvironmentTeardownError } from './utils.DYj33du9.js';
|
|
13
15
|
|
|
14
16
|
function isBuiltinEnvironment(env) {
|
|
@@ -25,12 +27,18 @@ function createEnvironmentLoader(root, rpc) {
|
|
|
25
27
|
hmr: false,
|
|
26
28
|
sourcemapInterceptor: "prepareStackTrace",
|
|
27
29
|
transport: new VitestTransport({
|
|
30
|
+
// Vite's evaluator and module graph read the source map from the code
|
|
31
|
+
inlineSourceMap: true,
|
|
28
32
|
async fetchModule(id, importer, options) {
|
|
29
33
|
const result = await rpc.fetch(id, importer, "__vitest__", options);
|
|
30
|
-
if ("cached" in result)
|
|
31
|
-
code
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
if ("cached" in result) {
|
|
35
|
+
const { code, sourceMap } = splitSourceMap(readFileSync(result.tmp, "utf-8"));
|
|
36
|
+
return {
|
|
37
|
+
code,
|
|
38
|
+
sourceMap,
|
|
39
|
+
...result
|
|
40
|
+
};
|
|
41
|
+
}
|
|
34
42
|
if (isWindows && "externalize" in result)
|
|
35
43
|
// TODO: vitest returns paths for external modules, but Vite returns file://
|
|
36
44
|
// https://github.com/vitejs/vite/pull/20449
|
|
@@ -4,6 +4,17 @@ import { pathToFileURL } from 'node:url';
|
|
|
4
4
|
const __require = createRequire(import.meta.url);
|
|
5
5
|
let inspector;
|
|
6
6
|
let session;
|
|
7
|
+
// separate from `inspector`, which is only set when Vitest opens the inspector itself
|
|
8
|
+
let inspectorUrl;
|
|
9
|
+
function isInspectorOpen() {
|
|
10
|
+
if (inspectorUrl === void 0) try {
|
|
11
|
+
inspectorUrl = __require("node:inspector").url;
|
|
12
|
+
} catch {
|
|
13
|
+
// node can be built without the inspector
|
|
14
|
+
inspectorUrl = null;
|
|
15
|
+
}
|
|
16
|
+
return inspectorUrl?.() !== void 0;
|
|
17
|
+
}
|
|
7
18
|
/**
|
|
8
19
|
* Enables debugging inside `worker_threads` and `child_process`.
|
|
9
20
|
* Should be called as early as possible when worker/process has been set up.
|
|
@@ -50,4 +61,4 @@ function shouldKeepOpen(config) {
|
|
|
50
61
|
return config.watch && config.isolate === false && config.maxWorkers === 1;
|
|
51
62
|
}
|
|
52
63
|
|
|
53
|
-
export { closeInspector as c, setupInspect as s };
|
|
64
|
+
export { closeInspector as c, isInspectorOpen as i, setupInspect as s };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { builtinModules } from 'node:module';
|
|
2
|
+
import { Buffer } from 'node:buffer';
|
|
2
3
|
|
|
3
4
|
// copied from vite
|
|
4
5
|
// https://github.com/vitejs/vite/blob/814120f2ad387ca3d1e16c7dd403b04ca4b97f75/packages/vite/src/node/utils.ts#L106
|
|
@@ -33,4 +34,33 @@ function toBuiltin(id) {
|
|
|
33
34
|
return `node:${id}`;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
let SOURCEMAPPING_URL = "sourceMa";
|
|
38
|
+
SOURCEMAPPING_URL += "ppingURL";
|
|
39
|
+
// the source map is stored after the code in the files that workers read,
|
|
40
|
+
// it is JSON without line breaks, so the last marker is always this one
|
|
41
|
+
const SOURCE_MAP_SEPARATOR = "\n//# vitestSourceMap=";
|
|
42
|
+
function appendSourceMap(content, sourceMap) {
|
|
43
|
+
return `${content}${SOURCE_MAP_SEPARATOR}${sourceMap ?? ""}`;
|
|
44
|
+
}
|
|
45
|
+
function splitSourceMap(content) {
|
|
46
|
+
const index = content.lastIndexOf(SOURCE_MAP_SEPARATOR);
|
|
47
|
+
if (index === -1) return {
|
|
48
|
+
code: content,
|
|
49
|
+
sourceMap: void 0
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
code: content.slice(0, index),
|
|
53
|
+
sourceMap: content.slice(index + 21) || void 0
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// debuggers read the source map from the comment in the compiled script
|
|
57
|
+
function withInlineSourceMap(result) {
|
|
58
|
+
const { code, sourceMap } = result;
|
|
59
|
+
if (code == null || !sourceMap) return result;
|
|
60
|
+
return {
|
|
61
|
+
...result,
|
|
62
|
+
code: `${code}\n//# ${SOURCEMAPPING_URL}=data:application/json;base64,${Buffer.from(sourceMap).toString("base64")}\n`
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { isBrowserExternal as a, appendSourceMap as b, isBuiltin as i, splitSourceMap as s, toBuiltin as t, withInlineSourceMap as w };
|
|
@@ -7,8 +7,9 @@ import { p as parse } from './acorn.C1kjbUFw.js';
|
|
|
7
7
|
import MagicString from 'magic-string';
|
|
8
8
|
import { $ } from './tinyrainbow.Do8I1XRG.js';
|
|
9
9
|
import { distDir } from '../path.js';
|
|
10
|
-
import { t as toBuiltin } from './
|
|
10
|
+
import { t as toBuiltin } from './moduleSourceMap.Dp1WduWi.js';
|
|
11
11
|
import 'node:path';
|
|
12
|
+
import 'node:buffer';
|
|
12
13
|
|
|
13
14
|
const NOW_LENGTH = Date.now().toString().length;
|
|
14
15
|
const REGEXP_VITEST = new RegExp(`%3Fvitest=\\d{${NOW_LENGTH}}`);
|
|
@@ -3,9 +3,11 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
3
3
|
import { automockModule, createManualModuleSource, collectModuleExports } from '@vitest/mocker/transforms';
|
|
4
4
|
import { c as cleanUrl, e as createDefer, i as isAbsolute } from './pathe.M-eThtNZ.zq3TM4NT.js';
|
|
5
5
|
import { p as parse } from './acorn.C1kjbUFw.js';
|
|
6
|
-
import { t as toBuiltin } from './
|
|
7
|
-
import { B as BareModuleMocker, n as normalizeModuleId } from './index.
|
|
6
|
+
import { t as toBuiltin } from './moduleSourceMap.Dp1WduWi.js';
|
|
7
|
+
import { B as BareModuleMocker, n as normalizeModuleId } from './index.C7Nn66Gy.js';
|
|
8
|
+
import 'node:buffer';
|
|
8
9
|
import 'node:fs';
|
|
10
|
+
import './inspector.D6o1NPo1.js';
|
|
9
11
|
import './utils.DYj33du9.js';
|
|
10
12
|
import '../path.js';
|
|
11
13
|
import 'node:path';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { DevEnvironment, IndexHtmlTransformContext, IndexHtmlTransformResult, ViteDevServer, UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1,
|
|
2
|
-
import { aW as TaskMeta, U as UserConsoleLog, Q as Suite, a as File, bk as SerializableRetry, T as TestError, h as TestAnnotation, j as TestArtifact, b2 as TestBenchmark, aL as SerializedError, a1 as ImportDuration, n as Test, A as Awaitable, Z as CancelReason, P as ParsedStack, bl as BrowserTraceViewMode, bm as BrowserTraceViewRecordingMode, a6 as BaselineData, p as ProvidedContext, b as SerializedConfig, bn as Arrayable, a3 as AfterSuiteRunMeta, aQ as SnapshotStateOptions, aR as SnapshotSummary, aO as SnapshotResult, Y as Task, bo as AsyncLeak, k as TaskResultPack, F as FileSpecification, m as SerializedRootConfig, L as LabelColor, c as SerializedDiffOptions, bi as SequenceSetupFiles, bh as SequenceHooks, bp as PrettyFormatOptions, e as FakeTimersConfig, g as TestTagDefinition } from './config.d.
|
|
1
|
+
import { DevEnvironment, IndexHtmlTransformContext, IndexHtmlTransformResult, ViteDevServer, UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, parseAstAsync, TransformResult as TransformResult$1, InlineConfig as InlineConfig$1, DepOptimizationConfig, ServerOptions, ConfigEnv, AliasOptions } from 'vite';
|
|
2
|
+
import { aW as TaskMeta, U as UserConsoleLog, Q as Suite, a as File, bk as SerializableRetry, T as TestError, h as TestAnnotation, j as TestArtifact, b2 as TestBenchmark, aL as SerializedError, a1 as ImportDuration, n as Test, A as Awaitable, Z as CancelReason, P as ParsedStack, bl as BrowserTraceViewMode, bm as BrowserTraceViewRecordingMode, a6 as BaselineData, p as ProvidedContext, b as SerializedConfig, bn as Arrayable, a3 as AfterSuiteRunMeta, aQ as SnapshotStateOptions, aR as SnapshotSummary, aO as SnapshotResult, Y as Task, bo as AsyncLeak, k as TaskResultPack, F as FileSpecification, m as SerializedRootConfig, L as LabelColor, c as SerializedDiffOptions, bi as SequenceSetupFiles, bh as SequenceHooks, bp as PrettyFormatOptions, e as FakeTimersConfig, g as TestTagDefinition } from './config.d.BpJq6tRA.js';
|
|
3
3
|
import { Writable } from 'node:stream';
|
|
4
|
-
import { S as SerializedTestSpecification, B as BrowserTesterOptions, c as SourceModuleDiagnostic } from './browser.d.
|
|
4
|
+
import { S as SerializedTestSpecification, B as BrowserTesterOptions, c as SourceModuleDiagnostic } from './browser.d.B-QwH_F6.js';
|
|
5
5
|
import * as chai from 'chai';
|
|
6
6
|
import { happyDomTypes, jsdomTypes } from 'vitest/optional-types.js';
|
|
7
|
-
import { a as ContextTestEnvironment, b as WorkerExecuteContext, c as WorkerTestEnvironment } from './worker.d.
|
|
8
|
-
import { O as OTELCarrier } from './rpc.d.
|
|
7
|
+
import { a as ContextTestEnvironment, b as WorkerExecuteContext, c as WorkerTestEnvironment } from './worker.d.BigfbIsH.js';
|
|
8
|
+
import { O as OTELCarrier } from './rpc.d.DHfuwqP0.js';
|
|
9
9
|
import { MockedModule } from '@vitest/mocker';
|
|
10
|
-
import { S as StackTraceParserOptions, a as RuntimeCoverageProviderModule } from './source-map.d.
|
|
10
|
+
import { S as StackTraceParserOptions, a as RuntimeCoverageProviderModule } from './source-map.d.xB6_75fl.js';
|
|
11
11
|
import { CDPSession, BrowserCommands, MarkOptions } from 'vitest/browser';
|
|
12
12
|
import path from 'node:path';
|
|
13
13
|
import { Console } from 'node:console';
|
|
@@ -1818,6 +1818,14 @@ interface ReportOptions {
|
|
|
1818
1818
|
|
|
1819
1819
|
type TransformResult = string | Partial<TransformResult$1> | undefined | null | void;
|
|
1820
1820
|
type CoverageResults = unknown;
|
|
1821
|
+
type AstNode = CollectNodes<Awaited<ReturnType<typeof parseAstAsync>>>;
|
|
1822
|
+
type CollectNodes<
|
|
1823
|
+
T,
|
|
1824
|
+
Depth extends unknown[] = []
|
|
1825
|
+
> = Depth["length"] extends 8 ? T : CollectNodes<T | ChildNodes<T>, [...Depth, unknown]>;
|
|
1826
|
+
type ChildNodes<T> = T extends unknown ? Extract<{ [K in keyof T]: NonNullable<T[K]> extends readonly (infer U)[] ? NonNullable<U> : NonNullable<T[K]> }[keyof T], {
|
|
1827
|
+
type: string;
|
|
1828
|
+
}> : never;
|
|
1821
1829
|
interface CoverageProvider {
|
|
1822
1830
|
name: string;
|
|
1823
1831
|
/** Called when provider is being initialized before tests run */
|
|
@@ -2030,7 +2038,7 @@ interface CoverageOptions {
|
|
|
2030
2038
|
* ignoreNode: (node, type) => type === 'statement' && node.type === 'DebuggerStatement'
|
|
2031
2039
|
* ```
|
|
2032
2040
|
*/
|
|
2033
|
-
ignoreNode?: (node:
|
|
2041
|
+
ignoreNode?: (node: AstNode, type: "function" | "statement" | "branch") => boolean | "ignore-this-and-nested-nodes" | void;
|
|
2034
2042
|
/**
|
|
2035
2043
|
* Custom instrumenter factory to use instead of the default `@vitest/istanbul-lib-instrument`.
|
|
2036
2044
|
*
|
|
@@ -2353,14 +2361,7 @@ declare class StateManager {
|
|
|
2353
2361
|
/** Number of test workers that were started during the run. */
|
|
2354
2362
|
workersSpawned: number;
|
|
2355
2363
|
metadata: Record<string, {
|
|
2356
|
-
externalized: Record<string, string>;
|
|
2357
2364
|
duration: Record<string, number[]>;
|
|
2358
|
-
tmps: Record<string, string>;
|
|
2359
|
-
dumpDir?: string;
|
|
2360
|
-
outline?: {
|
|
2361
|
-
externalized: number;
|
|
2362
|
-
inlined: number;
|
|
2363
|
-
};
|
|
2364
2365
|
}>;
|
|
2365
2366
|
onUnhandledError?: OnUnhandledErrorCallback;
|
|
2366
2367
|
constructor(options: {
|
|
@@ -2517,6 +2518,7 @@ declare class Vitest {
|
|
|
2517
2518
|
private restartsCount;
|
|
2518
2519
|
private readonly specifications;
|
|
2519
2520
|
private pool;
|
|
2521
|
+
private sequencer;
|
|
2520
2522
|
private _coverageProvider?;
|
|
2521
2523
|
/**
|
|
2522
2524
|
* @deprecated Do not rely on this property, it's always `test`. Scheduled to be removed in the next major.
|
|
@@ -2670,6 +2672,8 @@ declare class Vitest {
|
|
|
2670
2672
|
/** @default os.availableParallelism() */
|
|
2671
2673
|
concurrency?: number;
|
|
2672
2674
|
}): Promise<TestModule[]>;
|
|
2675
|
+
private preParseSpecifications;
|
|
2676
|
+
private parseFiles;
|
|
2673
2677
|
experimental_parseSpecification(specification: TestSpecification): Promise<TestModule>;
|
|
2674
2678
|
/**
|
|
2675
2679
|
* Collect tests in specified modules. Vitest will run the files to collect tests.
|
|
@@ -2680,6 +2684,7 @@ declare class Vitest {
|
|
|
2680
2684
|
* Gracefully cancel the current test run. Vitest will wait until all running tests are finished before cancelling.
|
|
2681
2685
|
*/
|
|
2682
2686
|
cancelCurrentRun(reason: CancelReason): Promise<void>;
|
|
2687
|
+
private getSequencer;
|
|
2683
2688
|
private initializeGlobalSetup;
|
|
2684
2689
|
/**
|
|
2685
2690
|
* Update snapshots in specified files. If no files are provided, it will update files with failed tests and obsolete snapshots.
|
|
@@ -3705,21 +3710,13 @@ interface InlineConfig {
|
|
|
3705
3710
|
deps?: DepsOptions;
|
|
3706
3711
|
server?: {
|
|
3707
3712
|
deps?: ServerDepsOptions;
|
|
3713
|
+
/**
|
|
3714
|
+
* @deprecated This option does nothing. To inspect or edit the transformed code,
|
|
3715
|
+
* look up the module in the `fsModuleCache` manifest.
|
|
3716
|
+
* @see {@link https://vitest.dev/config/fsmodulecache#manifest}
|
|
3717
|
+
*/
|
|
3708
3718
|
debug?: {
|
|
3709
|
-
/**
|
|
3710
|
-
* The folder where Vitest stores the contents of transformed
|
|
3711
|
-
* test files that can be inspected manually.
|
|
3712
|
-
*
|
|
3713
|
-
* If `true`, Vitest dumps the files in `.vitest-dump` folder relative to the root of the project.
|
|
3714
|
-
*
|
|
3715
|
-
* You can also use `VITEST_DEBUG_DUMP` env variable to enable this.
|
|
3716
|
-
*/
|
|
3717
3719
|
dump?: string | true;
|
|
3718
|
-
/**
|
|
3719
|
-
* If dump is enabled, should Vitest load the files from there instead of transforming them.
|
|
3720
|
-
*
|
|
3721
|
-
* You can also use `VITEST_DEBUG_LOAD_DUMP` env variable to enable this.
|
|
3722
|
-
*/
|
|
3723
3720
|
load?: boolean;
|
|
3724
3721
|
};
|
|
3725
3722
|
};
|
|
@@ -4552,7 +4549,7 @@ interface UserConfig extends InlineConfig {
|
|
|
4552
4549
|
type OnUnhandledErrorCallback = (error: (TestError | Error) & {
|
|
4553
4550
|
type: string;
|
|
4554
4551
|
}) => boolean | void;
|
|
4555
|
-
interface ResolvedConfig extends Omit<Required<UserConfig>, "project" | "config" | "filters" | "browser" | "coverage" | "testNamePattern" | "related" | "api" | "reporters" | "resolveSnapshotPath" | "benchmark" | "shard" | "cache" | "sequence" | "typecheck" | "runner" | "pool" | "cliExclude" | "diff" | "setupFiles" | "snapshotEnvironment" | "bail" | "name" | "vmMemoryLimit" | "fileParallelism" | "tagsFilter" | "reporter" | "ui"> {
|
|
4552
|
+
interface ResolvedConfig extends Omit<Required<UserConfig>, "project" | "config" | "filters" | "browser" | "coverage" | "testNamePattern" | "related" | "api" | "reporters" | "resolveSnapshotPath" | "benchmark" | "shard" | "cache" | "sequence" | "typecheck" | "runner" | "pool" | "cliExclude" | "diff" | "setupFiles" | "snapshotEnvironment" | "bail" | "name" | "vmMemoryLimit" | "fileParallelism" | "tagsFilter" | "reporter" | "ui" | "inspector"> {
|
|
4556
4553
|
name: ProjectName["label"];
|
|
4557
4554
|
color?: ProjectName["color"];
|
|
4558
4555
|
base?: string;
|
|
@@ -4571,6 +4568,13 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, "project" | "config"
|
|
|
4571
4568
|
poolRunner?: PoolRunnerInitializer;
|
|
4572
4569
|
reporters: (InlineReporter | ReporterWithOptions)[];
|
|
4573
4570
|
defines: Record<string, any>;
|
|
4571
|
+
inspector: NonNullable<UserConfig["inspector"]> & {
|
|
4572
|
+
/**
|
|
4573
|
+
* The main process has an open inspector. A debugger attached to it can attach to workers too.
|
|
4574
|
+
* @internal
|
|
4575
|
+
*/
|
|
4576
|
+
openInMainProcess: boolean;
|
|
4577
|
+
};
|
|
4574
4578
|
api: ResolvedApiConfig;
|
|
4575
4579
|
ui: boolean;
|
|
4576
4580
|
uiOptions: Required<Omit<UIOptions, "enabled">>;
|
|
@@ -4602,7 +4606,6 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, "project" | "config"
|
|
|
4602
4606
|
runner?: string;
|
|
4603
4607
|
maxWorkers: number;
|
|
4604
4608
|
vmMemoryLimit?: string | number;
|
|
4605
|
-
dumpDir?: string;
|
|
4606
4609
|
tagsFilter?: string[];
|
|
4607
4610
|
mergeReportsLabel?: string;
|
|
4608
4611
|
experimental: Omit<Required<UserConfig>["experimental"], "importDurations" | "diagnostics"> & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { f as isObject, h as getCallLastIndex } from './pathe.M-eThtNZ.zq3TM4NT.js';
|
|
2
2
|
import { p as positionToOffset, o as offsetToLineNumber, l as lineSplitRE } from './offset.Dy-5Fdfn.js';
|
|
3
|
-
import { g as getDefaultExportFromCjs, f as format } from './index.
|
|
4
|
-
import { g as getSerializers } from './plugins.
|
|
3
|
+
import { g as getDefaultExportFromCjs, f as format } from './index.Or9psEGe.js';
|
|
4
|
+
import { g as getSerializers } from './plugins.BPruPOR8.js';
|
|
5
5
|
|
|
6
6
|
var naturalCompare$1 = {exports: {}};
|
|
7
7
|
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as getSafeTimers } from './source-map.DakdQc29.js';
|
|
4
|
-
import { c as createBirpc } from './index.DmDMHCg8.js';
|
|
1
|
+
import { a as getSafeTimers } from './source-map.DPHGMWvM.js';
|
|
2
|
+
import { c as createBirpc } from './index.CAmut2NG.js';
|
|
5
3
|
import { g as getWorkerState } from './utils.DYj33du9.js';
|
|
6
4
|
|
|
7
|
-
// TODO: this is not needed in Vite 7.2+
|
|
8
|
-
class VitestEvaluatedModules extends EvaluatedModules {
|
|
9
|
-
getModuleSourceMapById(id) {
|
|
10
|
-
/** the return type is not exposed by Vite */
|
|
11
|
-
const map = super.getModuleSourceMapById(id);
|
|
12
|
-
if (map != null && !("_patched" in map)) {
|
|
13
|
-
map._patched = true;
|
|
14
|
-
const dir = dirname(map.url);
|
|
15
|
-
map.resolvedSources = (map.map.sources || []).map((s) => resolve(dir, s || ""));
|
|
16
|
-
}
|
|
17
|
-
return map;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
5
|
const { get } = Reflect;
|
|
22
6
|
const globalProcess = globalThis.process;
|
|
23
7
|
function withSafeTimers(fn) {
|
|
@@ -90,4 +74,4 @@ function rpc() {
|
|
|
90
74
|
return rpc;
|
|
91
75
|
}
|
|
92
76
|
|
|
93
|
-
export {
|
|
77
|
+
export { rpcDone as a, createRuntimeRpc as c, onCancel as o, rpc as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bw as
|
|
1
|
+
import { bw as VitestFetchResult, bx as FetchCachedFileSystemResult, by as ResolveFunctionResult, U as UserConsoleLog, bo as AsyncLeak, a as File, a3 as AfterSuiteRunMeta, b2 as TestBenchmark, j as TestArtifact, k as TaskResultPack, l as TaskEventPack, Z as CancelReason, aO as SnapshotResult, a6 as BaselineData } from './config.d.BpJq6tRA.js';
|
|
2
2
|
import { FetchFunctionOptions, FetchResult } from 'vite/module-runner';
|
|
3
3
|
|
|
4
4
|
interface OTELCarrier {
|
|
@@ -31,7 +31,7 @@ interface GetterTrackerExport {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
interface RuntimeRPC {
|
|
34
|
-
fetch: (id: string, importer: string | undefined, environment: string, options?: FetchFunctionOptions, otelCarrier?: OTELCarrier) => Promise<
|
|
34
|
+
fetch: (id: string, importer: string | undefined, environment: string, options?: FetchFunctionOptions, otelCarrier?: OTELCarrier) => Promise<VitestFetchResult | FetchCachedFileSystemResult>;
|
|
35
35
|
resolve: (id: string, importer: string | undefined, environment: string) => Promise<ResolveFunctionResult | null>;
|
|
36
36
|
/**
|
|
37
37
|
* Returns the modules of the given test files' import graphs that the server
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as format, p as plugins } from './index.
|
|
1
|
+
import { f as format, p as plugins } from './index.Or9psEGe.js';
|
|
2
2
|
import { $ } from './tinyrainbow.Do8I1XRG.js';
|
|
3
|
-
import { s as stringify, f as format$1, a as formatRegExp, t as truncateString, i as inspect } from './display.
|
|
3
|
+
import { s as stringify, f as format$1, a as formatRegExp, t as truncateString, i as inspect } from './display.Cj2h2zsY.js';
|
|
4
4
|
import { u as deepClone, v as getOwnProperties, g as getType$1, f as isObject, w as filterOutComments, x as ordinal, e as createDefer, y as assertTypes, t as toArray, z as isNegativeNaN, A as unique, B as objectAttr } from './pathe.M-eThtNZ.zq3TM4NT.js';
|
|
5
|
-
import { d as diffSequences, b as serializeValue, p as parseStacktrace, a as getSafeTimers } from './source-map.
|
|
5
|
+
import { d as diffSequences, b as serializeValue, p as parseStacktrace, a as getSafeTimers } from './source-map.DPHGMWvM.js';
|
|
6
6
|
import { createTaskName, createFileTask, calculateSuiteHash, interpretTaskModes, hasFailed } from '../task-utils.js';
|
|
7
7
|
|
|
8
8
|
const RealDate = Date;
|
|
@@ -1212,7 +1212,23 @@ function replaceAsymmetricMatcher(actual, expected, actualReplaced = /* @__PURE_
|
|
|
1212
1212
|
replacedExpected: expected
|
|
1213
1213
|
};
|
|
1214
1214
|
}
|
|
1215
|
-
if (
|
|
1215
|
+
if (isAsymmetricMatcher(expected)) {
|
|
1216
|
+
const sample = unwrapContainingMatcher(expected, actual);
|
|
1217
|
+
if (sample === void 0) return {
|
|
1218
|
+
replacedActual: actual,
|
|
1219
|
+
replacedExpected: expected
|
|
1220
|
+
};
|
|
1221
|
+
return replaceAsymmetricMatcher(actual, sample, actualReplaced, expectedReplaced);
|
|
1222
|
+
}
|
|
1223
|
+
if (isAsymmetricMatcher(actual)) {
|
|
1224
|
+
const sample = unwrapContainingMatcher(actual, expected);
|
|
1225
|
+
if (sample === void 0) return {
|
|
1226
|
+
replacedActual: actual,
|
|
1227
|
+
replacedExpected: expected
|
|
1228
|
+
};
|
|
1229
|
+
return replaceAsymmetricMatcher(sample, expected, actualReplaced, expectedReplaced);
|
|
1230
|
+
}
|
|
1231
|
+
if (actual === expected || !isReplaceable(actual, expected)) return {
|
|
1216
1232
|
replacedActual: actual,
|
|
1217
1233
|
replacedExpected: expected
|
|
1218
1234
|
};
|
|
@@ -1226,35 +1242,67 @@ function replaceAsymmetricMatcher(actual, expected, actualReplaced = /* @__PURE_
|
|
|
1226
1242
|
const expectedValue = expected[key];
|
|
1227
1243
|
const actualValue = actual[key];
|
|
1228
1244
|
if (isAsymmetricMatcher(expectedValue)) {
|
|
1229
|
-
if (expectedValue.asymmetricMatch(actualValue))
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
// For container matchers (ArrayContaining, ObjectContaining), unwrap and recursively process
|
|
1235
|
-
// Matcher doesn't match: unwrap but keep structure to show mismatch
|
|
1236
|
-
const replaced = replaceAsymmetricMatcher(actualValue, expectedValue.sample, actualReplaced, expectedReplaced);
|
|
1237
|
-
actual[key] = replaced.replacedActual;
|
|
1238
|
-
expected[key] = replaced.replacedExpected;
|
|
1245
|
+
if (expectedValue.asymmetricMatch(actualValue)) {
|
|
1246
|
+
// When matcher matches, replace expected with actual value
|
|
1247
|
+
// so they appear the same in the diff
|
|
1248
|
+
expected[key] = actualValue;
|
|
1249
|
+
return;
|
|
1239
1250
|
}
|
|
1240
1251
|
} else if (isAsymmetricMatcher(actualValue)) {
|
|
1241
|
-
if (actualValue.asymmetricMatch(expectedValue))
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
actual[key] = replaced.replacedActual;
|
|
1245
|
-
expected[key] = replaced.replacedExpected;
|
|
1252
|
+
if (actualValue.asymmetricMatch(expectedValue)) {
|
|
1253
|
+
actual[key] = expectedValue;
|
|
1254
|
+
return;
|
|
1246
1255
|
}
|
|
1247
|
-
} else if (isReplaceable(actualValue, expectedValue))
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
}
|
|
1256
|
+
} else if (!isReplaceable(actualValue, expectedValue)) return;
|
|
1257
|
+
const replaced = replaceAsymmetricMatcher(actualValue, expectedValue, actualReplaced, expectedReplaced);
|
|
1258
|
+
if (replaced.replacedActual !== actualValue) actual[key] = replaced.replacedActual;
|
|
1259
|
+
if (replaced.replacedExpected !== expectedValue) expected[key] = replaced.replacedExpected;
|
|
1252
1260
|
});
|
|
1253
1261
|
return {
|
|
1254
1262
|
replacedActual: actual,
|
|
1255
1263
|
replacedExpected: expected
|
|
1256
1264
|
};
|
|
1257
1265
|
}
|
|
1266
|
+
function isContainingMatcher(value) {
|
|
1267
|
+
if (!isAsymmetricMatcher(value)) return false;
|
|
1268
|
+
const name = value.toString();
|
|
1269
|
+
return name === "ObjectContaining" || name === "ArrayContaining";
|
|
1270
|
+
}
|
|
1271
|
+
// Show a failed ObjectContaining/ArrayContaining as the plain value it checks,
|
|
1272
|
+
// so the diff points at the mismatched entries
|
|
1273
|
+
function unwrapContainingMatcher(matcher, other) {
|
|
1274
|
+
// a matching matcher fails only with `.not`, keep it as is
|
|
1275
|
+
if (!isContainingMatcher(matcher) || matcher.asymmetricMatch(other)) return;
|
|
1276
|
+
const sample = matcher.sample;
|
|
1277
|
+
if (matcher.toString() === "ArrayContaining") return Array.isArray(sample) && Array.isArray(other) ? fillArrayContaining(matcher, sample, other) : void 0;
|
|
1278
|
+
if (getType$1(sample) === "Object" && getType$1(other) === "Object") {
|
|
1279
|
+
// keys that the matcher does not check are taken from the other side
|
|
1280
|
+
const filled = Object.create(Object.getPrototypeOf(other), Object.getOwnPropertyDescriptors(other));
|
|
1281
|
+
return Object.defineProperties(filled, Object.getOwnPropertyDescriptors(sample));
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
// Keep the other array in its order and add the items that it misses
|
|
1285
|
+
function fillArrayContaining(matcher, sample, other) {
|
|
1286
|
+
// check one item with the same equality as the matcher
|
|
1287
|
+
const includes = (array, item) => Object.create(matcher, { sample: { value: [item] } }).asymmetricMatch(array);
|
|
1288
|
+
const found = [];
|
|
1289
|
+
const missing = [];
|
|
1290
|
+
for (const item of sample) if (includes(other, item)) found.push(item);
|
|
1291
|
+
else missing.push(item);
|
|
1292
|
+
const unmatched = other.map((_, index) => index).filter((index) => !includes(found, other[index]));
|
|
1293
|
+
const filled = [...other];
|
|
1294
|
+
for (const item of missing) {
|
|
1295
|
+
// put an object in place of an unmatched object to show the difference inside it
|
|
1296
|
+
const position = unmatched.findIndex((index) => isDiffableInside(item, other[index]));
|
|
1297
|
+
if (position === -1) filled.push(item);
|
|
1298
|
+
else filled[unmatched.splice(position, 1)[0]] = item;
|
|
1299
|
+
}
|
|
1300
|
+
return filled;
|
|
1301
|
+
}
|
|
1302
|
+
function isDiffableInside(expected, actual) {
|
|
1303
|
+
if (isAsymmetricMatcher(expected)) return isContainingMatcher(expected) && isReplaceable(actual, expected.sample);
|
|
1304
|
+
return isReplaceable(actual, expected);
|
|
1305
|
+
}
|
|
1258
1306
|
function getLabelPrinter(...strings) {
|
|
1259
1307
|
const maxLength = strings.reduce((max, string) => string.length > max ? string.length : max, 0);
|
|
1260
1308
|
return (string) => `${string}: ${" ".repeat(maxLength - string.length)}`;
|
|
@@ -1384,6 +1432,12 @@ class TestRunAbortError extends Error {
|
|
|
1384
1432
|
this.reason = reason;
|
|
1385
1433
|
}
|
|
1386
1434
|
}
|
|
1435
|
+
class TestTimeoutError extends Error {
|
|
1436
|
+
name = "TestTimeoutError";
|
|
1437
|
+
}
|
|
1438
|
+
class HookTimeoutError extends Error {
|
|
1439
|
+
name = "HookTimeoutError";
|
|
1440
|
+
}
|
|
1387
1441
|
class FixtureDependencyError extends Error {
|
|
1388
1442
|
name = "FixtureDependencyError";
|
|
1389
1443
|
}
|
|
@@ -1591,8 +1645,12 @@ class TestFixtures {
|
|
|
1591
1645
|
const cleanupFnArrayMap = /* @__PURE__ */ new WeakMap();
|
|
1592
1646
|
async function callFixtureCleanup(context) {
|
|
1593
1647
|
const cleanupFnArray = cleanupFnArrayMap.get(context) ?? [];
|
|
1594
|
-
for (const cleanup of cleanupFnArray.reverse()) await cleanup();
|
|
1595
1648
|
cleanupFnArrayMap.delete(context);
|
|
1649
|
+
await runFixtureCleanups(cleanupFnArray);
|
|
1650
|
+
}
|
|
1651
|
+
// one context at a time, so that teardowns do not overlap and keep their order on every run
|
|
1652
|
+
async function callFixtureCleanups(contexts) {
|
|
1653
|
+
await runFixtureCleanups(contexts.map((context) => () => callFixtureCleanup(context)));
|
|
1596
1654
|
}
|
|
1597
1655
|
/**
|
|
1598
1656
|
* Returns the current number of cleanup functions registered for the context.
|
|
@@ -1609,12 +1667,17 @@ function getFixtureCleanupCount(context) {
|
|
|
1609
1667
|
async function callFixtureCleanupFrom(context, fromIndex) {
|
|
1610
1668
|
const cleanupFnArray = cleanupFnArrayMap.get(context);
|
|
1611
1669
|
if (!cleanupFnArray || cleanupFnArray.length <= fromIndex) return;
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1670
|
+
await runFixtureCleanups(cleanupFnArray.splice(fromIndex));
|
|
1671
|
+
}
|
|
1672
|
+
async function runFixtureCleanups(cleanups) {
|
|
1673
|
+
const errors = [];
|
|
1674
|
+
for (const cleanup of cleanups.reverse()) try {
|
|
1675
|
+
await cleanup();
|
|
1676
|
+
} catch (error) {
|
|
1677
|
+
errors.push(error);
|
|
1678
|
+
}
|
|
1679
|
+
if (errors.length === 1) throw errors[0];
|
|
1680
|
+
if (errors.length > 1) throw new AggregateError(errors, "Multiple fixture teardowns failed.");
|
|
1618
1681
|
}
|
|
1619
1682
|
const contextHasFixturesCache = /* @__PURE__ */ new WeakMap();
|
|
1620
1683
|
function withFixtures(fn, options) {
|
|
@@ -2699,7 +2762,7 @@ function createSuiteCollector(name, factory = () => {}, mode, each, suiteOptions
|
|
|
2699
2762
|
Error.stackTraceLimit = 10;
|
|
2700
2763
|
const stackTraceError = /* @__PURE__ */ new Error("STACK_TRACE_ERROR");
|
|
2701
2764
|
Error.stackTraceLimit = limit;
|
|
2702
|
-
if (handler) setFn(task, withTimeout(withCancel(withAwaitAsyncAssertions(withFixtures(handler, { context }), task),
|
|
2765
|
+
if (handler) setFn(task, withTimeout(withCancel(withAwaitAsyncAssertions(withFixtures(handler, { context }), task), context), timeout, false, stackTraceError, (_, error) => abortIfTimeout([context], error)));
|
|
2703
2766
|
if (runner.config.includeTaskLocation) {
|
|
2704
2767
|
const stack = findTestFileStackTrace(currentTestFilepath, stackTraceError);
|
|
2705
2768
|
if (stack) task.location = {
|
|
@@ -3328,8 +3391,9 @@ catch (error) {
|
|
|
3328
3391
|
});
|
|
3329
3392
|
};
|
|
3330
3393
|
}
|
|
3331
|
-
function withCancel(fn,
|
|
3394
|
+
function withCancel(fn, context) {
|
|
3332
3395
|
return function runWithCancel(...args) {
|
|
3396
|
+
const signal = context.signal;
|
|
3333
3397
|
return new Promise((resolve, reject) => {
|
|
3334
3398
|
const onAbort = () => reject(signal.reason);
|
|
3335
3399
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
@@ -3361,16 +3425,18 @@ function abortIfTimeout([context], error) {
|
|
|
3361
3425
|
function abortContextSignal(context, error) {
|
|
3362
3426
|
abortControllers.get(context)?.abort(error);
|
|
3363
3427
|
}
|
|
3428
|
+
function resetContextSignal(context) {
|
|
3429
|
+
// the next attempt of a cancelled run starts aborted
|
|
3430
|
+
if (abortControllers.get(context)?.signal.reason instanceof TestRunAbortError) return;
|
|
3431
|
+
const abortController = new AbortController();
|
|
3432
|
+
abortControllers.set(context, abortController);
|
|
3433
|
+
context.signal = abortController.signal;
|
|
3434
|
+
}
|
|
3364
3435
|
function createTestContext(test, runner) {
|
|
3365
3436
|
const context = function() {
|
|
3366
3437
|
throw new Error("done() callback is deprecated, use promise instead");
|
|
3367
3438
|
};
|
|
3368
|
-
|
|
3369
|
-
if (!abortController) {
|
|
3370
|
-
abortController = new AbortController();
|
|
3371
|
-
abortControllers.set(context, abortController);
|
|
3372
|
-
}
|
|
3373
|
-
context.signal = abortController.signal;
|
|
3439
|
+
resetContextSignal(context);
|
|
3374
3440
|
context.task = test;
|
|
3375
3441
|
context.skip = (condition, note) => {
|
|
3376
3442
|
if (condition === false)
|
|
@@ -3404,11 +3470,11 @@ function createTestContext(test, runner) {
|
|
|
3404
3470
|
});
|
|
3405
3471
|
context.onTestFailed = (handler, timeout) => {
|
|
3406
3472
|
test.onFailed ||= [];
|
|
3407
|
-
test.onFailed.push(withTimeout(handler, timeout ?? runner.config.hookTimeout, true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), (_, error) =>
|
|
3473
|
+
test.onFailed.push(withTimeout(handler, timeout ?? runner.config.hookTimeout, true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), (_, error) => abortContextSignal(context, error)));
|
|
3408
3474
|
};
|
|
3409
3475
|
context.onTestFinished = (handler, timeout) => {
|
|
3410
3476
|
test.onFinished ||= [];
|
|
3411
|
-
test.onFinished.push(withTimeout(handler, timeout ?? runner.config.hookTimeout, true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), (_, error) =>
|
|
3477
|
+
test.onFinished.push(withTimeout(handler, timeout ?? runner.config.hookTimeout, true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), (_, error) => abortContextSignal(context, error)));
|
|
3412
3478
|
};
|
|
3413
3479
|
return runner.extendTaskContext?.(context) || context;
|
|
3414
3480
|
}
|
|
@@ -3418,8 +3484,8 @@ function makeTimeoutError(isHook, timeout, stackTraceError, pending) {
|
|
|
3418
3484
|
const lastOperationSource = pending?.at(-1)?.source;
|
|
3419
3485
|
if (lastOperationSource) stackTraceError = lastOperationSource;
|
|
3420
3486
|
const message = `${isHook ? "Hook" : "Test"} timed out in ${timeout}ms${waiting}.\nIf this is a long-running ${isHook ? "hook" : "test"}, pass a timeout value as the last argument or configure it globally with "${isHook ? "hookTimeout" : "testTimeout"}".`;
|
|
3421
|
-
const error = new
|
|
3422
|
-
if (stackTraceError?.stack) error.stack = stackTraceError.stack.replace(stackTraceError.message
|
|
3487
|
+
const error = isHook ? new HookTimeoutError(message) : new TestTimeoutError(message);
|
|
3488
|
+
if (stackTraceError?.stack) error.stack = stackTraceError.stack.replace(`${stackTraceError.name}: ${stackTraceError.message}`, `${error.name}: ${error.message}`);
|
|
3423
3489
|
return error;
|
|
3424
3490
|
}
|
|
3425
3491
|
|
|
@@ -3888,6 +3954,7 @@ async function runTest(test, runner) {
|
|
|
3888
3954
|
test.result.state = "run";
|
|
3889
3955
|
const retry = getRetryCount(test.retry);
|
|
3890
3956
|
for (let retryCount = 0; retryCount <= retry; retryCount++) {
|
|
3957
|
+
if (retryCount > 0 || repeatCount > 0) resetContextSignal(test.context);
|
|
3891
3958
|
const attemptStart = now();
|
|
3892
3959
|
const attemptStartTime = unixNow();
|
|
3893
3960
|
const attemptErrorsStart = test.result.errors?.length ?? 0;
|
|
@@ -4113,10 +4180,7 @@ async function runSuite(suite, runner) {
|
|
|
4113
4180
|
try {
|
|
4114
4181
|
await $("suite.afterAll", () => callSuiteHook(suite, suite, "afterAll", runner, [suite]));
|
|
4115
4182
|
if (beforeAllCleanups.length) await $("suite.cleanup", () => callCleanupHooks(runner, beforeAllCleanups));
|
|
4116
|
-
if (suite.file === suite)
|
|
4117
|
-
const contexts = TestFixtures.getFileContexts(suite.file);
|
|
4118
|
-
await Promise.all(contexts.map((context) => callFixtureCleanup(context)));
|
|
4119
|
-
}
|
|
4183
|
+
if (suite.file === suite) await callFixtureCleanups(TestFixtures.getFileContexts(suite.file));
|
|
4120
4184
|
} catch (e) {
|
|
4121
4185
|
failTask(suite.result, e, runner.config._diffOptions);
|
|
4122
4186
|
}
|
|
@@ -4199,7 +4263,7 @@ async function startTests(specs, runner) {
|
|
|
4199
4263
|
};
|
|
4200
4264
|
if (!workerRunners.has(runner)) {
|
|
4201
4265
|
runner.onCleanupWorkerContext?.(async () => {
|
|
4202
|
-
await
|
|
4266
|
+
await callFixtureCleanups(Array.from(TestFixtures.getWorkerContexts())).finally(() => {
|
|
4203
4267
|
TestFixtures.clearDefinitions();
|
|
4204
4268
|
});
|
|
4205
4269
|
});
|
|
@@ -4228,4 +4292,4 @@ async function publicCollect(specs, runner) {
|
|
|
4228
4292
|
return files;
|
|
4229
4293
|
}
|
|
4230
4294
|
|
|
4231
|
-
export {
|
|
4295
|
+
export { test as A, limitConcurrency as B, createTagsFilter as C, validateTags as D, shuffle as E, TestSyntaxError as T, processError as a, printDiffOrStringify as b, getCurrentTest as c, diff as d, recordArtifact as e, createTaskCollector as f, getRunningTests as g, getCurrentSuite as h, createChainable as i, getHooks as j, getFn as k, afterAll as l, matchesTags as m, afterEach as n, aroundAll as o, publicCollect as p, aroundEach as q, replaceAsymmetricMatcher as r, startTests as s, beforeAll as t, beforeEach as u, describe as v, it as w, onTestFailed as x, onTestFinished as y, suite as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as setSafeTimers } from './source-map.
|
|
2
|
-
import { a as addSerializer } from './plugins.
|
|
1
|
+
import { s as setSafeTimers } from './source-map.DPHGMWvM.js';
|
|
2
|
+
import { a as addSerializer } from './plugins.BPruPOR8.js';
|
|
3
3
|
|
|
4
4
|
let globalSetup = false;
|
|
5
5
|
async function setupCommonEnv(config) {
|
|
@@ -7,7 +7,7 @@ async function setupCommonEnv(config) {
|
|
|
7
7
|
if (globalSetup) return;
|
|
8
8
|
globalSetup = true;
|
|
9
9
|
setSafeTimers();
|
|
10
|
-
if (config.globals) (await import('./globals.
|
|
10
|
+
if (config.globals) (await import('./globals.Mxora3_v.js')).registerApiGlobally();
|
|
11
11
|
}
|
|
12
12
|
function setupDefines(config) {
|
|
13
13
|
for (const key in config.defines) globalThis[key] = config.defines[key];
|