vitest 4.0.13 → 4.0.15
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 +1 -1
- package/dist/browser.js +1 -1
- package/dist/chunks/{base.Dqf2QAxh.js → base.CTp-EStD.js} +6 -6
- package/dist/chunks/browser.d.DBzUq_Na.d.ts +57 -0
- package/dist/chunks/{cac.L-UbQ_Ix.js → cac.BNNpZQl7.js} +10 -25
- package/dist/chunks/{cli-api.CdZ6wo9-.js → cli-api.C7sYjHmQ.js} +442 -110
- package/dist/chunks/{config.d.g6OOauRt.d.ts → config.d.CzIjkicf.d.ts} +1 -0
- package/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts +7 -0
- package/dist/chunks/{globals.C0izxiX3.js → globals.DOayXfHP.js} +3 -3
- package/dist/chunks/{index.DWDW6mLz.js → index.456_DGfR.js} +137 -22
- package/dist/chunks/{index.QWbK7rHY.js → index.BspFP3mn.js} +12 -7
- package/dist/chunks/{index.CMvpbrsJ.js → index.Drsj_6e7.js} +1 -1
- package/dist/chunks/{index.DBx1AtPJ.js → index.Z5E_ObnR.js} +1 -1
- package/dist/chunks/{index.CQwQ_SLL.js → index.bFLgAE-Z.js} +2 -2
- package/dist/chunks/{init-forks.CglOH45c.js → init-forks.CKEYp90N.js} +11 -2
- package/dist/chunks/{init-threads.BuMdIy1r.js → init-threads.D8Ok07M7.js} +1 -1
- package/dist/chunks/{init.MkYs5nmh.js → init.B04saIIg.js} +4 -4
- package/dist/chunks/modules.DJPjQW6m.js +35 -0
- package/dist/chunks/{plugin.d.B4l3vYM_.d.ts → plugin.d.CY7CUjf-.d.ts} +1 -1
- package/dist/chunks/{reporters.d.J2RlBlp9.d.ts → reporters.d.OXEK7y4s.d.ts} +29 -6
- package/dist/chunks/{setup-common.DGHc_BUK.js → setup-common.Cm-kSBVi.js} +1 -1
- package/dist/chunks/{startModuleRunner.W28wBIgJ.js → startModuleRunner.Iz2V0ESw.js} +8 -9
- package/dist/chunks/{test.DqQZzsWf.js → test.BT8LKgU9.js} +8 -3
- package/dist/chunks/{vi.BiaV1qII.js → vi.2VT5v0um.js} +40 -30
- package/dist/chunks/{vm.Y19jrZy2.js → vm.BwmD1Rql.js} +2 -2
- package/dist/chunks/{worker.d.DCy61tzi.d.ts → worker.d.B4A26qg6.d.ts} +2 -2
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +7 -7
- package/dist/coverage.d.ts +8 -8
- package/dist/environments.js +1 -1
- package/dist/index.d.ts +22 -14
- package/dist/index.js +3 -3
- package/dist/module-evaluator.d.ts +5 -0
- package/dist/module-evaluator.js +23 -5
- package/dist/module-runner.js +2 -1
- package/dist/node.d.ts +8 -8
- package/dist/node.js +7 -6
- package/dist/reporters.d.ts +7 -7
- package/dist/reporters.js +2 -2
- package/dist/runners.d.ts +2 -1
- package/dist/runners.js +2 -2
- package/dist/worker.d.ts +2 -2
- package/dist/worker.js +10 -9
- package/dist/workers/forks.js +11 -10
- package/dist/workers/runVmTests.js +5 -5
- package/dist/workers/threads.js +11 -10
- package/dist/workers/vmForks.js +6 -5
- package/dist/workers/vmThreads.js +6 -5
- package/package.json +15 -20
- package/dist/chunks/browser.d.CDvMh6F9.d.ts +0 -18
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.d.
|
|
1
|
+
import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.d.CzIjkicf.js';
|
|
2
2
|
import { R as RuntimeCoverageModuleLoader } from './chunks/coverage.d.BZtK59WP.js';
|
|
3
3
|
import { SerializedDiffOptions } from '@vitest/utils/diff';
|
|
4
4
|
export { collectTests, startTests } from '@vitest/runner';
|
package/dist/browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.
|
|
1
|
+
export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.Cm-kSBVi.js';
|
|
2
2
|
export { collectTests, startTests } from '@vitest/runner';
|
|
3
3
|
import * as spyModule from '@vitest/spy';
|
|
4
4
|
export { spyModule as SpyModule };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { runInThisContext } from 'node:vm';
|
|
2
2
|
import * as spyModule from '@vitest/spy';
|
|
3
|
-
import { r as resolveTestRunner, a as resolveSnapshotEnvironment, s as setupChaiConfig } from './index.
|
|
4
|
-
import { l as loadEnvironment } from './init.
|
|
3
|
+
import { r as resolveTestRunner, a as resolveSnapshotEnvironment, s as setupChaiConfig } from './index.bFLgAE-Z.js';
|
|
4
|
+
import { l as loadEnvironment } from './init.B04saIIg.js';
|
|
5
5
|
import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
|
|
6
|
-
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startModuleRunner.
|
|
6
|
+
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startModuleRunner.Iz2V0ESw.js';
|
|
7
7
|
import { performance as performance$1 } from 'node:perf_hooks';
|
|
8
8
|
import { startTests, collectTests } from '@vitest/runner';
|
|
9
|
-
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.
|
|
10
|
-
import { g as globalExpect, v as vi } from './vi.
|
|
9
|
+
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.Cm-kSBVi.js';
|
|
10
|
+
import { g as globalExpect, v as vi } from './vi.2VT5v0um.js';
|
|
11
11
|
import { c as closeInspector } from './inspector.CvyFGlXm.js';
|
|
12
12
|
import { createRequire } from 'node:module';
|
|
13
13
|
import timers from 'node:timers';
|
|
14
14
|
import timersPromises from 'node:timers/promises';
|
|
15
15
|
import util from 'node:util';
|
|
16
16
|
import { KNOWN_ASSET_TYPES } from '@vitest/utils/constants';
|
|
17
|
-
import { i as index } from './index.
|
|
17
|
+
import { i as index } from './index.Z5E_ObnR.js';
|
|
18
18
|
import { g as getWorkerState, r as resetModules, p as provideWorkerState } from './utils.DvEY5TfP.js';
|
|
19
19
|
|
|
20
20
|
// this should only be used in Node
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FileSpecification } from '@vitest/runner';
|
|
2
|
+
import { T as TestExecutionMethod } from './worker.d.B4A26qg6.js';
|
|
3
|
+
|
|
4
|
+
type SerializedTestSpecification = [project: {
|
|
5
|
+
name: string | undefined;
|
|
6
|
+
root: string;
|
|
7
|
+
}, file: string, options: {
|
|
8
|
+
pool: string;
|
|
9
|
+
testLines?: number[] | undefined;
|
|
10
|
+
}];
|
|
11
|
+
|
|
12
|
+
interface ModuleDefinitionLocation {
|
|
13
|
+
line: number;
|
|
14
|
+
column: number;
|
|
15
|
+
}
|
|
16
|
+
interface SourceModuleLocations {
|
|
17
|
+
modules: ModuleDefinitionDiagnostic[];
|
|
18
|
+
untracked: ModuleDefinitionDiagnostic[];
|
|
19
|
+
}
|
|
20
|
+
interface ModuleDefinitionDiagnostic {
|
|
21
|
+
start: ModuleDefinitionLocation;
|
|
22
|
+
end: ModuleDefinitionLocation;
|
|
23
|
+
startIndex: number;
|
|
24
|
+
endIndex: number;
|
|
25
|
+
rawUrl: string;
|
|
26
|
+
resolvedUrl: string;
|
|
27
|
+
resolvedId: string;
|
|
28
|
+
}
|
|
29
|
+
interface ModuleDefinitionDurationsDiagnostic extends ModuleDefinitionDiagnostic {
|
|
30
|
+
selfTime: number;
|
|
31
|
+
totalTime: number;
|
|
32
|
+
transformTime?: number;
|
|
33
|
+
external?: boolean;
|
|
34
|
+
importer?: string;
|
|
35
|
+
}
|
|
36
|
+
interface UntrackedModuleDefinitionDiagnostic {
|
|
37
|
+
url: string;
|
|
38
|
+
resolvedId: string;
|
|
39
|
+
resolvedUrl: string;
|
|
40
|
+
selfTime: number;
|
|
41
|
+
totalTime: number;
|
|
42
|
+
transformTime?: number;
|
|
43
|
+
external?: boolean;
|
|
44
|
+
importer?: string;
|
|
45
|
+
}
|
|
46
|
+
interface SourceModuleDiagnostic {
|
|
47
|
+
modules: ModuleDefinitionDurationsDiagnostic[];
|
|
48
|
+
untrackedModules: UntrackedModuleDefinitionDiagnostic[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface BrowserTesterOptions {
|
|
52
|
+
method: TestExecutionMethod;
|
|
53
|
+
files: FileSpecification[];
|
|
54
|
+
providedContext: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type { BrowserTesterOptions as B, ModuleDefinitionDurationsDiagnostic as M, SerializedTestSpecification as S, UntrackedModuleDefinitionDiagnostic as U, ModuleDefinitionDiagnostic as a, ModuleDefinitionLocation as b, SourceModuleDiagnostic as c, SourceModuleLocations as d };
|
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
|
|
|
3
3
|
import { normalize } from 'pathe';
|
|
4
4
|
import c from 'tinyrainbow';
|
|
5
5
|
import { a as defaultPort, d as defaultBrowserPort } from './constants.D_Q9UYh-.js';
|
|
6
|
-
import { R as ReportersMap } from './index.
|
|
6
|
+
import { R as ReportersMap } from './index.456_DGfR.js';
|
|
7
7
|
|
|
8
8
|
function toArr(any) {
|
|
9
9
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
@@ -619,7 +619,7 @@ class CAC extends EventEmitter {
|
|
|
619
619
|
|
|
620
620
|
const cac = (name = "") => new CAC(name);
|
|
621
621
|
|
|
622
|
-
var version = "4.0.
|
|
622
|
+
var version = "4.0.15";
|
|
623
623
|
|
|
624
624
|
const apiConfig = (port) => ({
|
|
625
625
|
port: {
|
|
@@ -843,23 +843,6 @@ const cliOptionsConfig = {
|
|
|
843
843
|
argument: "[port]",
|
|
844
844
|
subcommands: apiConfig(defaultBrowserPort)
|
|
845
845
|
},
|
|
846
|
-
provider: {
|
|
847
|
-
description: "Provider used to run browser tests. Some browsers are only available for specific providers. Can be \"webdriverio\", \"playwright\", \"preview\", or the path to a custom provider. Visit [`browser.provider`](https://vitest.dev/config/browser/provider) for more information",
|
|
848
|
-
argument: "<name>",
|
|
849
|
-
subcommands: null,
|
|
850
|
-
transform(value) {
|
|
851
|
-
const supported = [
|
|
852
|
-
"playwright",
|
|
853
|
-
"webdriverio",
|
|
854
|
-
"preview"
|
|
855
|
-
];
|
|
856
|
-
if (typeof value !== "string" || !supported.includes(value)) throw new Error(`Unsupported browser provider: ${value}. Supported providers are: ${supported.join(", ")}`);
|
|
857
|
-
return {
|
|
858
|
-
name: value,
|
|
859
|
-
_cli: true
|
|
860
|
-
};
|
|
861
|
-
}
|
|
862
|
-
},
|
|
863
846
|
isolate: { description: "Run every browser test file in isolation. To disable isolation, use `--browser.isolate=false` (default: `true`)" },
|
|
864
847
|
ui: { description: "Show Vitest UI when running tests (default: `!process.env.CI`)" },
|
|
865
848
|
fileParallelism: { description: "Should browser test files run in parallel. Use `--browser.fileParallelism=false` to disable (default: `true`)" },
|
|
@@ -884,7 +867,8 @@ const cliOptionsConfig = {
|
|
|
884
867
|
locators: null,
|
|
885
868
|
testerHtmlPath: null,
|
|
886
869
|
instances: null,
|
|
887
|
-
expect: null
|
|
870
|
+
expect: null,
|
|
871
|
+
provider: null
|
|
888
872
|
}
|
|
889
873
|
},
|
|
890
874
|
pool: {
|
|
@@ -1159,7 +1143,8 @@ const cliOptionsConfig = {
|
|
|
1159
1143
|
subcommands: {
|
|
1160
1144
|
fsModuleCache: { description: "Enable caching of modules on the file system between reruns." },
|
|
1161
1145
|
fsModuleCachePath: null,
|
|
1162
|
-
openTelemetry: null
|
|
1146
|
+
openTelemetry: null,
|
|
1147
|
+
printImportBreakdown: { description: "Print import breakdown after the summary. If the reporter doesn't support summary, this will have no effect. Note that UI's \"Module Graph\" tab always has an import breakdown." }
|
|
1163
1148
|
}
|
|
1164
1149
|
},
|
|
1165
1150
|
cliExclude: null,
|
|
@@ -1371,11 +1356,11 @@ function normalizeCliOptions(cliFilters, argv) {
|
|
|
1371
1356
|
}
|
|
1372
1357
|
async function start(mode, cliFilters, options) {
|
|
1373
1358
|
try {
|
|
1374
|
-
const { startVitest } = await import('./cli-api.
|
|
1359
|
+
const { startVitest } = await import('./cli-api.C7sYjHmQ.js').then(function (n) { return n.p; });
|
|
1375
1360
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
1376
1361
|
if (!ctx.shouldKeepServer()) await ctx.exit();
|
|
1377
1362
|
} catch (e) {
|
|
1378
|
-
const { errorBanner } = await import('./index.
|
|
1363
|
+
const { errorBanner } = await import('./index.456_DGfR.js').then(function (n) { return n.A; });
|
|
1379
1364
|
console.error(`\n${errorBanner("Startup Error")}`);
|
|
1380
1365
|
console.error(e);
|
|
1381
1366
|
console.error("\n\n");
|
|
@@ -1393,7 +1378,7 @@ async function init(project) {
|
|
|
1393
1378
|
}
|
|
1394
1379
|
async function collect(mode, cliFilters, options) {
|
|
1395
1380
|
try {
|
|
1396
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.
|
|
1381
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.C7sYjHmQ.js').then(function (n) { return n.p; });
|
|
1397
1382
|
const ctx = await prepareVitest(mode, {
|
|
1398
1383
|
...normalizeCliOptions(cliFilters, options),
|
|
1399
1384
|
watch: false,
|
|
@@ -1412,7 +1397,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1412
1397
|
} else outputFileList(await ctx.getRelevantTestSpecifications(cliFilters.map(normalize)), options);
|
|
1413
1398
|
await ctx.close();
|
|
1414
1399
|
} catch (e) {
|
|
1415
|
-
const { errorBanner } = await import('./index.
|
|
1400
|
+
const { errorBanner } = await import('./index.456_DGfR.js').then(function (n) { return n.A; });
|
|
1416
1401
|
console.error(`\n${errorBanner("Collect Error")}`);
|
|
1417
1402
|
console.error(e);
|
|
1418
1403
|
console.error("\n\n");
|