vitest 4.0.16 → 4.1.0-beta.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 +2 -1
- package/dist/browser.js +2 -1
- package/dist/chunks/{base.Bin-9uYm.js → base.CBRNZa3k.js} +8 -7
- package/dist/chunks/{browser.d.Bz3lxTX-.d.ts → browser.d.8hOapKZr.d.ts} +5 -1
- package/dist/chunks/{cac.BGonGPac.js → cac.B1v3xxoC.js} +26 -8
- package/dist/chunks/{cli-api.BKg19Fvw.js → cli-api.B4CqEpI6.js} +225 -110
- package/dist/chunks/{config.d.CzIjkicf.d.ts → config.d.idH22YSr.d.ts} +13 -11
- package/dist/chunks/{console.Cf-YriPC.js → console.uGgdMhyZ.js} +2 -1
- package/dist/chunks/{coverage.BuJUwVtg.js → coverage.BMlOMIWl.js} +18 -4
- package/dist/chunks/{creator.DAmOKTvJ.js → creator.C7WwjkuR.js} +32 -1
- package/dist/chunks/{globals.DOayXfHP.js → globals.DjuGMoMc.js} +10 -9
- package/dist/chunks/{index.Z5E_ObnR.js → index.BEFi2-_3.js} +3 -1
- package/dist/chunks/{index.6Qv1eEA6.js → index.BiOAd_ki.js} +16 -4
- package/dist/chunks/{index.BspFP3mn.js → index.CyBMJtT7.js} +1 -1
- package/dist/chunks/{index.456_DGfR.js → index.Dm4xqZ0s.js} +28 -4
- package/dist/chunks/{index.Drsj_6e7.js → index.DyBZXrH3.js} +1 -1
- package/dist/chunks/{init-forks.v9UONQS6.js → init-forks.CHeQ9Moq.js} +1 -1
- package/dist/chunks/{init-threads.DqYg3Trk.js → init-threads.uZiNAuPk.js} +1 -1
- package/dist/chunks/{init.KmQZdqFg.js → init.DVtKdFty.js} +24 -11
- package/dist/chunks/{plugin.d.v1sC_bv1.d.ts → plugin.d.D8KU2PY_.d.ts} +1 -1
- package/dist/chunks/{reporters.d.Rsi0PyxX.d.ts → reporters.d.Db3MiIWX.d.ts} +51 -22
- package/dist/chunks/rpc.HLmECnw_.js +148 -0
- package/dist/chunks/{setup-common.Cm-kSBVi.js → setup-common.BcqLPsn5.js} +1 -1
- package/dist/chunks/{startModuleRunner.DpqpB8k3.js → startModuleRunner.C5CcWyXW.js} +23 -23
- package/dist/chunks/{vi.2VT5v0um.js → test.prxIahgM.js} +500 -119
- package/dist/chunks/{traces.U4xDYhzZ.js → traces.CCmnQaNT.js} +46 -1
- package/dist/chunks/{vm.qFl6P1nF.js → vm.CrifS09m.js} +5 -8
- package/dist/chunks/{worker.d.5JNaocaN.d.ts → worker.d.Bji1eq5g.d.ts} +2 -1
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +9 -9
- package/dist/coverage.d.ts +8 -8
- package/dist/coverage.js +3 -1
- package/dist/environments.js +3 -1
- package/dist/index.d.ts +22 -10
- package/dist/index.js +8 -7
- package/dist/module-evaluator.js +2 -6
- package/dist/node.d.ts +14 -11
- package/dist/node.js +20 -20
- package/dist/reporters.d.ts +7 -7
- package/dist/reporters.js +4 -2
- package/dist/runners.d.ts +23 -4
- package/dist/runners.js +4 -4
- package/dist/runtime.d.ts +6 -0
- package/dist/runtime.js +36 -0
- package/dist/snapshot.js +2 -0
- package/dist/suite.js +2 -0
- package/dist/worker.d.ts +4 -3
- package/dist/worker.js +10 -12
- package/dist/workers/forks.js +11 -13
- package/dist/workers/runVmTests.js +10 -12
- package/dist/workers/threads.js +11 -13
- package/dist/workers/vmForks.js +8 -9
- package/dist/workers/vmThreads.js +8 -9
- package/package.json +23 -27
- package/dist/chunks/date.Bq6ZW5rf.js +0 -73
- package/dist/chunks/rpc.BoxB0q7B.js +0 -76
- package/dist/chunks/test.B8ej_ZHS.js +0 -254
- package/dist/mocker.d.ts +0 -1
- package/dist/mocker.js +0 -1
- package/dist/module-runner.js +0 -17
|
@@ -7,6 +7,9 @@ class Traces {
|
|
|
7
7
|
#init = null;
|
|
8
8
|
#noopSpan = createNoopSpan();
|
|
9
9
|
#noopContext = createNoopContext();
|
|
10
|
+
#initStartTime = performance.now();
|
|
11
|
+
#initEndTime = 0;
|
|
12
|
+
#initRecorded = false;
|
|
10
13
|
constructor(options) {
|
|
11
14
|
if (options.enabled) {
|
|
12
15
|
const apiInit = import('@opentelemetry/api').then((api) => {
|
|
@@ -21,7 +24,10 @@ class Traces {
|
|
|
21
24
|
}).catch(() => {
|
|
22
25
|
throw new Error(`"@opentelemetry/api" is not installed locally. Make sure you have setup OpenTelemetry instrumentation: https://vitest.dev/guide/open-telemetry`);
|
|
23
26
|
});
|
|
24
|
-
const sdkInit = (options.sdkPath ? import(
|
|
27
|
+
const sdkInit = (options.sdkPath ? import(
|
|
28
|
+
/* @vite-ignore */
|
|
29
|
+
options.sdkPath
|
|
30
|
+
) : Promise.resolve()).catch((cause) => {
|
|
25
31
|
throw new Error(`Failed to import custom OpenTelemetry SDK script (${options.sdkPath}): ${cause.message}`);
|
|
26
32
|
});
|
|
27
33
|
this.#init = Promise.all([sdkInit, apiInit]).then(([sdk]) => {
|
|
@@ -30,6 +36,7 @@ class Traces {
|
|
|
30
36
|
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
37
|
}
|
|
32
38
|
}).finally(() => {
|
|
39
|
+
this.#initEndTime = performance.now();
|
|
33
40
|
this.#init = null;
|
|
34
41
|
});
|
|
35
42
|
}
|
|
@@ -47,6 +54,14 @@ class Traces {
|
|
|
47
54
|
/**
|
|
48
55
|
* @internal
|
|
49
56
|
*/
|
|
57
|
+
recordInitSpan(context) {
|
|
58
|
+
if (this.#initRecorded) return;
|
|
59
|
+
this.#initRecorded = true;
|
|
60
|
+
this.startSpan("vitest.runtime.traces", { startTime: this.#initStartTime }, context).end(this.#initEndTime);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
50
65
|
startContextSpan(name, currentContext) {
|
|
51
66
|
if (!this.#otel) return {
|
|
52
67
|
span: this.#noopSpan,
|
|
@@ -71,6 +86,18 @@ class Traces {
|
|
|
71
86
|
/**
|
|
72
87
|
* @internal
|
|
73
88
|
*/
|
|
89
|
+
getContextFromEnv(env) {
|
|
90
|
+
if (!this.#otel) return this.#noopContext;
|
|
91
|
+
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/env-carriers.md
|
|
92
|
+
// some tools sets only `TRACEPARENT` but not `TRACESTATE`
|
|
93
|
+
const carrier = {};
|
|
94
|
+
if (typeof env.TRACEPARENT === "string") carrier.traceparent = env.TRACEPARENT;
|
|
95
|
+
if (typeof env.TRACESTATE === "string") carrier.tracestate = env.TRACESTATE;
|
|
96
|
+
return this.getContextFromCarrier(carrier);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
74
101
|
getContextCarrier(context) {
|
|
75
102
|
if (!this.#otel) return;
|
|
76
103
|
const carrier = {};
|
|
@@ -127,12 +154,30 @@ class Traces {
|
|
|
127
154
|
const { tracer } = this.#otel;
|
|
128
155
|
return tracer.startSpan(name, options, context);
|
|
129
156
|
}
|
|
157
|
+
// On browser mode, async context is not automatically propagated,
|
|
158
|
+
// so we manually bind the `$` calls to the provided context.
|
|
159
|
+
// TODO: this doesn't bind to user land's `@optelemetry/api` calls
|
|
160
|
+
/**
|
|
161
|
+
* @internal
|
|
162
|
+
*/
|
|
163
|
+
bind(context) {
|
|
164
|
+
if (!this.#otel) return;
|
|
165
|
+
const original = this.$.__original ?? this.$;
|
|
166
|
+
this.$ = this.#otel.context.bind(context, original);
|
|
167
|
+
this.$.__original = original;
|
|
168
|
+
}
|
|
130
169
|
/**
|
|
131
170
|
* @internal
|
|
132
171
|
*/
|
|
133
172
|
async finish() {
|
|
134
173
|
await this.#sdk?.shutdown();
|
|
135
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
178
|
+
async flush() {
|
|
179
|
+
await this.#sdk?.forceFlush?.();
|
|
180
|
+
}
|
|
136
181
|
}
|
|
137
182
|
function noopSpan() {
|
|
138
183
|
return this;
|
|
@@ -1,9 +1,9 @@
|
|
|
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, e as emitModuleRunner } from './init.DVtKdFty.js';
|
|
5
5
|
import { distDir } from '../path.js';
|
|
6
|
-
import { createCustomConsole } from './console.
|
|
6
|
+
import { createCustomConsole } from './console.uGgdMhyZ.js';
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import { createRequire, Module, isBuiltin } from 'node:module';
|
|
9
9
|
import { toArray, isBareImport } from '@vitest/utils/helpers';
|
|
@@ -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,
|
|
14
|
+
import { s as startVitestModuleRunner, c as createNodeImportMeta, V as VITEST_VM_CONTEXT_SYMBOL } from './startModuleRunner.C5CcWyXW.js';
|
|
15
15
|
import { p as provideWorkerState } from './utils.DvEY5TfP.js';
|
|
16
16
|
|
|
17
17
|
function interopCommonJsModule(interopDefault, mod) {
|
|
@@ -716,6 +716,7 @@ async function runVmTests(method, state, traces) {
|
|
|
716
716
|
createImportMeta: createNodeImportMeta,
|
|
717
717
|
traces
|
|
718
718
|
});
|
|
719
|
+
emitModuleRunner(moduleRunner);
|
|
719
720
|
Object.defineProperty(context, VITEST_VM_CONTEXT_SYMBOL, {
|
|
720
721
|
value: {
|
|
721
722
|
context,
|
|
@@ -733,12 +734,8 @@ async function runVmTests(method, state, traces) {
|
|
|
733
734
|
}
|
|
734
735
|
await moduleRunner.mocker.initializeSpyModule();
|
|
735
736
|
const { run } = await moduleRunner.import(entryFile);
|
|
736
|
-
const fileSpecs = ctx.files.map((f) => typeof f === "string" ? {
|
|
737
|
-
filepath: f,
|
|
738
|
-
testLocations: void 0
|
|
739
|
-
} : f);
|
|
740
737
|
try {
|
|
741
|
-
await run(method,
|
|
738
|
+
await run(method, ctx.files, ctx.config, moduleRunner, traces);
|
|
742
739
|
} finally {
|
|
743
740
|
await traces.$("vitest.runtime.environment.teardown", () => vm.teardown?.());
|
|
744
741
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileSpecification, Task, CancelReason } from '@vitest/runner';
|
|
2
2
|
import { EvaluatedModules } from 'vite/module-runner';
|
|
3
|
-
import { S as SerializedConfig } from './config.d.
|
|
3
|
+
import { S as SerializedConfig } from './config.d.idH22YSr.js';
|
|
4
4
|
import { E as Environment } from './environment.d.CrsxCzP1.js';
|
|
5
5
|
import { R as RuntimeRPC, a as RunnerRPC } from './rpc.d.RH3apGEf.js';
|
|
6
6
|
|
|
@@ -201,6 +201,7 @@ interface WorkerExecuteContext {
|
|
|
201
201
|
files: FileSpecification[];
|
|
202
202
|
providedContext: Record<string, any>;
|
|
203
203
|
invalidates?: string[];
|
|
204
|
+
environment: ContextTestEnvironment;
|
|
204
205
|
/** Exposed to test runner as `VITEST_WORKER_ID`. Value is unique per each isolated worker. */
|
|
205
206
|
workerId: number;
|
|
206
207
|
}
|
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.B1v3xxoC.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.Dm4xqZ0s.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,9 +1,9 @@
|
|
|
1
1
|
import { HookHandler, ConfigEnv, UserConfig } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { I as InlineConfig,
|
|
4
|
-
export {
|
|
5
|
-
import { V as VitestPluginContext } from './chunks/plugin.d.
|
|
6
|
-
import { F as FakeTimerInstallOpts } from './chunks/config.d.
|
|
3
|
+
import { I as InlineConfig, C as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, b as UserProjectConfigFn, c as UserProjectConfigExport } from './chunks/reporters.d.Db3MiIWX.js';
|
|
4
|
+
export { a as TestProjectConfiguration, e as TestProjectInlineConfiguration, d as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.Db3MiIWX.js';
|
|
5
|
+
import { V as VitestPluginContext } from './chunks/plugin.d.D8KU2PY_.js';
|
|
6
|
+
import { F as FakeTimerInstallOpts } from './chunks/config.d.idH22YSr.js';
|
|
7
7
|
import '@vitest/runner';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import './chunks/rpc.d.RH3apGEf.js';
|
|
@@ -11,12 +11,9 @@ import '@vitest/snapshot';
|
|
|
11
11
|
import 'vite/module-runner';
|
|
12
12
|
import './chunks/traces.d.402V_yFI.js';
|
|
13
13
|
import 'node:stream';
|
|
14
|
-
import './chunks/browser.d.
|
|
15
|
-
import './chunks/worker.d.
|
|
14
|
+
import './chunks/browser.d.8hOapKZr.js';
|
|
15
|
+
import './chunks/worker.d.Bji1eq5g.js';
|
|
16
16
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
17
|
-
import '@vitest/mocker';
|
|
18
|
-
import '@vitest/utils/source-map';
|
|
19
|
-
import 'vitest/browser';
|
|
20
17
|
import '@vitest/pretty-format';
|
|
21
18
|
import '@vitest/utils/diff';
|
|
22
19
|
import '@vitest/expect';
|
|
@@ -24,6 +21,9 @@ import 'vitest/optional-types.js';
|
|
|
24
21
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
25
22
|
import '@vitest/runner/utils';
|
|
26
23
|
import 'tinybench';
|
|
24
|
+
import '@vitest/mocker';
|
|
25
|
+
import '@vitest/utils/source-map';
|
|
26
|
+
import 'vitest/browser';
|
|
27
27
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
28
28
|
import '@vitest/snapshot/manager';
|
|
29
29
|
import 'node:console';
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { R as ResolvedCoverageOptions, V as Vitest,
|
|
1
|
+
import { R as ResolvedCoverageOptions, V as Vitest, aY as CoverageMap, aW as ReportContext } from './chunks/reporters.d.Db3MiIWX.js';
|
|
2
2
|
import { TransformResult } from 'vite';
|
|
3
3
|
import { A as AfterSuiteRunMeta } from './chunks/rpc.d.RH3apGEf.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import '@vitest/utils';
|
|
6
6
|
import 'node:stream';
|
|
7
|
-
import './chunks/browser.d.
|
|
8
|
-
import './chunks/
|
|
7
|
+
import './chunks/browser.d.8hOapKZr.js';
|
|
8
|
+
import './chunks/traces.d.402V_yFI.js';
|
|
9
|
+
import './chunks/worker.d.Bji1eq5g.js';
|
|
9
10
|
import 'vite/module-runner';
|
|
10
|
-
import './chunks/config.d.
|
|
11
|
+
import './chunks/config.d.idH22YSr.js';
|
|
11
12
|
import '@vitest/pretty-format';
|
|
12
13
|
import '@vitest/snapshot';
|
|
13
14
|
import '@vitest/utils/diff';
|
|
14
15
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
15
|
-
import '@vitest/mocker';
|
|
16
|
-
import '@vitest/utils/source-map';
|
|
17
|
-
import 'vitest/browser';
|
|
18
16
|
import '@vitest/expect';
|
|
19
17
|
import 'vitest/optional-types.js';
|
|
20
|
-
import './chunks/traces.d.402V_yFI.js';
|
|
21
18
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
22
19
|
import '@vitest/runner/utils';
|
|
23
20
|
import 'tinybench';
|
|
21
|
+
import '@vitest/mocker';
|
|
22
|
+
import '@vitest/utils/source-map';
|
|
23
|
+
import 'vitest/browser';
|
|
24
24
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
25
25
|
import '@vitest/snapshot/manager';
|
|
26
26
|
import 'node:console';
|
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.BMlOMIWl.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'node:path';
|
|
4
4
|
import '@vitest/utils/helpers';
|
|
@@ -21,3 +21,5 @@ import 'node:util';
|
|
|
21
21
|
import 'vite';
|
|
22
22
|
import './chunks/constants.D_Q9UYh-.js';
|
|
23
23
|
import './chunks/coverage.D_JHT54q.js';
|
|
24
|
+
|
|
25
|
+
console.warn("Importing from \"vitest/coverage\" is deprecated since Vitest 4.1. Please use \"vitest/node\" instead.");
|
package/dist/environments.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.
|
|
1
|
+
export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.CyBMJtT7.js';
|
|
2
2
|
import 'node:url';
|
|
3
3
|
import 'node:console';
|
|
4
|
+
|
|
5
|
+
console.warn("Importing from \"vitest/environments\" is deprecated since Vitest 4.1. Please use \"vitest/runtime\" instead.");
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { M as ModuleDefinitionDurationsDiagnostic, U as UntrackedModuleDefinitionDiagnostic, S as SerializedTestSpecification, a as ModuleDefinitionDiagnostic, b as ModuleDefinitionLocation, c as SourceModuleDiagnostic, d as SourceModuleLocations } from './chunks/browser.d.
|
|
2
|
-
export { B as BrowserTesterOptions } from './chunks/browser.d.
|
|
1
|
+
import { M as ModuleDefinitionDurationsDiagnostic, U as UntrackedModuleDefinitionDiagnostic, S as SerializedTestSpecification, a as ModuleDefinitionDiagnostic, b as ModuleDefinitionLocation, c as SourceModuleDiagnostic, d as SourceModuleLocations } from './chunks/browser.d.8hOapKZr.js';
|
|
2
|
+
export { B as BrowserTesterOptions } from './chunks/browser.d.8hOapKZr.js';
|
|
3
3
|
import './chunks/global.d.B15mdLcR.js';
|
|
4
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';
|
|
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, VitestRunnerConfig as TestRunnerConfig, VitestRunner as VitestTestRunner, 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 { b as BirpcReturn } from './chunks/worker.d.
|
|
9
|
-
export { C as ContextRPC, c as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.
|
|
10
|
-
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.
|
|
11
|
-
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.
|
|
8
|
+
import { b as BirpcReturn } from './chunks/worker.d.Bji1eq5g.js';
|
|
9
|
+
export { C as ContextRPC, c as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.Bji1eq5g.js';
|
|
10
|
+
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.idH22YSr.js';
|
|
11
|
+
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.idH22YSr.js';
|
|
12
12
|
import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/rpc.d.RH3apGEf.js';
|
|
13
13
|
export { A as AfterSuiteRunMeta, a as RunnerRPC, R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
|
|
14
14
|
import { ExpectStatic } from '@vitest/expect';
|
|
@@ -17,15 +17,16 @@ import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePar
|
|
|
17
17
|
export { Mock, MockContext, MockInstance, MockResult, MockResultIncomplete, MockResultReturn, MockResultThrow, MockSettledResult, MockSettledResultFulfilled, MockSettledResultIncomplete, MockSettledResultRejected, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
18
18
|
export { b as bench } from './chunks/suite.d.BJWk38HB.js';
|
|
19
19
|
export { V as EvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';
|
|
20
|
+
export { NodeBenchmarkRunner as BenchmarkRunner, VitestTestRunner as TestRunner } from './runners.js';
|
|
20
21
|
export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI, B as BenchmarkResult } from './chunks/benchmark.d.DAaHLpsq.js';
|
|
21
22
|
export { ExpectTypeOf, expectTypeOf } from 'expect-type';
|
|
22
23
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
23
24
|
export { DiffOptions } from '@vitest/utils/diff';
|
|
24
25
|
export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';
|
|
26
|
+
import './chunks/traces.d.402V_yFI.js';
|
|
25
27
|
import '@vitest/pretty-format';
|
|
26
28
|
import 'vite/module-runner';
|
|
27
29
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
28
|
-
import './chunks/traces.d.402V_yFI.js';
|
|
29
30
|
import '@vitest/runner/utils';
|
|
30
31
|
|
|
31
32
|
interface SourceMap {
|
|
@@ -203,6 +204,15 @@ interface VitestUtils {
|
|
|
203
204
|
*/
|
|
204
205
|
clearAllTimers: () => VitestUtils;
|
|
205
206
|
/**
|
|
207
|
+
* Controls how fake timers are advanced.
|
|
208
|
+
* @param mode The mode to use for advancing timers.
|
|
209
|
+
* - `manual`: The default behavior. Timers will only advance when you call one of `vi.advanceTimers...()` methods.
|
|
210
|
+
* - `nextTimerAsync`: Timers will be advanced automatically to the next available timer after each macrotask.
|
|
211
|
+
* - `interval`: Timers are advanced automatically by a specified interval.
|
|
212
|
+
* @param interval The interval in milliseconds to use when `mode` is `'interval'`.
|
|
213
|
+
*/
|
|
214
|
+
setTimerTickMode: ((mode: "manual" | "nextTimerAsync") => VitestUtils) & ((mode: "interval", interval?: number) => VitestUtils);
|
|
215
|
+
/**
|
|
206
216
|
* Creates a spy on a method or getter/setter of an object similar to [`vi.fn()`](https://vitest.dev/api/vi#vi-fn). It returns a [mock function](https://vitest.dev/api/mock).
|
|
207
217
|
* @example
|
|
208
218
|
* ```ts
|
|
@@ -314,9 +324,11 @@ interface VitestUtils {
|
|
|
314
324
|
* Mocking algorithm is described in [documentation](https://vitest.dev/guide/mocking/modules).
|
|
315
325
|
* @param path Path to the module. Can be aliased, if your Vitest config supports it
|
|
316
326
|
* @param factory Mocked module factory. The result of this function will be an exports object
|
|
327
|
+
*
|
|
328
|
+
* @returns A disposable object that calls {@link doUnmock()} when disposed
|
|
317
329
|
*/
|
|
318
|
-
doMock(path: string, factory?: MockFactoryWithHelper | MockOptions):
|
|
319
|
-
doMock<T>(module: Promise<T>, factory?: MockFactoryWithHelper<T> | MockOptions):
|
|
330
|
+
doMock(path: string, factory?: MockFactoryWithHelper | MockOptions): Disposable;
|
|
331
|
+
doMock<T>(module: Promise<T>, factory?: MockFactoryWithHelper<T> | MockOptions): Disposable;
|
|
320
332
|
/**
|
|
321
333
|
* Removes module from mocked registry. All subsequent calls to import will return original module.
|
|
322
334
|
*
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { N as BenchmarkRunner, T as TestRunner, a as assert, c as createExpect, g as expect, i as inject, s as should, v as vi, b as vitest } from './chunks/test.prxIahgM.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.BEFi2-_3.js';
|
|
5
5
|
export { expectTypeOf } from 'expect-type';
|
|
6
6
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
|
|
7
7
|
export { chai } from '@vitest/expect';
|
|
8
|
-
import '
|
|
8
|
+
import '@vitest/utils/helpers';
|
|
9
9
|
import '@vitest/utils/timers';
|
|
10
|
+
import './chunks/utils.DvEY5TfP.js';
|
|
10
11
|
import '@vitest/runner/utils';
|
|
11
|
-
import '@vitest/snapshot';
|
|
12
12
|
import '@vitest/utils/error';
|
|
13
|
-
import '
|
|
13
|
+
import 'pathe';
|
|
14
|
+
import '@vitest/snapshot';
|
|
14
15
|
import '@vitest/spy';
|
|
15
16
|
import '@vitest/utils/offset';
|
|
16
17
|
import '@vitest/utils/source-map';
|
|
17
18
|
import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
18
|
-
import './chunks/
|
|
19
|
-
import '
|
|
19
|
+
import './chunks/rpc.HLmECnw_.js';
|
|
20
|
+
import './chunks/index.Chj8NDwU.js';
|
|
20
21
|
import 'vite/module-runner';
|
package/dist/module-evaluator.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { isBuiltin, createRequire } from 'node:module';
|
|
2
2
|
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
3
3
|
import vm from 'node:vm';
|
|
4
|
-
import { isAbsolute } from 'pathe';
|
|
5
4
|
import { ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey } from 'vite/module-runner';
|
|
6
|
-
import { T as Traces } from './chunks/traces.
|
|
5
|
+
import { T as Traces } from './chunks/traces.CCmnQaNT.js';
|
|
7
6
|
|
|
8
7
|
const performanceNow = performance.now.bind(performance);
|
|
9
8
|
class ModuleDebug {
|
|
@@ -163,7 +162,7 @@ class VitestModuleEvaluator {
|
|
|
163
162
|
const filename = meta.filename;
|
|
164
163
|
const dirname = meta.dirname;
|
|
165
164
|
span.setAttributes({ "code.file.path": filename });
|
|
166
|
-
const require = this.createRequire(
|
|
165
|
+
const require = this.createRequire(meta.url);
|
|
167
166
|
const argumentsList = [
|
|
168
167
|
ssrModuleExportsKey,
|
|
169
168
|
ssrImportMetaKey,
|
|
@@ -220,9 +219,6 @@ class VitestModuleEvaluator {
|
|
|
220
219
|
}
|
|
221
220
|
}
|
|
222
221
|
createRequire(filename) {
|
|
223
|
-
// \x00 is a rollup convention for virtual files,
|
|
224
|
-
// it is not allowed in actual file names
|
|
225
|
-
if (filename[0] === "\0" || !isAbsolute(filename)) return () => ({});
|
|
226
222
|
return this.vm ? this.vm.externalModulesExecutor.createRequire(filename) : createRequire(filename);
|
|
227
223
|
}
|
|
228
224
|
shouldInterop(path, mod) {
|
package/dist/node.d.ts
CHANGED
|
@@ -3,32 +3,33 @@ import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as Res
|
|
|
3
3
|
export { vite as Vite };
|
|
4
4
|
export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
5
5
|
import { IncomingMessage } from 'node:http';
|
|
6
|
-
import {
|
|
7
|
-
export {
|
|
8
|
-
export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.d.
|
|
6
|
+
import { f as ResolvedConfig, d as UserConfig, g as VitestRunMode, h as VitestOptions, V as Vitest, A as ApiConfig, i as TestSpecification, T as TestProject, P as PoolWorker, j as PoolOptions, k as WorkerRequest, l as TestSequencer, L as Logger } from './chunks/reporters.d.Db3MiIWX.js';
|
|
7
|
+
export { aP as BaseCoverageOptions, z as BaseReporter, E as BenchmarkBuiltinReporters, B as BenchmarkReporter, r as BenchmarkReportsMap, ai as BenchmarkUserOptions, ak as BrowserBuiltinProvider, al as BrowserCommand, am as BrowserCommandContext, an as BrowserConfigOptions, ao as BrowserInstanceOption, ap as BrowserModuleMocker, aq as BrowserOrchestrator, ar as BrowserProvider, as as BrowserProviderOption, at as BrowserScript, au as BrowserServerFactory, av as BrowserServerOptions, aw as BrowserServerState, ax as BrowserServerStateSession, aE as BuiltinEnvironment, F as BuiltinReporterOptions, K as BuiltinReporters, ay as CDPSession, aF as CSSModuleScopeStrategy, aQ as CoverageIstanbulOptions, aR as CoverageOptions, aS as CoverageProvider, aT as CoverageProviderModule, aU as CoverageReporter, C as CoverageV8Options, aV as CustomProviderOptions, D as DefaultReporter, aG as DepsOptimizationOptions, s as DotReporter, aH as EnvironmentOptions, G as GithubActionsReporter, _ as HTMLOptions, H as HangingProcessReporter, I as InlineConfig, a0 as JUnitOptions, t as JUnitReporter, M as JsonAssertionResult, $ as JsonOptions, J as JsonReporter, N as JsonTestResult, Q as JsonTestResults, a1 as ModuleDiagnostic, O as OnServerRestartHandler, m as OnTestsRerunHandler, az as ParentProjectBrowser, aI as Pool, o as PoolRunnerInitializer, p as PoolTask, aA as ProjectBrowser, aJ as ProjectConfig, aW as ReportContext, X as ReportedHookContext, Y as Reporter, u as ReportersMap, aL as ResolveSnapshotPathHandler, aM as ResolveSnapshotPathHandlerContext, aB as ResolvedBrowserOptions, R as ResolvedCoverageOptions, aK as ResolvedProjectConfig, S as SerializedTestProject, v as TapFlatReporter, w as TapReporter, a2 as TaskOptions, a3 as TestCase, a4 as TestCollection, a5 as TestDiagnostic, a6 as TestModule, a7 as TestModuleState, a8 as TestResult, a9 as TestResultFailed, aa as TestResultPassed, ab as TestResultSkipped, Z as TestRunEndReason, aX as TestRunResult, ag as TestSequencerConstructor, ah as TestSpecificationOptions, ac as TestState, ad as TestSuite, ae as TestSuiteState, aC as ToMatchScreenshotComparators, aD as ToMatchScreenshotOptions, aN as TypecheckConfig, U as UserWorkspaceConfig, x as VerboseBenchmarkReporter, y as VerboseReporter, aO as VitestEnvironment, n as VitestPackageInstaller, W as WatcherTriggerPattern, q as WorkerResponse, aj as _BrowserNames, af as experimental_getRunnerTask } from './chunks/reporters.d.Db3MiIWX.js';
|
|
8
|
+
export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.d.D8KU2PY_.js';
|
|
9
|
+
export { BaseCoverageProvider } from './coverage.js';
|
|
9
10
|
import { Awaitable } from '@vitest/utils';
|
|
10
11
|
export { SerializedError } from '@vitest/utils';
|
|
11
12
|
import { R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
|
|
12
13
|
import { Writable } from 'node:stream';
|
|
13
|
-
import { C as ContextRPC } from './chunks/worker.d.
|
|
14
|
-
export { T as TestExecutionType } from './chunks/worker.d.
|
|
14
|
+
import { C as ContextRPC } from './chunks/worker.d.Bji1eq5g.js';
|
|
15
|
+
export { T as TestExecutionType } from './chunks/worker.d.Bji1eq5g.js';
|
|
15
16
|
import { Debugger } from 'obug';
|
|
16
17
|
import './chunks/global.d.B15mdLcR.js';
|
|
17
18
|
export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
18
|
-
export { b as RuntimeConfig } from './chunks/config.d.
|
|
19
|
+
export { b as RuntimeConfig } from './chunks/config.d.idH22YSr.js';
|
|
19
20
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
20
|
-
import './chunks/browser.d.
|
|
21
|
-
import '
|
|
22
|
-
import '@vitest/utils/source-map';
|
|
23
|
-
import 'vitest/browser';
|
|
21
|
+
import './chunks/browser.d.8hOapKZr.js';
|
|
22
|
+
import './chunks/traces.d.402V_yFI.js';
|
|
24
23
|
import '@vitest/pretty-format';
|
|
25
24
|
import '@vitest/snapshot';
|
|
26
25
|
import '@vitest/utils/diff';
|
|
27
26
|
import '@vitest/expect';
|
|
28
27
|
import 'vitest/optional-types.js';
|
|
29
|
-
import './chunks/traces.d.402V_yFI.js';
|
|
30
28
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
31
29
|
import 'tinybench';
|
|
30
|
+
import '@vitest/mocker';
|
|
31
|
+
import '@vitest/utils/source-map';
|
|
32
|
+
import 'vitest/browser';
|
|
32
33
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
33
34
|
import '@vitest/snapshot/manager';
|
|
34
35
|
import 'node:console';
|
|
@@ -203,6 +204,7 @@ declare class VmForksPoolWorker extends ForksPoolWorker {
|
|
|
203
204
|
readonly reportMemory: true;
|
|
204
205
|
protected readonly entrypoint: string;
|
|
205
206
|
constructor(options: PoolOptions);
|
|
207
|
+
canReuse(): boolean;
|
|
206
208
|
}
|
|
207
209
|
|
|
208
210
|
/** @experimental */
|
|
@@ -211,6 +213,7 @@ declare class VmThreadsPoolWorker extends ThreadsPoolWorker {
|
|
|
211
213
|
readonly reportMemory: true;
|
|
212
214
|
protected readonly entrypoint: string;
|
|
213
215
|
constructor(options: PoolOptions);
|
|
216
|
+
canReuse(): boolean;
|
|
214
217
|
}
|
|
215
218
|
|
|
216
219
|
declare class BaseSequencer implements TestSequencer {
|
package/dist/node.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import { resolveConfig as resolveConfig$1, mergeConfig } from 'vite';
|
|
3
3
|
export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
4
|
-
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.
|
|
5
|
-
export { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, p as createDebugger, d as createMethodsRPC, o as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, n as isFileServingAllowed, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
6
|
-
export { p as parseCLI } from './chunks/cac.
|
|
7
|
-
import { r as resolveConfig$2 } from './chunks/coverage.
|
|
8
|
-
export { b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.
|
|
4
|
+
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.B4CqEpI6.js';
|
|
5
|
+
export { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, p as createDebugger, d as createMethodsRPC, o as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, n as isFileServingAllowed, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.B4CqEpI6.js';
|
|
6
|
+
export { p as parseCLI } from './chunks/cac.B1v3xxoC.js';
|
|
7
|
+
import { r as resolveConfig$2 } from './chunks/coverage.BMlOMIWl.js';
|
|
8
|
+
export { B as BaseCoverageProvider, b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.BMlOMIWl.js';
|
|
9
9
|
import { slash, deepClone } from '@vitest/utils/helpers';
|
|
10
10
|
import { a as any } from './chunks/index.D4KonVSU.js';
|
|
11
11
|
import { resolve } from 'pathe';
|
|
12
12
|
import { c as configFiles } from './chunks/constants.D_Q9UYh-.js';
|
|
13
|
+
export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.Dm4xqZ0s.js';
|
|
13
14
|
export { distDir, rootDir } from './path.js';
|
|
14
15
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
16
|
+
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.DyBZXrH3.js';
|
|
15
17
|
import 'node:fs';
|
|
16
18
|
import './chunks/coverage.D_JHT54q.js';
|
|
17
19
|
import 'node:path';
|
|
@@ -19,19 +21,6 @@ import 'node:os';
|
|
|
19
21
|
import '@vitest/snapshot/manager';
|
|
20
22
|
import 'node:perf_hooks';
|
|
21
23
|
import './chunks/index.Chj8NDwU.js';
|
|
22
|
-
import './chunks/index.456_DGfR.js';
|
|
23
|
-
import 'node:fs/promises';
|
|
24
|
-
import '@vitest/utils/source-map';
|
|
25
|
-
import 'tinyrainbow';
|
|
26
|
-
import './chunks/env.D4Lgay0q.js';
|
|
27
|
-
import 'std-env';
|
|
28
|
-
import 'node:util';
|
|
29
|
-
import 'node:console';
|
|
30
|
-
import 'node:stream';
|
|
31
|
-
import '@vitest/utils/display';
|
|
32
|
-
import 'tinyexec';
|
|
33
|
-
import '@vitest/utils/offset';
|
|
34
|
-
import 'node:module';
|
|
35
24
|
import 'events';
|
|
36
25
|
import 'https';
|
|
37
26
|
import 'http';
|
|
@@ -44,12 +33,18 @@ import 'zlib';
|
|
|
44
33
|
import 'buffer';
|
|
45
34
|
import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
46
35
|
import 'node:crypto';
|
|
47
|
-
import './chunks/traces.
|
|
36
|
+
import './chunks/traces.CCmnQaNT.js';
|
|
48
37
|
import 'obug';
|
|
38
|
+
import 'node:fs/promises';
|
|
39
|
+
import 'tinyrainbow';
|
|
49
40
|
import '#module-evaluator';
|
|
50
41
|
import 'vite/module-runner';
|
|
42
|
+
import 'node:console';
|
|
51
43
|
import '@vitest/utils/highlight';
|
|
44
|
+
import 'node:module';
|
|
52
45
|
import 'node:url';
|
|
46
|
+
import './chunks/env.D4Lgay0q.js';
|
|
47
|
+
import 'std-env';
|
|
53
48
|
import 'node:tty';
|
|
54
49
|
import 'node:events';
|
|
55
50
|
import './chunks/modules.BJuCwlRJ.js';
|
|
@@ -63,13 +58,18 @@ import './chunks/defaults.BOqNVLsY.js';
|
|
|
63
58
|
import '@vitest/utils/constants';
|
|
64
59
|
import '@vitest/utils/resolver';
|
|
65
60
|
import 'es-module-lexer';
|
|
66
|
-
import './chunks/index.Drsj_6e7.js';
|
|
67
61
|
import 'node:assert';
|
|
68
62
|
import '@vitest/utils/serialize';
|
|
63
|
+
import '@vitest/utils/source-map';
|
|
69
64
|
import 'node:readline';
|
|
65
|
+
import 'node:util';
|
|
70
66
|
import 'node:process';
|
|
71
67
|
import 'node:v8';
|
|
72
68
|
import 'readline';
|
|
69
|
+
import 'node:stream';
|
|
70
|
+
import '@vitest/utils/display';
|
|
71
|
+
import 'tinyexec';
|
|
72
|
+
import '@vitest/utils/offset';
|
|
73
73
|
|
|
74
74
|
// this is only exported as a public function and not used inside vitest
|
|
75
75
|
async function resolveConfig(options = {}, viteOverrides = {}) {
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { z as BaseReporter, E as BenchmarkBuiltinReporters, B as BenchmarkReporter, r as BenchmarkReportsMap, F as BuiltinReporterOptions, K as BuiltinReporters, D as DefaultReporter, s as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, t as JUnitReporter, M as JsonAssertionResult, J as JsonReporter, N as JsonTestResult, Q as JsonTestResults, X as ReportedHookContext, Y as Reporter, u as ReportersMap, v as TapFlatReporter, w as TapReporter, Z as TestRunEndReason, x as VerboseBenchmarkReporter, y as VerboseReporter } from './chunks/reporters.d.Db3MiIWX.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import '@vitest/utils';
|
|
4
4
|
import './chunks/rpc.d.RH3apGEf.js';
|
|
@@ -7,20 +7,20 @@ import 'vite/module-runner';
|
|
|
7
7
|
import './chunks/traces.d.402V_yFI.js';
|
|
8
8
|
import 'node:stream';
|
|
9
9
|
import 'vite';
|
|
10
|
-
import './chunks/browser.d.
|
|
11
|
-
import './chunks/worker.d.
|
|
12
|
-
import './chunks/config.d.
|
|
10
|
+
import './chunks/browser.d.8hOapKZr.js';
|
|
11
|
+
import './chunks/worker.d.Bji1eq5g.js';
|
|
12
|
+
import './chunks/config.d.idH22YSr.js';
|
|
13
13
|
import '@vitest/pretty-format';
|
|
14
14
|
import '@vitest/utils/diff';
|
|
15
15
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
16
|
-
import '@vitest/mocker';
|
|
17
|
-
import '@vitest/utils/source-map';
|
|
18
|
-
import 'vitest/browser';
|
|
19
16
|
import '@vitest/expect';
|
|
20
17
|
import 'vitest/optional-types.js';
|
|
21
18
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
22
19
|
import '@vitest/runner/utils';
|
|
23
20
|
import 'tinybench';
|
|
21
|
+
import '@vitest/mocker';
|
|
22
|
+
import '@vitest/utils/source-map';
|
|
23
|
+
import 'vitest/browser';
|
|
24
24
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
25
25
|
import '@vitest/snapshot/manager';
|
|
26
26
|
import 'node:console';
|
package/dist/reporters.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.
|
|
2
|
-
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.
|
|
1
|
+
export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.Dm4xqZ0s.js';
|
|
2
|
+
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.DyBZXrH3.js';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:fs/promises';
|
|
5
5
|
import 'pathe';
|
|
@@ -22,3 +22,5 @@ import 'node:url';
|
|
|
22
22
|
import 'vite';
|
|
23
23
|
import '@vitest/utils/offset';
|
|
24
24
|
import 'node:module';
|
|
25
|
+
|
|
26
|
+
console.warn("Importing from \"vitest/reporters\" is deprecated since Vitest 4.1. Please use \"vitest/node\" instead.");
|