vitest 4.0.10 → 4.0.12
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 +3 -3
- package/dist/browser.js +1 -1
- package/dist/chunks/{base.BFVArrYW.js → base.CDEiaaLz.js} +46 -39
- package/dist/chunks/{browser.d.DnU_kh8a.d.ts → browser.d.Bq3zc1l_.d.ts} +1 -1
- package/dist/chunks/{cac.D9CYcNPM.js → cac.D9QaLeSz.js} +21 -7
- package/dist/chunks/{cli-api.RnIE1JbW.js → cli-api.BJh-POxZ.js} +914 -297
- package/dist/chunks/{coverage.BUlIqJrL.js → coverage.CtyeYmKM.js} +7 -1
- package/dist/chunks/{creator.DU9qFjsW.js → creator.DAmOKTvJ.js} +3 -3
- package/dist/chunks/{global.d.BQDgW9Pr.d.ts → global.d.Dheepru6.d.ts} +1 -1
- package/dist/chunks/{globals.NLOzC_A5.js → globals.C0izxiX3.js} +1 -1
- package/dist/chunks/{index.B8lJfb0J.js → index.CMvpbrsJ.js} +1 -1
- package/dist/chunks/{index.Dua7TZg_.js → index.CQwQ_SLL.js} +16 -4
- package/dist/chunks/{index.DZ-mI_Nm.js → index.DBx1AtPJ.js} +2 -1
- package/dist/chunks/{index.BYek7GgP.js → index.DWDW6mLz.js} +10 -1
- package/dist/chunks/{init-forks.BZSlxfwV.js → init-forks.FphdQhPI.js} +5 -5
- package/dist/chunks/{init-threads.CwE2n-Bv.js → init-threads.BfqfWDNi.js} +3 -3
- package/dist/chunks/{init.Cz2kTB9a.js → init.D-GGeAxo.js} +59 -21
- package/dist/chunks/{moduleRunner.d.BxT-OjLR.d.ts → moduleRunner.d.RBEiFdiW.d.ts} +5 -1
- package/dist/chunks/plugin.d.DGpEw-QV.d.ts +38 -0
- package/dist/chunks/{reporters.d.keG-yFSu.d.ts → reporters.d.C2PtoEFY.d.ts} +107 -47
- package/dist/chunks/{setup-common.BOzbXE3x.js → setup-common.DGHc_BUK.js} +1 -1
- package/dist/chunks/{startModuleRunner.DLjmA_wU.js → startModuleRunner.BEYtrq5Y.js} +97 -49
- package/dist/chunks/{test.BPErLMrw.js → test.DqQZzsWf.js} +14 -4
- package/dist/chunks/traces.U4xDYhzZ.js +172 -0
- package/dist/chunks/{config.d.BTfZNUu9.d.ts → traces.d.Brik_NWu.d.ts} +21 -1
- package/dist/chunks/{vm.wSHjz-et.js → vm.tWlKAMXr.js} +12 -8
- package/dist/chunks/{worker.d.ZGohxCEd.d.ts → worker.d.Dxl5oW0C.d.ts} +4 -4
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +7 -7
- package/dist/coverage.d.ts +5 -5
- package/dist/coverage.js +2 -2
- package/dist/index.d.ts +11 -10
- package/dist/index.js +2 -2
- package/dist/module-evaluator.d.ts +3 -3
- package/dist/module-evaluator.js +14 -1
- package/dist/module-runner.js +2 -1
- package/dist/node.d.ts +10 -10
- package/dist/node.js +8 -7
- package/dist/reporters.d.ts +5 -5
- package/dist/reporters.js +2 -2
- package/dist/runners.d.ts +4 -1
- package/dist/runners.js +1 -1
- package/dist/worker.d.ts +7 -7
- package/dist/worker.js +8 -7
- package/dist/workers/forks.js +9 -8
- package/dist/workers/runVmTests.js +22 -20
- package/dist/workers/threads.js +9 -8
- package/dist/workers/vmForks.js +5 -4
- package/dist/workers/vmThreads.js +5 -4
- package/package.json +17 -12
- package/dist/chunks/plugin.d.C6KrdvNG.d.ts +0 -9
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
class Traces {
|
|
2
|
+
/**
|
|
3
|
+
* otel stands for OpenTelemetry
|
|
4
|
+
*/
|
|
5
|
+
#otel = null;
|
|
6
|
+
#sdk = null;
|
|
7
|
+
#init = null;
|
|
8
|
+
#noopSpan = createNoopSpan();
|
|
9
|
+
#noopContext = createNoopContext();
|
|
10
|
+
constructor(options) {
|
|
11
|
+
if (options.enabled) {
|
|
12
|
+
const apiInit = import('@opentelemetry/api').then((api) => {
|
|
13
|
+
this.#otel = {
|
|
14
|
+
tracer: api.trace.getTracer(options.tracerName || "vitest"),
|
|
15
|
+
context: api.context,
|
|
16
|
+
propagation: api.propagation,
|
|
17
|
+
trace: api.trace,
|
|
18
|
+
SpanKind: api.SpanKind,
|
|
19
|
+
SpanStatusCode: api.SpanStatusCode
|
|
20
|
+
};
|
|
21
|
+
}).catch(() => {
|
|
22
|
+
throw new Error(`"@opentelemetry/api" is not installed locally. Make sure you have setup OpenTelemetry instrumentation: https://vitest.dev/guide/open-telemetry`);
|
|
23
|
+
});
|
|
24
|
+
const sdkInit = (options.sdkPath ? import(options.sdkPath) : Promise.resolve()).catch((cause) => {
|
|
25
|
+
throw new Error(`Failed to import custom OpenTelemetry SDK script (${options.sdkPath}): ${cause.message}`);
|
|
26
|
+
});
|
|
27
|
+
this.#init = Promise.all([sdkInit, apiInit]).then(([sdk]) => {
|
|
28
|
+
if (sdk != null) {
|
|
29
|
+
if (sdk.default != null && typeof sdk.default === "object" && typeof sdk.default.shutdown === "function") this.#sdk = sdk.default;
|
|
30
|
+
else if (options.watchMode !== true && process.env.VITEST_MODE !== "watch") console.warn(`OpenTelemetry instrumentation module (${options.sdkPath}) does not have a default export with a "shutdown" method. Vitest won't be able to ensure that all traces are processed in time. Try running Vitest in watch mode instead.`);
|
|
31
|
+
}
|
|
32
|
+
}).finally(() => {
|
|
33
|
+
this.#init = null;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
isEnabled() {
|
|
38
|
+
return !!this.#otel;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
async waitInit() {
|
|
44
|
+
if (this.#init) await this.#init;
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
startContextSpan(name, currentContext) {
|
|
51
|
+
if (!this.#otel) return {
|
|
52
|
+
span: this.#noopSpan,
|
|
53
|
+
context: this.#noopContext
|
|
54
|
+
};
|
|
55
|
+
const activeContext = currentContext || this.#otel.context.active();
|
|
56
|
+
const span = this.#otel.tracer.startSpan(name, {}, activeContext);
|
|
57
|
+
return {
|
|
58
|
+
span,
|
|
59
|
+
context: this.#otel.trace.setSpan(activeContext, span)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
getContextFromCarrier(carrier) {
|
|
66
|
+
if (!this.#otel) return this.#noopContext;
|
|
67
|
+
const activeContext = this.#otel.context.active();
|
|
68
|
+
if (!carrier) return activeContext;
|
|
69
|
+
return this.#otel.propagation.extract(activeContext, carrier);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
getContextCarrier(context) {
|
|
75
|
+
if (!this.#otel) return;
|
|
76
|
+
const carrier = {};
|
|
77
|
+
this.#otel.propagation.inject(context || this.#otel.context.active(), carrier);
|
|
78
|
+
return carrier;
|
|
79
|
+
}
|
|
80
|
+
#callActiveSpan(span, callback) {
|
|
81
|
+
const otel = this.#otel;
|
|
82
|
+
let result;
|
|
83
|
+
try {
|
|
84
|
+
result = callback(span);
|
|
85
|
+
if (result instanceof Promise) return result.catch((error) => {
|
|
86
|
+
span.recordException({
|
|
87
|
+
name: error.name,
|
|
88
|
+
message: error.message,
|
|
89
|
+
stack: error.stack
|
|
90
|
+
});
|
|
91
|
+
span.setStatus({ code: otel.SpanStatusCode.ERROR });
|
|
92
|
+
throw error;
|
|
93
|
+
}).finally(() => span.end());
|
|
94
|
+
return result;
|
|
95
|
+
} catch (error) {
|
|
96
|
+
if (error instanceof Error) {
|
|
97
|
+
span.recordException({
|
|
98
|
+
name: error.name,
|
|
99
|
+
message: error.message,
|
|
100
|
+
stack: error.stack
|
|
101
|
+
});
|
|
102
|
+
span.setStatus({ code: otel.SpanStatusCode.ERROR });
|
|
103
|
+
}
|
|
104
|
+
throw error;
|
|
105
|
+
} finally {
|
|
106
|
+
// end sync callbcak
|
|
107
|
+
if (!(result instanceof Promise)) span.end();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
$(name, optionsOrFn, fn) {
|
|
114
|
+
const callback = typeof optionsOrFn === "function" ? optionsOrFn : fn;
|
|
115
|
+
if (!this.#otel) return callback(this.#noopSpan);
|
|
116
|
+
const otel = this.#otel;
|
|
117
|
+
const options = typeof optionsOrFn === "function" ? {} : optionsOrFn;
|
|
118
|
+
const context = options.context;
|
|
119
|
+
if (context) return otel.tracer.startActiveSpan(name, options, context, (span) => this.#callActiveSpan(span, callback));
|
|
120
|
+
return otel.tracer.startActiveSpan(name, options, (span) => this.#callActiveSpan(span, callback));
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
startSpan(name, options, context) {
|
|
126
|
+
if (!this.#otel) return this.#noopSpan;
|
|
127
|
+
const { tracer } = this.#otel;
|
|
128
|
+
return tracer.startSpan(name, options, context);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
async finish() {
|
|
134
|
+
await this.#sdk?.shutdown();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function noopSpan() {
|
|
138
|
+
return this;
|
|
139
|
+
}
|
|
140
|
+
function createNoopSpan() {
|
|
141
|
+
return {
|
|
142
|
+
setAttribute: noopSpan,
|
|
143
|
+
setStatus: noopSpan,
|
|
144
|
+
addEvent: noopSpan,
|
|
145
|
+
addLink: noopSpan,
|
|
146
|
+
addLinks: noopSpan,
|
|
147
|
+
setAttributes: noopSpan,
|
|
148
|
+
updateName: noopSpan,
|
|
149
|
+
end: () => {},
|
|
150
|
+
isRecording: () => false,
|
|
151
|
+
recordException: noopSpan,
|
|
152
|
+
spanContext() {
|
|
153
|
+
return {
|
|
154
|
+
spanId: "",
|
|
155
|
+
traceFlags: 0,
|
|
156
|
+
traceId: ""
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function noopContext() {
|
|
162
|
+
return this;
|
|
163
|
+
}
|
|
164
|
+
function createNoopContext() {
|
|
165
|
+
return {
|
|
166
|
+
getValue: noopContext,
|
|
167
|
+
setValue: noopContext,
|
|
168
|
+
deleteValue: noopContext
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export { Traces as T };
|
|
@@ -180,6 +180,9 @@ interface SerializedConfig {
|
|
|
180
180
|
includeSamples: boolean;
|
|
181
181
|
} | undefined;
|
|
182
182
|
serializedDefines: string;
|
|
183
|
+
experimental: {
|
|
184
|
+
fsModuleCache: boolean;
|
|
185
|
+
};
|
|
183
186
|
}
|
|
184
187
|
interface SerializedCoverageConfig {
|
|
185
188
|
provider: "istanbul" | "v8" | "custom" | undefined;
|
|
@@ -198,4 +201,21 @@ type RuntimeConfig = Pick<SerializedConfig, "allowOnly" | "testTimeout" | "hookT
|
|
|
198
201
|
type RuntimeOptions = Partial<RuntimeConfig>;
|
|
199
202
|
type BrowserTraceViewMode = "on" | "off" | "on-first-retry" | "on-all-retries" | "retain-on-failure";
|
|
200
203
|
|
|
201
|
-
|
|
204
|
+
interface OTELCarrier {
|
|
205
|
+
traceparent?: string;
|
|
206
|
+
tracestate?: string;
|
|
207
|
+
}
|
|
208
|
+
interface TracesOptions {
|
|
209
|
+
enabled: boolean;
|
|
210
|
+
watchMode?: boolean;
|
|
211
|
+
sdkPath?: string;
|
|
212
|
+
tracerName?: string;
|
|
213
|
+
}
|
|
214
|
+
declare class Traces {
|
|
215
|
+
#private;
|
|
216
|
+
constructor(options: TracesOptions);
|
|
217
|
+
isEnabled(): boolean;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export { Traces as T };
|
|
221
|
+
export type { BrowserTraceViewMode as B, FakeTimerInstallOpts as F, OTELCarrier as O, RuntimeOptions as R, SerializedConfig as S, SerializedCoverageConfig as a, RuntimeConfig as b };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
2
2
|
import vm, { isContext, runInContext } from 'node:vm';
|
|
3
3
|
import { dirname, basename, extname, normalize, resolve } from 'pathe';
|
|
4
|
-
import { l as loadEnvironment } from './init.
|
|
4
|
+
import { l as loadEnvironment } from './init.D-GGeAxo.js';
|
|
5
5
|
import { distDir } from '../path.js';
|
|
6
6
|
import { createCustomConsole } from './console.Cf-YriPC.js';
|
|
7
7
|
import fs from 'node:fs';
|
|
@@ -11,7 +11,7 @@ import { findNearestPackageData } from '@vitest/utils/resolver';
|
|
|
11
11
|
import { dirname as dirname$1 } from 'node:path';
|
|
12
12
|
import { CSS_LANGS_RE, KNOWN_ASSET_RE } from '@vitest/utils/constants';
|
|
13
13
|
import { getDefaultRequestStubs } from '../module-evaluator.js';
|
|
14
|
-
import { s as startVitestModuleRunner, c as createNodeImportMeta, a as VITEST_VM_CONTEXT_SYMBOL } from './startModuleRunner.
|
|
14
|
+
import { s as startVitestModuleRunner, c as createNodeImportMeta, a as VITEST_VM_CONTEXT_SYMBOL } from './startModuleRunner.BEYtrq5Y.js';
|
|
15
15
|
import { p as provideWorkerState } from './utils.DvEY5TfP.js';
|
|
16
16
|
|
|
17
17
|
function interopCommonJsModule(interopDefault, mod) {
|
|
@@ -671,17 +671,20 @@ class FileMap {
|
|
|
671
671
|
const entryFile = pathToFileURL(resolve(distDir, "workers/runVmTests.js")).href;
|
|
672
672
|
const fileMap = new FileMap();
|
|
673
673
|
const packageCache = /* @__PURE__ */ new Map();
|
|
674
|
-
async function runVmTests(method, state) {
|
|
674
|
+
async function runVmTests(method, state, traces) {
|
|
675
675
|
const { ctx, rpc } = state;
|
|
676
676
|
const beforeEnvironmentTime = performance.now();
|
|
677
|
-
const { environment } = await loadEnvironment(ctx.environment.name, ctx.config.root, rpc);
|
|
677
|
+
const { environment } = await loadEnvironment(ctx.environment.name, ctx.config.root, rpc, traces);
|
|
678
678
|
state.environment = environment;
|
|
679
679
|
if (!environment.setupVM) {
|
|
680
680
|
const envName = ctx.environment.name;
|
|
681
681
|
const packageId = envName[0] === "." ? envName : `vitest-environment-${envName}`;
|
|
682
682
|
throw new TypeError(`Environment "${ctx.environment.name}" is not a valid environment. Path "${packageId}" doesn't support vm environment because it doesn't provide "setupVM" method.`);
|
|
683
683
|
}
|
|
684
|
-
const vm = await
|
|
684
|
+
const vm = await traces.$("vitest.runtime.environment.setup", { attributes: {
|
|
685
|
+
"vitest.environment": environment.name,
|
|
686
|
+
"vitest.environment.vite_environment": environment.viteEnvironment || environment.name
|
|
687
|
+
} }, () => environment.setupVM(ctx.environment.options || ctx.config.environmentOptions || {}));
|
|
685
688
|
state.durations.environment = performance.now() - beforeEnvironmentTime;
|
|
686
689
|
process.env.VITEST_VM_POOL = "1";
|
|
687
690
|
if (!vm.getVmContext) throw new TypeError(`Environment ${environment.name} doesn't provide "getVmContext" method. It should return a context created by "vm.createContext" method.`);
|
|
@@ -710,7 +713,8 @@ async function runVmTests(method, state) {
|
|
|
710
713
|
evaluatedModules: state.evaluatedModules,
|
|
711
714
|
state,
|
|
712
715
|
externalModulesExecutor,
|
|
713
|
-
createImportMeta: createNodeImportMeta
|
|
716
|
+
createImportMeta: createNodeImportMeta,
|
|
717
|
+
traces
|
|
714
718
|
});
|
|
715
719
|
Object.defineProperty(context, VITEST_VM_CONTEXT_SYMBOL, {
|
|
716
720
|
value: {
|
|
@@ -734,9 +738,9 @@ async function runVmTests(method, state) {
|
|
|
734
738
|
testLocations: void 0
|
|
735
739
|
} : f);
|
|
736
740
|
try {
|
|
737
|
-
await run(method, fileSpecs, ctx.config, moduleRunner);
|
|
741
|
+
await run(method, fileSpecs, ctx.config, moduleRunner, traces);
|
|
738
742
|
} finally {
|
|
739
|
-
await vm.teardown?.();
|
|
743
|
+
await traces.$("vitest.runtime.environment.teardown", () => vm.teardown?.());
|
|
740
744
|
}
|
|
741
745
|
}
|
|
742
746
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CancelReason, File,
|
|
1
|
+
import { CancelReason, File, TestArtifact, TaskResultPack, TaskEventPack, FileSpecification, Task } from '@vitest/runner';
|
|
2
2
|
import { FetchFunctionOptions, FetchResult, EvaluatedModules } from 'vite/module-runner';
|
|
3
|
-
import { S as SerializedConfig } from './
|
|
3
|
+
import { O as OTELCarrier, S as SerializedConfig } from './traces.d.Brik_NWu.js';
|
|
4
4
|
import { E as Environment } from './environment.d.CrsxCzP1.js';
|
|
5
5
|
import { SnapshotResult } from '@vitest/snapshot';
|
|
6
6
|
|
|
@@ -208,7 +208,7 @@ interface Request {
|
|
|
208
208
|
declare const setTimeout: typeof globalThis.setTimeout;
|
|
209
209
|
|
|
210
210
|
interface RuntimeRPC {
|
|
211
|
-
fetch: (id: string, importer: string | undefined, environment: string, options?: FetchFunctionOptions) => Promise<FetchResult | FetchCachedFileSystemResult>;
|
|
211
|
+
fetch: (id: string, importer: string | undefined, environment: string, options?: FetchFunctionOptions, otelCarrier?: OTELCarrier) => Promise<FetchResult | FetchCachedFileSystemResult>;
|
|
212
212
|
resolve: (id: string, importer: string | undefined, environment: string) => Promise<ResolveFunctionResult | null>;
|
|
213
213
|
transform: (id: string) => Promise<{
|
|
214
214
|
code?: string;
|
|
@@ -218,7 +218,7 @@ interface RuntimeRPC {
|
|
|
218
218
|
onQueued: (file: File) => void;
|
|
219
219
|
onCollected: (files: File[]) => Promise<void>;
|
|
220
220
|
onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void;
|
|
221
|
-
|
|
221
|
+
onTaskArtifactRecord: <Artifact extends TestArtifact>(testId: string, artifact: Artifact) => Promise<Artifact>;
|
|
222
222
|
onTaskUpdate: (pack: TaskResultPack[], events: TaskEventPack[]) => Promise<void>;
|
|
223
223
|
onCancel: (reason: CancelReason) => void;
|
|
224
224
|
getCountOfFailedTests: () => number;
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as createCLI } from './chunks/cac.
|
|
1
|
+
import { c as createCLI } from './chunks/cac.D9QaLeSz.js';
|
|
2
2
|
import '@vitest/utils/helpers';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import 'tinyrainbow';
|
|
6
6
|
import './chunks/constants.D_Q9UYh-.js';
|
|
7
|
-
import './chunks/index.
|
|
7
|
+
import './chunks/index.DWDW6mLz.js';
|
|
8
8
|
import 'node:fs';
|
|
9
9
|
import 'node:fs/promises';
|
|
10
10
|
import 'node:perf_hooks';
|
package/dist/config.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { HookHandler, ConfigEnv, UserConfig } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { I as InlineConfig, c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport } from './chunks/reporters.d.
|
|
4
|
-
export {
|
|
5
|
-
import { V as VitestPluginContext } from './chunks/plugin.d.
|
|
6
|
-
import { F as FakeTimerInstallOpts } from './chunks/
|
|
3
|
+
import { I as InlineConfig, c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport } from './chunks/reporters.d.C2PtoEFY.js';
|
|
4
|
+
export { b as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.C2PtoEFY.js';
|
|
5
|
+
import { V as VitestPluginContext } from './chunks/plugin.d.DGpEw-QV.js';
|
|
6
|
+
import { F as FakeTimerInstallOpts } from './chunks/traces.d.Brik_NWu.js';
|
|
7
7
|
import '@vitest/runner';
|
|
8
8
|
import '@vitest/utils';
|
|
9
|
-
import './chunks/worker.d.
|
|
9
|
+
import './chunks/worker.d.Dxl5oW0C.js';
|
|
10
10
|
import 'vite/module-runner';
|
|
11
11
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
12
12
|
import '@vitest/snapshot';
|
|
@@ -14,7 +14,7 @@ import 'node:stream';
|
|
|
14
14
|
import '@vitest/mocker';
|
|
15
15
|
import '@vitest/utils/source-map';
|
|
16
16
|
import 'vitest/browser';
|
|
17
|
-
import './chunks/browser.d.
|
|
17
|
+
import './chunks/browser.d.Bq3zc1l_.js';
|
|
18
18
|
import '@vitest/pretty-format';
|
|
19
19
|
import '@vitest/utils/diff';
|
|
20
20
|
import '@vitest/expect';
|
|
@@ -24,8 +24,8 @@ import '@vitest/runner/utils';
|
|
|
24
24
|
import 'tinybench';
|
|
25
25
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
26
26
|
import '@vitest/snapshot/manager';
|
|
27
|
-
import 'node:fs';
|
|
28
27
|
import 'node:console';
|
|
28
|
+
import 'node:fs';
|
|
29
29
|
|
|
30
30
|
type VitestInlineConfig = InlineConfig;
|
|
31
31
|
declare module "vite" {
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap,
|
|
1
|
+
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.d.C2PtoEFY.js';
|
|
2
2
|
import { TransformResult } from 'vite';
|
|
3
|
-
import { A as AfterSuiteRunMeta } from './chunks/worker.d.
|
|
3
|
+
import { A as AfterSuiteRunMeta } from './chunks/worker.d.Dxl5oW0C.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import '@vitest/utils';
|
|
6
6
|
import 'node:stream';
|
|
7
7
|
import '@vitest/mocker';
|
|
8
8
|
import '@vitest/utils/source-map';
|
|
9
9
|
import 'vitest/browser';
|
|
10
|
-
import './chunks/
|
|
10
|
+
import './chunks/traces.d.Brik_NWu.js';
|
|
11
11
|
import '@vitest/pretty-format';
|
|
12
12
|
import '@vitest/snapshot';
|
|
13
13
|
import '@vitest/utils/diff';
|
|
14
|
-
import './chunks/browser.d.
|
|
14
|
+
import './chunks/browser.d.Bq3zc1l_.js';
|
|
15
15
|
import '@vitest/expect';
|
|
16
16
|
import 'vitest/optional-types.js';
|
|
17
17
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
@@ -19,8 +19,8 @@ import '@vitest/runner/utils';
|
|
|
19
19
|
import 'tinybench';
|
|
20
20
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
21
21
|
import '@vitest/snapshot/manager';
|
|
22
|
-
import 'node:fs';
|
|
23
22
|
import 'node:console';
|
|
23
|
+
import 'node:fs';
|
|
24
24
|
import 'vite/module-runner';
|
|
25
25
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
26
26
|
|
package/dist/coverage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseCoverageProvider } from './chunks/coverage.
|
|
1
|
+
export { B as BaseCoverageProvider } from './chunks/coverage.CtyeYmKM.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'node:path';
|
|
4
4
|
import '@vitest/utils/helpers';
|
|
@@ -11,10 +11,10 @@ import 'node:os';
|
|
|
11
11
|
import './chunks/env.D4Lgay0q.js';
|
|
12
12
|
import 'std-env';
|
|
13
13
|
import 'node:crypto';
|
|
14
|
+
import 'node:url';
|
|
14
15
|
import 'node:module';
|
|
15
16
|
import 'node:process';
|
|
16
17
|
import 'node:fs/promises';
|
|
17
|
-
import 'node:url';
|
|
18
18
|
import 'node:assert';
|
|
19
19
|
import 'node:v8';
|
|
20
20
|
import 'node:util';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { S as SerializedTestSpecification } from './chunks/browser.d.
|
|
2
|
-
export { B as BrowserTesterOptions } from './chunks/browser.d.
|
|
3
|
-
import './chunks/global.d.
|
|
4
|
-
import { File, TestAnnotation, TaskResultPack, TaskEventPack, TaskPopulated } from '@vitest/runner';
|
|
5
|
-
export { CancelReason, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskEventPack as RunnerTaskEventPack, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
1
|
+
import { S as SerializedTestSpecification } from './chunks/browser.d.Bq3zc1l_.js';
|
|
2
|
+
export { B as BrowserTesterOptions } from './chunks/browser.d.Bq3zc1l_.js';
|
|
3
|
+
import './chunks/global.d.Dheepru6.js';
|
|
4
|
+
import { File, TestAnnotation, TestArtifact, TaskResultPack, TaskEventPack, Test, TaskPopulated } from '@vitest/runner';
|
|
5
|
+
export { CancelReason, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskEventPack as RunnerTaskEventPack, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestAnnotationArtifact, TestArtifact, TestArtifactBase, TestArtifactLocation, TestArtifactRegistry, TestAttachment, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
|
|
6
6
|
import { Awaitable } from '@vitest/utils';
|
|
7
7
|
export { ParsedStack, SerializedError, TestError } from '@vitest/utils';
|
|
8
|
-
import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, b as BirpcReturn, P as ProvidedContext } from './chunks/worker.d.
|
|
9
|
-
export { A as AfterSuiteRunMeta, C as ContextRPC, d as ContextTestEnvironment, c as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.
|
|
10
|
-
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/
|
|
11
|
-
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/
|
|
8
|
+
import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, b as BirpcReturn, P as ProvidedContext } from './chunks/worker.d.Dxl5oW0C.js';
|
|
9
|
+
export { A as AfterSuiteRunMeta, C as ContextRPC, d as ContextTestEnvironment, c as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.Dxl5oW0C.js';
|
|
10
|
+
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/traces.d.Brik_NWu.js';
|
|
11
|
+
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/traces.d.Brik_NWu.js';
|
|
12
12
|
import { ExpectStatic } from '@vitest/expect';
|
|
13
13
|
export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, Matchers, chai } from '@vitest/expect';
|
|
14
14
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
@@ -69,6 +69,7 @@ interface WebSocketEvents {
|
|
|
69
69
|
onCollected?: (files?: File[]) => Awaitable<void>;
|
|
70
70
|
onFinished?: (files: File[], errors: unknown[], coverage?: unknown, executionTime?: number) => Awaitable<void>;
|
|
71
71
|
onTestAnnotate?: (testId: string, annotation: TestAnnotation) => Awaitable<void>;
|
|
72
|
+
onTestArtifactRecord?: (testId: string, artifact: TestArtifact) => Awaitable<void>;
|
|
72
73
|
onTaskUpdate?: (packs: TaskResultPack[], events: TaskEventPack[]) => Awaitable<void>;
|
|
73
74
|
onUserConsoleLog?: (log: UserConsoleLog) => Awaitable<void>;
|
|
74
75
|
onPathsCollected?: (paths?: string[]) => Awaitable<void>;
|
|
@@ -77,7 +78,7 @@ interface WebSocketEvents {
|
|
|
77
78
|
}
|
|
78
79
|
type WebSocketRPC = BirpcReturn<WebSocketEvents, WebSocketHandlers>;
|
|
79
80
|
|
|
80
|
-
declare function createExpect(test?: TaskPopulated): ExpectStatic;
|
|
81
|
+
declare function createExpect(test?: Test | TaskPopulated): ExpectStatic;
|
|
81
82
|
declare const globalExpect: ExpectStatic;
|
|
82
83
|
declare const assert: Chai.Assert;
|
|
83
84
|
declare const should: () => Chai.Should;
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { b as assert, c as createExpect, g as expect, i as inject, s as should, v as vi, d as vitest } from './chunks/vi.BiaV1qII.js';
|
|
2
2
|
export { b as bench } from './chunks/benchmark.B3N2zMcH.js';
|
|
3
3
|
export { V as EvaluatedModules } from './chunks/evaluatedModules.Dg1zASAC.js';
|
|
4
|
-
export { a as assertType } from './chunks/index.
|
|
4
|
+
export { a as assertType } from './chunks/index.DBx1AtPJ.js';
|
|
5
5
|
export { expectTypeOf } from 'expect-type';
|
|
6
|
-
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
6
|
+
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
|
|
7
7
|
export { chai } from '@vitest/expect';
|
|
8
8
|
import '@vitest/runner/utils';
|
|
9
9
|
import './chunks/utils.DvEY5TfP.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import 'vite/module-runner';
|
|
2
|
-
export { b as VitestModuleEvaluator, a as VitestModuleEvaluatorOptions, c as createImportMetaEnvProxy, g as getDefaultRequestStubs, i as isPrimitive, u as unwrapId, w as wrapId } from './chunks/moduleRunner.d.
|
|
2
|
+
export { b as VitestModuleEvaluator, a as VitestModuleEvaluatorOptions, c as createImportMetaEnvProxy, g as getDefaultRequestStubs, i as isPrimitive, u as unwrapId, w as wrapId } from './chunks/moduleRunner.d.RBEiFdiW.js';
|
|
3
3
|
import 'node:vm';
|
|
4
4
|
import '@vitest/spy';
|
|
5
|
-
import './chunks/worker.d.
|
|
5
|
+
import './chunks/worker.d.Dxl5oW0C.js';
|
|
6
6
|
import '@vitest/runner';
|
|
7
|
-
import './chunks/
|
|
7
|
+
import './chunks/traces.d.Brik_NWu.js';
|
|
8
8
|
import '@vitest/pretty-format';
|
|
9
9
|
import '@vitest/snapshot';
|
|
10
10
|
import '@vitest/utils/diff';
|
package/dist/module-evaluator.js
CHANGED
|
@@ -3,6 +3,7 @@ import { pathToFileURL } from 'node:url';
|
|
|
3
3
|
import vm from 'node:vm';
|
|
4
4
|
import { isAbsolute } from 'pathe';
|
|
5
5
|
import { ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey } from 'vite/module-runner';
|
|
6
|
+
import { T as Traces } from './chunks/traces.U4xDYhzZ.js';
|
|
6
7
|
|
|
7
8
|
const performanceNow = performance.now.bind(performance);
|
|
8
9
|
class ModuleDebug {
|
|
@@ -38,8 +39,10 @@ class VitestModuleEvaluator {
|
|
|
38
39
|
compiledFunctionArgumentsValues = [];
|
|
39
40
|
primitives;
|
|
40
41
|
debug = new ModuleDebug();
|
|
42
|
+
_otel;
|
|
41
43
|
constructor(vmOptions, options = {}) {
|
|
42
44
|
this.options = options;
|
|
45
|
+
this._otel = options.traces || new Traces({ enabled: false });
|
|
43
46
|
this.vm = vmOptions;
|
|
44
47
|
this.stubs = getDefaultRequestStubs(vmOptions?.context);
|
|
45
48
|
if (options.compiledFunctionArgumentsNames) this.compiledFunctionArgumentsNames = options.compiledFunctionArgumentsNames;
|
|
@@ -53,6 +56,7 @@ class VitestModuleEvaluator {
|
|
|
53
56
|
}
|
|
54
57
|
convertIdToImportUrl(id) {
|
|
55
58
|
// TODO: vitest returns paths for external modules, but Vite returns file://
|
|
59
|
+
// REMOVE WHEN VITE 6 SUPPORT IS OVER
|
|
56
60
|
// unfortunetly, there is a bug in Vite where ID is resolved incorrectly, so we can't return files until the fix is merged
|
|
57
61
|
// https://github.com/vitejs/vite/pull/20449
|
|
58
62
|
if (!isWindows || isBuiltin(id) || /^(?:node:|data:|http:|https:|file:)/.test(id)) return id;
|
|
@@ -63,7 +67,7 @@ class VitestModuleEvaluator {
|
|
|
63
67
|
async runExternalModule(id) {
|
|
64
68
|
if (id in this.stubs) return this.stubs[id];
|
|
65
69
|
const file = this.convertIdToImportUrl(id);
|
|
66
|
-
const namespace = this.vm ?
|
|
70
|
+
const namespace = await this._otel.$("vitest.module.external", { attributes: { "code.file.path": file } }, () => this.vm ? this.vm.externalModulesExecutor.import(file) : import(file));
|
|
67
71
|
if (!this.shouldInterop(file, namespace)) return namespace;
|
|
68
72
|
const { mod, defaultExport } = interopModule(namespace);
|
|
69
73
|
const { Proxy, Reflect } = this.primitives;
|
|
@@ -88,6 +92,9 @@ class VitestModuleEvaluator {
|
|
|
88
92
|
});
|
|
89
93
|
}
|
|
90
94
|
async runInlinedModule(context, code, module) {
|
|
95
|
+
return this._otel.$("vitest.module.inline", (span) => this._runInlinedModule(context, code, module, span));
|
|
96
|
+
}
|
|
97
|
+
async _runInlinedModule(context, code, module, span) {
|
|
91
98
|
context.__vite_ssr_import_meta__.env = this.env;
|
|
92
99
|
const { Reflect, Proxy, Object } = this.primitives;
|
|
93
100
|
const exportsObject = context[ssrModuleExportsKey];
|
|
@@ -102,9 +109,11 @@ class VitestModuleEvaluator {
|
|
|
102
109
|
},
|
|
103
110
|
getPrototypeOf: () => Object.prototype,
|
|
104
111
|
set: (_, p, value) => {
|
|
112
|
+
span.addEvent(`cjs export proxy is triggered for ${String(p)}`);
|
|
105
113
|
// treat "module.exports =" the same as "exports.default =" to not have nested "default.default",
|
|
106
114
|
// so "exports.default" becomes the actual module
|
|
107
115
|
if (p === "default" && this.shouldInterop(module.file, { default: value }) && cjsExports !== value) {
|
|
116
|
+
span.addEvent("`exports.default` is assigned, copying values");
|
|
108
117
|
exportAll(cjsExports, value);
|
|
109
118
|
exportsObject.default = value;
|
|
110
119
|
return true;
|
|
@@ -113,6 +122,7 @@ class VitestModuleEvaluator {
|
|
|
113
122
|
// returns undefined, when accessing named exports, if default is not an object
|
|
114
123
|
// but is still present inside hasOwnKeys, this is Node behaviour for CJS
|
|
115
124
|
if (moduleExports !== SYMBOL_NOT_DEFINED && isPrimitive(moduleExports)) {
|
|
125
|
+
span.addEvent(`\`exports.${String(p)}\` is assigned, but module.exports is a primitive. assigning "undefined" values instead to comply with ESM`);
|
|
116
126
|
defineExport(exportsObject, p, () => void 0);
|
|
117
127
|
return true;
|
|
118
128
|
}
|
|
@@ -123,6 +133,7 @@ class VitestModuleEvaluator {
|
|
|
123
133
|
});
|
|
124
134
|
const moduleProxy = {
|
|
125
135
|
set exports(value) {
|
|
136
|
+
span.addEvent("`module.exports` is assigned directly, copying all properties to `exports`");
|
|
126
137
|
exportAll(cjsExports, value);
|
|
127
138
|
exportsObject.default = value;
|
|
128
139
|
moduleExports = value;
|
|
@@ -138,6 +149,7 @@ class VitestModuleEvaluator {
|
|
|
138
149
|
}
|
|
139
150
|
const filename = meta.filename;
|
|
140
151
|
const dirname = meta.dirname;
|
|
152
|
+
span.setAttributes({ "code.file.path": filename });
|
|
141
153
|
const require = this.createRequire(filename);
|
|
142
154
|
const argumentsList = [
|
|
143
155
|
ssrModuleExportsKey,
|
|
@@ -153,6 +165,7 @@ class VitestModuleEvaluator {
|
|
|
153
165
|
"require"
|
|
154
166
|
];
|
|
155
167
|
if (this.compiledFunctionArgumentsNames) argumentsList.push(...this.compiledFunctionArgumentsNames);
|
|
168
|
+
span.setAttribute("vitest.module.arguments", argumentsList);
|
|
156
169
|
// add 'use strict' since ESM enables it by default
|
|
157
170
|
const codeDefinition = `'use strict';async (${argumentsList.join(",")})=>{{`;
|
|
158
171
|
const wrappedCode = `${codeDefinition}${code}\n}}`;
|
package/dist/module-runner.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export { VitestModuleEvaluator } from './module-evaluator.js';
|
|
2
|
-
export { a as VITEST_VM_CONTEXT_SYMBOL, V as VitestModuleRunner, s as startVitestModuleRunner } from './chunks/startModuleRunner.
|
|
2
|
+
export { a as VITEST_VM_CONTEXT_SYMBOL, V as VitestModuleRunner, s as startVitestModuleRunner } from './chunks/startModuleRunner.BEYtrq5Y.js';
|
|
3
3
|
export { g as getWorkerState } from './chunks/utils.DvEY5TfP.js';
|
|
4
4
|
import 'node:module';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'node:vm';
|
|
7
7
|
import 'pathe';
|
|
8
8
|
import 'vite/module-runner';
|
|
9
|
+
import './chunks/traces.U4xDYhzZ.js';
|
|
9
10
|
import 'node:fs';
|
|
10
11
|
import '@vitest/utils/helpers';
|
|
11
12
|
import './path.js';
|
package/dist/node.d.ts
CHANGED
|
@@ -3,23 +3,23 @@ import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as Res
|
|
|
3
3
|
export { vite as Vite };
|
|
4
4
|
export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
5
5
|
import { IncomingMessage } from 'node:http';
|
|
6
|
-
import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.
|
|
7
|
-
export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig,
|
|
6
|
+
import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.C2PtoEFY.js';
|
|
7
|
+
export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig, a as ReportContext, aB as ReportedHookContext, aC as Reporter, ap as ResolveSnapshotPathHandler, aq as ResolveSnapshotPathHandlerContext, af as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ao as ResolvedProjectConfig, S as SerializedTestProject, u as TaskOptions, v as TestCase, w as TestCollection, x as TestDiagnostic, y as TestModule, z as TestModuleState, B as TestResult, D as TestResultFailed, E as TestResultPassed, F as TestResultSkipped, aD as TestRunEndReason, aA as TestRunResult, X as TestSequencerConstructor, G as TestState, K as TestSuite, N as TestSuiteState, ag as ToMatchScreenshotComparators, ah as ToMatchScreenshotOptions, ar as TypecheckConfig, U as UserWorkspaceConfig, as as VitestEnvironment, p as VitestPackageInstaller, W as WatcherTriggerPattern, s as WorkerResponse, _ as _BrowserNames, Q as experimental_getRunnerTask } from './chunks/reporters.d.C2PtoEFY.js';
|
|
8
|
+
export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.d.DGpEw-QV.js';
|
|
8
9
|
import { Awaitable } from '@vitest/utils';
|
|
9
10
|
export { SerializedError } from '@vitest/utils';
|
|
10
|
-
import { R as RuntimeRPC, C as ContextRPC } from './chunks/worker.d.
|
|
11
|
-
export { T as TestExecutionType } from './chunks/worker.d.
|
|
11
|
+
import { R as RuntimeRPC, C as ContextRPC } from './chunks/worker.d.Dxl5oW0C.js';
|
|
12
|
+
export { T as TestExecutionType } from './chunks/worker.d.Dxl5oW0C.js';
|
|
12
13
|
import { Writable } from 'node:stream';
|
|
13
|
-
export { V as VitestPluginContext } from './chunks/plugin.d.C6KrdvNG.js';
|
|
14
14
|
import { Debugger } from 'debug';
|
|
15
|
-
import './chunks/global.d.
|
|
15
|
+
import './chunks/global.d.Dheepru6.js';
|
|
16
16
|
export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
17
|
-
export { b as RuntimeConfig } from './chunks/
|
|
17
|
+
export { b as RuntimeConfig } from './chunks/traces.d.Brik_NWu.js';
|
|
18
18
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
19
19
|
import '@vitest/mocker';
|
|
20
20
|
import '@vitest/utils/source-map';
|
|
21
21
|
import 'vitest/browser';
|
|
22
|
-
import './chunks/browser.d.
|
|
22
|
+
import './chunks/browser.d.Bq3zc1l_.js';
|
|
23
23
|
import '@vitest/pretty-format';
|
|
24
24
|
import '@vitest/snapshot';
|
|
25
25
|
import '@vitest/utils/diff';
|
|
@@ -29,8 +29,8 @@ import './chunks/benchmark.d.DAaHLpsq.js';
|
|
|
29
29
|
import 'tinybench';
|
|
30
30
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
31
31
|
import '@vitest/snapshot/manager';
|
|
32
|
-
import 'node:fs';
|
|
33
32
|
import 'node:console';
|
|
33
|
+
import 'node:fs';
|
|
34
34
|
import 'vite/module-runner';
|
|
35
35
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
36
36
|
|
|
@@ -139,7 +139,7 @@ interface MethodsOptions {
|
|
|
139
139
|
cacheFs?: boolean;
|
|
140
140
|
collect?: boolean;
|
|
141
141
|
}
|
|
142
|
-
declare function createMethodsRPC(project: TestProject,
|
|
142
|
+
declare function createMethodsRPC(project: TestProject, methodsOptions?: MethodsOptions): RuntimeRPC;
|
|
143
143
|
|
|
144
144
|
/** @experimental */
|
|
145
145
|
declare class ForksPoolWorker implements PoolWorker {
|