vitest 5.0.0 → 5.0.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/browser/context.d.ts +1 -1
- package/config.d.ts +0 -2
- package/dist/browser.d.ts +14 -1
- package/dist/browser.js +7 -7
- package/dist/chunks/{base.BTS5G301.js → base.Cc3oda2V.js} +14 -14
- package/dist/chunks/{cac.D805sv8h.js → cac.fSuRXrAx.js} +9 -9
- package/dist/chunks/{cli-api.LUtK11-x.js → cli-api.DcLieX4F.js} +3 -3
- package/dist/chunks/{console.CHi0lDgQ.js → console.B09ye7y0.js} +2 -2
- package/dist/chunks/{coverage.BtDxDqSU.js → coverage.AipniaqB.js} +1 -1
- package/dist/chunks/{coverage.BcXK1DsQ.js → coverage.CX7NN5s7.js} +1 -1
- package/dist/chunks/{creator.BHJ7K266.js → creator.BEj8pIIH.js} +10 -10
- package/dist/chunks/{doctor.CrUoUtdU.js → doctor.DR3u0Z_G.js} +7 -6
- package/dist/chunks/{globals.DQ4rmEUL.js → globals.D9ucJdZZ.js} +6 -6
- package/dist/chunks/{index.1_nbEjJY.js → index.D4dXTzh9.js} +8 -3
- package/dist/chunks/{index.5J3Pr46F.js → index.DNv8WNGe.js} +5 -5
- package/dist/chunks/{index.B89dZ0-N.js → index.DzobfTyw.js} +3724 -3716
- package/dist/chunks/{index.OVGXnVRj.js → index.m3L2HgmY.js} +11 -7
- package/dist/chunks/{init-forks.CiCtIMPj.js → init-forks.DgHqDQHC.js} +1 -1
- package/dist/chunks/{init-threads.DbGO6vUd.js → init-threads.B-t1iYCi.js} +1 -1
- package/dist/chunks/{init.BS957yFf.js → init.3UJvPvQg.js} +4 -4
- package/dist/chunks/{native.cLbCmZDO.js → native.CF4uT5hY.js} +1 -1
- package/dist/chunks/{nativeModuleMocker.E7jPi2fl.js → nativeModuleMocker.B20FEd-E.js} +2 -2
- package/dist/chunks/{nativeModuleRunner.BOvBCgI_.js → nativeModuleRunner.J0QLzNtK.js} +1 -1
- package/dist/chunks/{node.Es9ukMGX.js → node.CfQ_OGWr.js} +1 -1
- package/dist/chunks/{pathe.M-eThtNZ.Clq7AXhv.js → pathe.M-eThtNZ.DwEga6ro.js} +2 -1
- package/dist/chunks/{plugin.d.BbcoZhuj.d.ts → plugin.d.CN87HSxv.d.ts} +3 -3
- package/dist/chunks/{resolver.CBCHRZ7j.js → resolver.NpfwMKt9.js} +1 -1
- package/dist/chunks/{rpc.DWKX1ZbI.js → rpc.Bvs-iVxs.js} +2 -2
- package/dist/chunks/{run.CQOUYP-x.js → run.C5UmxDPh.js} +3 -3
- package/dist/chunks/{setup-common.D5-2VgqG.js → setup-common.BkQOiNcI.js} +2 -2
- package/dist/chunks/{source-map.Dx3YPjIe.js → source-map.BH0bbrs9.js} +1 -1
- package/dist/chunks/{spy.DPLvp2J7.js → spy.DQ0ZsPbi.js} +1 -1
- package/dist/chunks/{utils.CtqmNjXD.js → utils.CJ0JImL8.js} +1 -1
- package/dist/chunks/{vm.BQTVRi0W.js → vm.W4G5WMTl.js} +6 -6
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/node.d.ts +2 -2
- package/dist/node.js +14 -14
- package/dist/runtime.js +4 -4
- package/dist/spy.js +1 -1
- package/dist/task-utils.js +1 -1
- package/dist/worker.js +13 -13
- package/dist/workers/forks.js +14 -14
- package/dist/workers/runVmTests.js +10 -10
- package/dist/workers/threads.js +14 -14
- package/dist/workers/vmForks.js +10 -10
- package/dist/workers/vmThreads.js +10 -10
- package/package.json +12 -12
package/browser/context.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export * from '@vitest/browser-playwright/context'
|
|
|
4
4
|
export * from '@vitest/browser-webdriverio/context'
|
|
5
5
|
// @ts-ignore -- @vitest/browser-preview might not be installed
|
|
6
6
|
export * from '@vitest/browser-preview/context'
|
|
7
|
-
export { BrowserCommands, CDPSession, FsOptions } from 'vitest/internal/browser'
|
|
7
|
+
export { BrowserCommands, BrowserTraceEntryKind, CDPSession, FsOptions, MarkOptions } from 'vitest/internal/browser'
|
package/config.d.ts
CHANGED
package/dist/browser.d.ts
CHANGED
|
@@ -59,6 +59,19 @@ interface BrowserCommands {
|
|
|
59
59
|
removeFile: (path: string) => Promise<void>;
|
|
60
60
|
}
|
|
61
61
|
interface CDPSession {}
|
|
62
|
+
type BrowserTraceEntryKind = "action" | "expect" | "mark" | "lifecycle";
|
|
63
|
+
interface MarkOptions {
|
|
64
|
+
/**
|
|
65
|
+
* Optional stack string used to resolve marker location.
|
|
66
|
+
* Useful for wrapper libraries that need to forward the end-user callsite.
|
|
67
|
+
*/
|
|
68
|
+
stack?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Optional marker kind that's used to categorize the marker in the trace viewer.
|
|
71
|
+
* @default 'mark'
|
|
72
|
+
*/
|
|
73
|
+
kind?: BrowserTraceEntryKind;
|
|
74
|
+
}
|
|
62
75
|
|
|
63
76
|
export { FileSpecification, publicCollect as collectTests, getSafeTimers, getType, loadDiffConfig, loadSnapshotSerializers, processError, setSafeTimers, setupCommonEnv, setupEnv, startCoverageInsideWorker, startTests, stopCoverageInsideWorker, takeCoverageInsideWorker };
|
|
64
|
-
export type { BrowserCommands, CDPSession, FsOptions };
|
|
77
|
+
export type { BrowserCommands, BrowserTraceEntryKind, CDPSession, FsOptions, MarkOptions };
|
package/dist/browser.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/coverage.
|
|
2
|
-
export { p as collectTests, a as processError, s as startTests } from './chunks/run.
|
|
3
|
-
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv, b as setupEnv } from './chunks/setup-common.
|
|
4
|
-
export { s as SpyModule } from './chunks/spy.
|
|
1
|
+
export { s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/coverage.AipniaqB.js';
|
|
2
|
+
export { p as collectTests, a as processError, s as startTests } from './chunks/run.C5UmxDPh.js';
|
|
3
|
+
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv, b as setupEnv } from './chunks/setup-common.BkQOiNcI.js';
|
|
4
|
+
export { s as SpyModule } from './chunks/spy.DQ0ZsPbi.js';
|
|
5
5
|
export { f as format, i as inspect, s as stringify } from './chunks/display.pkpxlVcY.js';
|
|
6
|
-
export { g as getType } from './chunks/pathe.M-eThtNZ.
|
|
7
|
-
export { D as DecodedMap, g as getOriginalPosition, a as getSafeTimers, s as setSafeTimers } from './chunks/source-map.
|
|
8
|
-
import './chunks/coverage.
|
|
6
|
+
export { g as getType } from './chunks/pathe.M-eThtNZ.DwEga6ro.js';
|
|
7
|
+
export { D as DecodedMap, g as getOriginalPosition, a as getSafeTimers, s as setSafeTimers } from './chunks/source-map.BH0bbrs9.js';
|
|
8
|
+
import './chunks/coverage.CX7NN5s7.js';
|
|
9
9
|
import './chunks/index.M2dsQ_UQ.js';
|
|
10
10
|
import './chunks/tinyrainbow.Ht9iggcq.js';
|
|
11
11
|
import './task-utils.js';
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { runInThisContext } from 'node:vm';
|
|
2
|
-
import { s as spyModule } from './spy.
|
|
3
|
-
import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.
|
|
4
|
-
import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.
|
|
2
|
+
import { s as spyModule } from './spy.DQ0ZsPbi.js';
|
|
3
|
+
import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.DNv8WNGe.js';
|
|
4
|
+
import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.3UJvPvQg.js';
|
|
5
5
|
import { Traces } from '../traces.js';
|
|
6
|
-
import { V as VitestEvaluatedModules } from './rpc.
|
|
7
|
-
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './index.
|
|
6
|
+
import { V as VitestEvaluatedModules } from './rpc.Bvs-iVxs.js';
|
|
7
|
+
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './index.D4dXTzh9.js';
|
|
8
8
|
import { performance as performance$1 } from 'node:perf_hooks';
|
|
9
|
-
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './coverage.
|
|
10
|
-
import { i as index, g as globalExpect, v as vi } from './index.
|
|
9
|
+
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './coverage.AipniaqB.js';
|
|
10
|
+
import { i as index, g as globalExpect, v as vi } from './index.m3L2HgmY.js';
|
|
11
11
|
import { c as closeInspector } from './inspector.CvyFGlXm.js';
|
|
12
|
-
import { s as startTests, p as publicCollect } from './run.
|
|
12
|
+
import { s as startTests, p as publicCollect } from './run.C5UmxDPh.js';
|
|
13
13
|
import { createRequire } from 'node:module';
|
|
14
14
|
import timers from 'node:timers';
|
|
15
15
|
import timersPromises from 'node:timers/promises';
|
|
16
16
|
import util from 'node:util';
|
|
17
|
-
import { K as KNOWN_ASSET_TYPES } from './pathe.M-eThtNZ.
|
|
18
|
-
import { s as setupCommonEnv, b as setupEnv } from './setup-common.
|
|
17
|
+
import { K as KNOWN_ASSET_TYPES } from './pathe.M-eThtNZ.DwEga6ro.js';
|
|
18
|
+
import { s as setupCommonEnv, b as setupEnv } from './setup-common.BkQOiNcI.js';
|
|
19
19
|
import { g as getWorkerState, r as resetModules, p as provideWorkerState, a as getSafeWorkerState } from './utils.DYj33du9.js';
|
|
20
20
|
|
|
21
21
|
// this should only be used in Node
|
|
@@ -57,7 +57,7 @@ function resolveAsset(mod, url) {
|
|
|
57
57
|
mod.exports = url;
|
|
58
58
|
}
|
|
59
59
|
async function setupConsoleLogSpy() {
|
|
60
|
-
const { createCustomConsole } = await import('./console.
|
|
60
|
+
const { createCustomConsole } = await import('./console.B09ye7y0.js');
|
|
61
61
|
globalThis.console = createCustomConsole();
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -119,7 +119,7 @@ async function startModuleRunner(options) {
|
|
|
119
119
|
let mocker;
|
|
120
120
|
if (options.state.config.experimental.nodeLoader !== false) {
|
|
121
121
|
// this additionally imports acorn/magic-string
|
|
122
|
-
const { NativeModuleMocker } = await import('./nativeModuleMocker.
|
|
122
|
+
const { NativeModuleMocker } = await import('./nativeModuleMocker.B20FEd-E.js');
|
|
123
123
|
mocker = new NativeModuleMocker({
|
|
124
124
|
async resolveId(id, importer) {
|
|
125
125
|
// TODO: use import.meta.resolve instead
|
|
@@ -136,7 +136,7 @@ async function startModuleRunner(options) {
|
|
|
136
136
|
}
|
|
137
137
|
// imported lazily (pulls in `local-pkg`) so it stays out of the default
|
|
138
138
|
// worker startup graph; only the `viteModuleRunner: false` path needs it
|
|
139
|
-
const { NativeModuleRunner } = await import('./nativeModuleRunner.
|
|
139
|
+
const { NativeModuleRunner } = await import('./nativeModuleRunner.J0QLzNtK.js').then(function (n) { return n.n; });
|
|
140
140
|
_moduleRunner = new NativeModuleRunner(root, mocker);
|
|
141
141
|
return _moduleRunner;
|
|
142
142
|
}
|
|
@@ -148,7 +148,7 @@ let _environmentTime;
|
|
|
148
148
|
/** @experimental */
|
|
149
149
|
async function setupBaseEnvironment(context) {
|
|
150
150
|
if (context.config.experimental.viteModuleRunner === false) {
|
|
151
|
-
const { setupNodeLoaderHooks } = await import('./native.
|
|
151
|
+
const { setupNodeLoaderHooks } = await import('./native.CF4uT5hY.js');
|
|
152
152
|
await setupNodeLoaderHooks(context);
|
|
153
153
|
}
|
|
154
154
|
const startTime = performance.now();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as normalize, t as toArray } from './pathe.M-eThtNZ.
|
|
1
|
+
import { n as normalize, t as toArray } from './pathe.M-eThtNZ.DwEga6ro.js';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { m } from './tinyrainbow.Ht9iggcq.js';
|
|
4
4
|
import { a as isForceColor } from './env.DzFJjrmK.js';
|
|
@@ -620,7 +620,7 @@ class CAC extends EventEmitter {
|
|
|
620
620
|
|
|
621
621
|
const cac = (name = "") => new CAC(name);
|
|
622
622
|
|
|
623
|
-
var version = "5.0.
|
|
623
|
+
var version = "5.0.1";
|
|
624
624
|
|
|
625
625
|
const apiConfig = (port) => ({
|
|
626
626
|
port: {
|
|
@@ -2366,11 +2366,11 @@ function normalizeCliOptions(cliFilters, argv) {
|
|
|
2366
2366
|
}
|
|
2367
2367
|
async function start(cliFilters, options) {
|
|
2368
2368
|
try {
|
|
2369
|
-
const { startVitest } = await import('./cli-api.
|
|
2369
|
+
const { startVitest } = await import('./cli-api.DcLieX4F.js').then(function (n) { return n.a; });
|
|
2370
2370
|
const ctx = await startVitest(cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
2371
2371
|
if (!ctx.shouldKeepServer()) await ctx.exit();
|
|
2372
2372
|
} catch (e) {
|
|
2373
|
-
const { errorBanner } = await import('./utils.
|
|
2373
|
+
const { errorBanner } = await import('./utils.CJ0JImL8.js').then(function (n) { return n.u; });
|
|
2374
2374
|
console.error(`\n${errorBanner("Startup Error")}`);
|
|
2375
2375
|
console.error(e);
|
|
2376
2376
|
console.error("\n\n");
|
|
@@ -2380,11 +2380,11 @@ async function start(cliFilters, options) {
|
|
|
2380
2380
|
}
|
|
2381
2381
|
async function doctorCommand(cliFilters, options) {
|
|
2382
2382
|
try {
|
|
2383
|
-
const { doctor } = await import('./doctor.
|
|
2383
|
+
const { doctor } = await import('./doctor.DR3u0Z_G.js');
|
|
2384
2384
|
await doctor(cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
2385
2385
|
process.exit();
|
|
2386
2386
|
} catch (e) {
|
|
2387
|
-
const { errorBanner } = await import('./utils.
|
|
2387
|
+
const { errorBanner } = await import('./utils.CJ0JImL8.js').then(function (n) { return n.u; });
|
|
2388
2388
|
console.error(`\n${errorBanner("Doctor Error")}`);
|
|
2389
2389
|
console.error(e);
|
|
2390
2390
|
console.error("\n\n");
|
|
@@ -2397,12 +2397,12 @@ async function init(project) {
|
|
|
2397
2397
|
console.error(/* @__PURE__ */ new Error("Only the \"browser\" project is supported. Use \"vitest init browser\" to create a new project."));
|
|
2398
2398
|
process.exit(1);
|
|
2399
2399
|
}
|
|
2400
|
-
const { create } = await import('./creator.
|
|
2400
|
+
const { create } = await import('./creator.BEj8pIIH.js');
|
|
2401
2401
|
await create();
|
|
2402
2402
|
}
|
|
2403
2403
|
async function collect(cliFilters, options) {
|
|
2404
2404
|
try {
|
|
2405
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.
|
|
2405
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.DcLieX4F.js').then(function (n) { return n.a; });
|
|
2406
2406
|
const ctx = await prepareVitest({
|
|
2407
2407
|
...normalizeCliOptions(cliFilters, options),
|
|
2408
2408
|
watch: false,
|
|
@@ -2424,7 +2424,7 @@ async function collect(cliFilters, options) {
|
|
|
2424
2424
|
} else outputFileList(await ctx.getRelevantTestSpecifications(cliFilters.map(normalize)), options);
|
|
2425
2425
|
await ctx.close();
|
|
2426
2426
|
} catch (e) {
|
|
2427
|
-
const { errorBanner } = await import('./utils.
|
|
2427
|
+
const { errorBanner } = await import('./utils.CJ0JImL8.js').then(function (n) { return n.u; });
|
|
2428
2428
|
console.error(`\n${errorBanner("Collect Error")}`);
|
|
2429
2429
|
console.error(e);
|
|
2430
2430
|
console.error("\n\n");
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { C as CoverageProviderMap } from './coverage.
|
|
3
|
-
import { L as Logger, k as VitestPackageInstaller, P as PluginHarness, w as resolveConfig, V as Vitest, A as stdout, y as prompt, g as FilesNotFoundError, G as GitNotFoundError, I as IncludeTaskLocationDisabledError, C as RangeLocationFilterProvidedError, E as LocationFilterFileNotFoundError } from './index.
|
|
2
|
+
import { C as CoverageProviderMap } from './coverage.CX7NN5s7.js';
|
|
3
|
+
import { L as Logger, k as VitestPackageInstaller, P as PluginHarness, w as resolveConfig, V as Vitest, A as stdout, y as prompt, g as FilesNotFoundError, G as GitNotFoundError, I as IncludeTaskLocationDisabledError, C as RangeLocationFilterProvidedError, E as LocationFilterFileNotFoundError } from './index.DzobfTyw.js';
|
|
4
4
|
import readline from 'node:readline';
|
|
5
5
|
import { y } from './tinyrainbow.Ht9iggcq.js';
|
|
6
6
|
import { i as isWindows } from './env.DzFJjrmK.js';
|
|
7
7
|
import { stripVTControlCharacters } from 'node:util';
|
|
8
|
-
import { e as createDefer, a as relative, r as resolve, d as dirname, i as isAbsolute } from './pathe.M-eThtNZ.
|
|
8
|
+
import { e as createDefer, a as relative, r as resolve, d as dirname, i as isAbsolute } from './pathe.M-eThtNZ.DwEga6ro.js';
|
|
9
9
|
|
|
10
10
|
async function createVitest(modeOrOptions, optionsOrViteOverrides = {}, viteOverridesOrVitestOptions = {}, maybeVitestOptions = {}) {
|
|
11
11
|
let options;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Console } from 'node:console';
|
|
2
2
|
import { relative } from 'node:path';
|
|
3
3
|
import { Writable } from 'node:stream';
|
|
4
|
-
import { a as getSafeTimers } from './source-map.
|
|
4
|
+
import { a as getSafeTimers } from './source-map.BH0bbrs9.js';
|
|
5
5
|
import { y } from './tinyrainbow.Ht9iggcq.js';
|
|
6
6
|
import { g as getWorkerState } from './utils.DYj33du9.js';
|
|
7
|
-
import './pathe.M-eThtNZ.
|
|
7
|
+
import './pathe.M-eThtNZ.DwEga6ro.js';
|
|
8
8
|
|
|
9
9
|
const RealDate = globalThis.Date;
|
|
10
10
|
const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as resolveCoverageProviderModule } from './coverage.
|
|
1
|
+
import { r as resolveCoverageProviderModule } from './coverage.CX7NN5s7.js';
|
|
2
2
|
|
|
3
3
|
async function startCoverageInsideWorker(options, loader, runtimeOptions) {
|
|
4
4
|
const coverageModule = await resolveCoverageProviderModule(options, loader);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as resolve } from './pathe.M-eThtNZ.
|
|
1
|
+
import { r as resolve } from './pathe.M-eThtNZ.DwEga6ro.js';
|
|
2
2
|
|
|
3
3
|
function getCoverageFilesDirectory(reportsDirectory, shard) {
|
|
4
4
|
return resolve(reportsDirectory, `.tmp${shard ? `-${shard.index}-${shard.count}` : ""}`);
|
|
@@ -2,14 +2,14 @@ import { existsSync, writeFileSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { resolve, dirname, relative } from 'node:path';
|
|
4
4
|
import { detectPackageManager, installPackage } from './index.DXQx-kDM.js';
|
|
5
|
-
import { y as prompt, z as findConfigFile } from './index.
|
|
5
|
+
import { y as prompt, z as findConfigFile } from './index.DzobfTyw.js';
|
|
6
6
|
import { x } from 'tinyexec';
|
|
7
7
|
import { y } from './tinyrainbow.Ht9iggcq.js';
|
|
8
8
|
import 'node:process';
|
|
9
9
|
import 'node:os';
|
|
10
|
-
import './pathe.M-eThtNZ.
|
|
11
|
-
import './source-map.
|
|
12
|
-
import './cac.
|
|
10
|
+
import './pathe.M-eThtNZ.DwEga6ro.js';
|
|
11
|
+
import './source-map.BH0bbrs9.js';
|
|
12
|
+
import './cac.fSuRXrAx.js';
|
|
13
13
|
import 'events';
|
|
14
14
|
import './env.DzFJjrmK.js';
|
|
15
15
|
import 'std-env';
|
|
@@ -31,17 +31,19 @@ import 'vite';
|
|
|
31
31
|
import 'node:crypto';
|
|
32
32
|
import '../path.js';
|
|
33
33
|
import 'node:url';
|
|
34
|
-
import './run.
|
|
34
|
+
import './run.C5UmxDPh.js';
|
|
35
35
|
import './index.M2dsQ_UQ.js';
|
|
36
36
|
import './display.pkpxlVcY.js';
|
|
37
37
|
import '../task-utils.js';
|
|
38
|
-
import './nativeModuleRunner.
|
|
38
|
+
import './nativeModuleRunner.J0QLzNtK.js';
|
|
39
39
|
import 'node:module';
|
|
40
40
|
import 'node:v8';
|
|
41
41
|
import 'node:util';
|
|
42
42
|
import 'vite/module-runner';
|
|
43
43
|
import '../traces.js';
|
|
44
44
|
import 'obug';
|
|
45
|
+
import './resolver.NpfwMKt9.js';
|
|
46
|
+
import 'es-module-lexer';
|
|
45
47
|
import 'tinyglobby';
|
|
46
48
|
import './defaults.D2ip7f-X.js';
|
|
47
49
|
import 'magic-string';
|
|
@@ -49,12 +51,10 @@ import '@vitest/mocker/node';
|
|
|
49
51
|
import 'node:console';
|
|
50
52
|
import 'node:stream';
|
|
51
53
|
import './offset.Dy-5Fdfn.js';
|
|
52
|
-
import './utils.
|
|
54
|
+
import './utils.CJ0JImL8.js';
|
|
53
55
|
import '#module-evaluator';
|
|
54
56
|
import 'picomatch';
|
|
55
|
-
import './coverage.
|
|
56
|
-
import './resolver.CBCHRZ7j.js';
|
|
57
|
-
import 'es-module-lexer';
|
|
57
|
+
import './coverage.CX7NN5s7.js';
|
|
58
58
|
import 'node:tty';
|
|
59
59
|
import 'node:events';
|
|
60
60
|
import './modules.BJuCwlRJ.js';
|
|
@@ -4,11 +4,12 @@ import { availableParallelism, tmpdir } from 'node:os';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { performance } from 'node:perf_hooks';
|
|
6
6
|
import { pathToFileURL } from 'node:url';
|
|
7
|
-
import { t as toArray, r as resolve } from './pathe.M-eThtNZ.
|
|
7
|
+
import { t as toArray, r as resolve } from './pathe.M-eThtNZ.DwEga6ro.js';
|
|
8
8
|
import { y } from './tinyrainbow.Ht9iggcq.js';
|
|
9
9
|
import { distDir } from '../path.js';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// custom environments are measured too: the run fails if they lack setupVM
|
|
12
|
+
const ENVIRONMENTS_WITHOUT_VM_UPSIDE = /* @__PURE__ */ new Set(["node", "edge-runtime"]);
|
|
12
13
|
/**
|
|
13
14
|
* Builds the list of configurations worth measuring for this config. The
|
|
14
15
|
* candidates are pruned by what the config already uses - there is no point
|
|
@@ -22,7 +23,7 @@ function resolveDoctorCandidates(projects, options = {}) {
|
|
|
22
23
|
const testProjects = projects.filter((project) => !project.browser);
|
|
23
24
|
const pools = new Set(testProjects.map((project) => project.pool));
|
|
24
25
|
const usesVmPool = pools.has("vmThreads") || pools.has("vmForks");
|
|
25
|
-
const
|
|
26
|
+
const benefitsFromVm = testProjects.some((project) => !ENVIRONMENTS_WITHOUT_VM_UPSIDE.has(project.environment));
|
|
26
27
|
const isolates = projects.some((project) => project.isolate && (project.browser || project.pool !== "vmThreads" && project.pool !== "vmForks"));
|
|
27
28
|
if (pools.has("forks")) candidates.push({
|
|
28
29
|
id: "threads",
|
|
@@ -31,7 +32,7 @@ function resolveDoctorCandidates(projects, options = {}) {
|
|
|
31
32
|
configLines: [`pool: 'threads'`],
|
|
32
33
|
preservesIsolation: true
|
|
33
34
|
});
|
|
34
|
-
if (
|
|
35
|
+
if (benefitsFromVm && !pools.has("vmThreads")) candidates.push({
|
|
35
36
|
id: "vmThreads",
|
|
36
37
|
title: `pool: 'vmThreads'`,
|
|
37
38
|
overrides: { pool: "vmThreads" },
|
|
@@ -41,7 +42,7 @@ function resolveDoctorCandidates(projects, options = {}) {
|
|
|
41
42
|
// vmForks trades vmThreads' worker threads for child processes: each child
|
|
42
43
|
// gets its own heap and GC, which can beat vmThreads on GC-heavy suites, and
|
|
43
44
|
// it is the vm option for suites that cannot run in worker threads
|
|
44
|
-
if (
|
|
45
|
+
if (benefitsFromVm && !pools.has("vmForks")) candidates.push({
|
|
45
46
|
id: "vmForks",
|
|
46
47
|
title: `pool: 'vmForks'`,
|
|
47
48
|
overrides: { pool: "vmForks" },
|
|
@@ -99,7 +100,7 @@ function log(...args) {
|
|
|
99
100
|
console.log(...args);
|
|
100
101
|
}
|
|
101
102
|
async function doctor(cliFilters, options) {
|
|
102
|
-
const { prepareVitest } = await import('./cli-api.
|
|
103
|
+
const { prepareVitest } = await import('./cli-api.DcLieX4F.js').then(function (n) { return n.a; });
|
|
103
104
|
log();
|
|
104
105
|
log(y.inverse(y.bold(y.blue(" DOCTOR "))), "resolving the current configuration...");
|
|
105
106
|
const ctx = await prepareVitest({
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { g as globalApis } from './constants.-juJ8b_4.js';
|
|
2
|
-
import { i as index } from './index.
|
|
3
|
-
import './run.
|
|
2
|
+
import { i as index } from './index.m3L2HgmY.js';
|
|
3
|
+
import './run.C5UmxDPh.js';
|
|
4
4
|
import './index.M2dsQ_UQ.js';
|
|
5
5
|
import './tinyrainbow.Ht9iggcq.js';
|
|
6
6
|
import './display.pkpxlVcY.js';
|
|
7
|
-
import './pathe.M-eThtNZ.
|
|
8
|
-
import './source-map.
|
|
7
|
+
import './pathe.M-eThtNZ.DwEga6ro.js';
|
|
8
|
+
import './source-map.BH0bbrs9.js';
|
|
9
9
|
import '../task-utils.js';
|
|
10
10
|
import './utils.DYj33du9.js';
|
|
11
|
-
import './spy.
|
|
11
|
+
import './spy.DQ0ZsPbi.js';
|
|
12
12
|
import 'chai';
|
|
13
13
|
import './plugins.Cigb0uSy.js';
|
|
14
14
|
import './offset.Dy-5Fdfn.js';
|
|
15
|
-
import './rpc.
|
|
15
|
+
import './rpc.Bvs-iVxs.js';
|
|
16
16
|
import 'vite/module-runner';
|
|
17
17
|
import './index.DmDMHCg8.js';
|
|
18
18
|
import 'tinybench';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs__default from 'node:fs';
|
|
2
|
-
import { n as normalize, k as splitFileAndPostfix$1, j as join, l as isBareImport } from './pathe.M-eThtNZ.
|
|
2
|
+
import { n as normalize, k as splitFileAndPostfix$1, j as join, l as isBareImport } from './pathe.M-eThtNZ.DwEga6ro.js';
|
|
3
3
|
import { i as isBuiltin, a as isBrowserExternal, t as toBuiltin } from './modules.BJuCwlRJ.js';
|
|
4
4
|
import { E as EnvironmentTeardownError, a as getSafeWorkerState } from './utils.DYj33du9.js';
|
|
5
5
|
import { pathToFileURL, URL as URL$1 } from 'node:url';
|
|
@@ -619,6 +619,11 @@ const bareVitestRegexp = /^@?vitest(?:\/|$)/;
|
|
|
619
619
|
const normalizedDistDir = normalize(distDir);
|
|
620
620
|
const relativeIds = {};
|
|
621
621
|
const externalizeMap = /* @__PURE__ */ new Map();
|
|
622
|
+
function getRelativeDistDir(root) {
|
|
623
|
+
const normalizedRoot = normalize(root).replace(/\/+$/, "") || "/";
|
|
624
|
+
const rootPrefix = normalizedRoot === "/" ? normalizedRoot : `${normalizedRoot}/`;
|
|
625
|
+
return normalizedDistDir.startsWith(rootPrefix) ? normalizedDistDir.slice(normalizedRoot.length) : "";
|
|
626
|
+
}
|
|
622
627
|
// all Vitest imports always need to be externalized
|
|
623
628
|
function getCachedVitestImport(id, state) {
|
|
624
629
|
if (id.startsWith("/@fs/") || id.startsWith("\\@fs\\")) id = id.slice(process.platform === "win32" ? 5 : 4);
|
|
@@ -629,7 +634,7 @@ function getCachedVitestImport(id, state) {
|
|
|
629
634
|
// always externalize Vitest because we import from there before running tests
|
|
630
635
|
// so we already have it cached by Node.js
|
|
631
636
|
const root = state().config.root;
|
|
632
|
-
const relativeRoot = relativeIds[root] ?? (relativeIds[root] =
|
|
637
|
+
const relativeRoot = relativeIds[root] ?? (relativeIds[root] = getRelativeDistDir(root));
|
|
633
638
|
if (id.includes(distDir) || id.includes(normalizedDistDir)) {
|
|
634
639
|
const { file, postfix } = splitFileAndPostfix$1(id);
|
|
635
640
|
const externalize = id.startsWith("file://") ? id : `${pathToFileURL(file)}${postfix}`;
|
|
@@ -742,7 +747,7 @@ function startVitestModuleRunner(options) {
|
|
|
742
747
|
const vitest = getCachedVitestImport(id, state);
|
|
743
748
|
if (vitest) return vitest;
|
|
744
749
|
// strip _vitest_original query added by importActual so that
|
|
745
|
-
// the plugin pipeline sees the original import id (e.g. virtual modules'
|
|
750
|
+
// the plugin pipeline sees the original import id (e.g. virtual modules' load hook)
|
|
746
751
|
const isImportActual = id.includes("_vitest_original");
|
|
747
752
|
if (isImportActual) id = removeQuery(id, "_vitest_original");
|
|
748
753
|
const rawId = unwrapId(id);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as chai from 'chai';
|
|
2
2
|
import { createHook } from 'node:async_hooks';
|
|
3
|
-
import { t as takeCoverageInsideWorker } from './coverage.
|
|
4
|
-
import { r as rpc } from './rpc.
|
|
5
|
-
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.
|
|
3
|
+
import { t as takeCoverageInsideWorker } from './coverage.AipniaqB.js';
|
|
4
|
+
import { r as rpc } from './rpc.Bvs-iVxs.js';
|
|
5
|
+
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.BkQOiNcI.js';
|
|
6
6
|
import { g as getWorkerState } from './utils.DYj33du9.js';
|
|
7
|
-
import { T as TestRunner } from './index.
|
|
7
|
+
import { T as TestRunner } from './index.m3L2HgmY.js';
|
|
8
8
|
|
|
9
9
|
function setupChaiConfig(config) {
|
|
10
10
|
Object.assign(chai.config, config);
|
|
@@ -12,7 +12,7 @@ function setupChaiConfig(config) {
|
|
|
12
12
|
|
|
13
13
|
async function resolveSnapshotEnvironment(config, moduleRunner) {
|
|
14
14
|
if (!config.snapshotEnvironment) {
|
|
15
|
-
const { VitestNodeSnapshotEnvironment } = await import('./node.
|
|
15
|
+
const { VitestNodeSnapshotEnvironment } = await import('./node.CfQ_OGWr.js');
|
|
16
16
|
return new VitestNodeSnapshotEnvironment();
|
|
17
17
|
}
|
|
18
18
|
const mod = await moduleRunner.import(config.snapshotEnvironment);
|