vitest 3.1.2 → 3.1.3
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/chunks/{base.k5EeHg0m.js → base.DslwPSCy.js} +1 -1
- package/dist/chunks/{cac.C5_4mAsf.js → cac.BN2e7cE1.js} +3 -3
- package/dist/chunks/{cli-api.z029PxYZ.js → cli-api.Bti1vevt.js} +54 -30
- package/dist/chunks/{coverage.BUdIvXbr.js → coverage.87S59-Sl.js} +9 -10
- package/dist/chunks/{execute.CwmnH2oH.js → execute.BpmIjFTD.js} +22 -12
- package/dist/chunks/{index._vwY_KdO.js → index.De2FqGmR.js} +28 -13
- package/dist/chunks/{reporters.d.79o4mouw.d.ts → reporters.d.DG9VKi4m.d.ts} +8 -0
- package/dist/chunks/{vite.d.BVr6Nvdj.d.ts → vite.d.D3ndlJcw.d.ts} +1 -1
- package/dist/chunks/{vm.BmHENIuV.js → vm.CuLHT1BG.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +3 -3
- package/dist/coverage.d.ts +1 -1
- package/dist/coverage.js +1 -1
- package/dist/execute.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/node.d.ts +3 -3
- package/dist/node.js +6 -6
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +1 -1
- package/dist/runners.js +1 -1
- package/dist/workers/forks.js +2 -2
- package/dist/workers/threads.js +2 -2
- package/dist/workers/vmForks.js +2 -2
- package/dist/workers/vmThreads.js +2 -2
- package/dist/workers.js +3 -3
- package/package.json +11 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleCacheMap } from 'vite-node/client';
|
|
2
|
-
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.
|
|
2
|
+
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.BpmIjFTD.js';
|
|
3
3
|
import { p as provideWorkerState } from './utils.CgTj3MsC.js';
|
|
4
4
|
|
|
5
5
|
let _viteNode;
|
|
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
|
|
|
618
618
|
|
|
619
619
|
const cac = (name = "") => new CAC(name);
|
|
620
620
|
|
|
621
|
-
var version = "3.1.
|
|
621
|
+
var version = "3.1.3";
|
|
622
622
|
|
|
623
623
|
const apiConfig = (port) => ({
|
|
624
624
|
port: {
|
|
@@ -1464,7 +1464,7 @@ async function start(mode, cliFilters, options) {
|
|
|
1464
1464
|
process.title = "node (vitest)";
|
|
1465
1465
|
} catch {}
|
|
1466
1466
|
try {
|
|
1467
|
-
const { startVitest } = await import('./cli-api.
|
|
1467
|
+
const { startVitest } = await import('./cli-api.Bti1vevt.js').then(function (n) { return n.f; });
|
|
1468
1468
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
1469
1469
|
if (!ctx.shouldKeepServer()) {
|
|
1470
1470
|
await ctx.exit();
|
|
@@ -1493,7 +1493,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1493
1493
|
process.title = "node (vitest)";
|
|
1494
1494
|
} catch {}
|
|
1495
1495
|
try {
|
|
1496
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.
|
|
1496
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.Bti1vevt.js').then(function (n) { return n.f; });
|
|
1497
1497
|
const ctx = await prepareVitest(mode, {
|
|
1498
1498
|
...normalizeCliOptions(cliFilters, options),
|
|
1499
1499
|
watch: false,
|
|
@@ -5,15 +5,15 @@ import p, { resolve as resolve$1 } from 'node:path';
|
|
|
5
5
|
import { noop, isPrimitive, createDefer, highlight, toArray, deepMerge, nanoid, slash, deepClone, notNullish } from '@vitest/utils';
|
|
6
6
|
import { f as findUp, p as prompt } from './index.DBIGubLC.js';
|
|
7
7
|
import * as vite from 'vite';
|
|
8
|
-
import { searchForWorkspaceRoot, version,
|
|
8
|
+
import { searchForWorkspaceRoot, version, mergeConfig, createServer } from 'vite';
|
|
9
9
|
import { A as API_PATH, c as configFiles, d as defaultBrowserPort, w as workspacesFiles, a as defaultPort } from './constants.BZZyIeIE.js';
|
|
10
10
|
import { generateFileHash, createFileTask, limitConcurrency, hasFailed, getTasks, getTests } from '@vitest/runner/utils';
|
|
11
11
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
12
12
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
13
13
|
import { ViteNodeServer } from 'vite-node/server';
|
|
14
|
-
import { v as version$1 } from './cac.
|
|
14
|
+
import { v as version$1 } from './cac.BN2e7cE1.js';
|
|
15
15
|
import { c as createBirpc } from './index.CJ0plNrh.js';
|
|
16
|
-
import { p as parse, s as stringify, g as printError, h as generateCodeFrame, b as BenchmarkReportsMap, R as ReportersMap, i as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.
|
|
16
|
+
import { p as parse, s as stringify, g as printError, h as generateCodeFrame, b as BenchmarkReportsMap, R as ReportersMap, i as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.De2FqGmR.js';
|
|
17
17
|
import require$$0$3 from 'events';
|
|
18
18
|
import require$$1$1 from 'https';
|
|
19
19
|
import require$$2 from 'http';
|
|
@@ -28,7 +28,7 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
|
|
|
28
28
|
import { parseErrorStacktrace } from '@vitest/utils/source-map';
|
|
29
29
|
import crypto from 'node:crypto';
|
|
30
30
|
import { distDir, rootDir } from '../path.js';
|
|
31
|
-
import { R as RandomSequencer, i as isPackageExists, h as hash, V as VitestCache, g as getFilePoolName, d as isBrowserEnabled, m as mm, r as resolveConfig, e as groupBy, f as getCoverageProvider, j as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.
|
|
31
|
+
import { R as RandomSequencer, i as isPackageExists, h as hash, V as VitestCache, g as getFilePoolName, d as isBrowserEnabled, m as mm, r as resolveConfig, e as groupBy, f as getCoverageProvider, j as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.87S59-Sl.js';
|
|
32
32
|
import { c as convertTasksToEvents } from './typechecker.DYQbn8uK.js';
|
|
33
33
|
import { Console } from 'node:console';
|
|
34
34
|
import c from 'tinyrainbow';
|
|
@@ -5252,6 +5252,7 @@ var setup$1 = /*#__PURE__*/Object.freeze({
|
|
|
5252
5252
|
|
|
5253
5253
|
class BrowserSessions {
|
|
5254
5254
|
sessions = new Map();
|
|
5255
|
+
sessionIds = new Set();
|
|
5255
5256
|
getSession(sessionId) {
|
|
5256
5257
|
return this.sessions.get(sessionId);
|
|
5257
5258
|
}
|
|
@@ -6702,26 +6703,6 @@ function WorkspaceVitestPlugin(project, options) {
|
|
|
6702
6703
|
name = options.workspacePath.toString();
|
|
6703
6704
|
}
|
|
6704
6705
|
}
|
|
6705
|
-
const workspaceNames = [name];
|
|
6706
|
-
if (viteConfig.test?.browser?.enabled) {
|
|
6707
|
-
if (viteConfig.test.browser.name) {
|
|
6708
|
-
const browser = viteConfig.test.browser.name;
|
|
6709
|
-
workspaceNames.push(name ? `${name} (${browser})` : browser);
|
|
6710
|
-
}
|
|
6711
|
-
viteConfig.test.browser.instances?.forEach((instance) => {
|
|
6712
|
-
instance.name ??= name ? `${name} (${instance.browser})` : instance.browser;
|
|
6713
|
-
workspaceNames.push(instance.name);
|
|
6714
|
-
});
|
|
6715
|
-
}
|
|
6716
|
-
const filters = project.vitest.config.project;
|
|
6717
|
-
if (filters.length) {
|
|
6718
|
-
const hasProject = workspaceNames.some((name) => {
|
|
6719
|
-
return project.vitest.matchesProjectFilter(name);
|
|
6720
|
-
});
|
|
6721
|
-
if (!hasProject) {
|
|
6722
|
-
throw new VitestFilteredOutProjectError();
|
|
6723
|
-
}
|
|
6724
|
-
}
|
|
6725
6706
|
const resolveOptions = getDefaultResolveOptions();
|
|
6726
6707
|
const config = {
|
|
6727
6708
|
root,
|
|
@@ -6747,7 +6728,30 @@ function WorkspaceVitestPlugin(project, options) {
|
|
|
6747
6728
|
environments: { ssr: { resolve: resolveOptions } },
|
|
6748
6729
|
test: { name }
|
|
6749
6730
|
};
|
|
6731
|
+
if (project.vitest._options.browser && viteConfig.test?.browser) {
|
|
6732
|
+
viteConfig.test.browser = mergeConfig(viteConfig.test.browser, project.vitest._options.browser);
|
|
6733
|
+
}
|
|
6750
6734
|
config.test.defines = defines;
|
|
6735
|
+
const workspaceNames = [name];
|
|
6736
|
+
if (viteConfig.test?.browser?.enabled) {
|
|
6737
|
+
if (viteConfig.test.browser.name && !viteConfig.test.browser.instances?.length) {
|
|
6738
|
+
const browser = viteConfig.test.browser.name;
|
|
6739
|
+
workspaceNames.push(name ? `${name} (${browser})` : browser);
|
|
6740
|
+
}
|
|
6741
|
+
viteConfig.test.browser.instances?.forEach((instance) => {
|
|
6742
|
+
instance.name ??= name ? `${name} (${instance.browser})` : instance.browser;
|
|
6743
|
+
workspaceNames.push(instance.name);
|
|
6744
|
+
});
|
|
6745
|
+
}
|
|
6746
|
+
const filters = project.vitest.config.project;
|
|
6747
|
+
if (filters.length) {
|
|
6748
|
+
const hasProject = workspaceNames.some((name) => {
|
|
6749
|
+
return project.vitest.matchesProjectFilter(name);
|
|
6750
|
+
});
|
|
6751
|
+
if (!hasProject) {
|
|
6752
|
+
throw new VitestFilteredOutProjectError();
|
|
6753
|
+
}
|
|
6754
|
+
}
|
|
6751
6755
|
const classNameStrategy = typeof testConfig.css !== "boolean" && testConfig.css?.modules?.classNameStrategy || "stable";
|
|
6752
6756
|
if (classNameStrategy !== "scoped") {
|
|
6753
6757
|
config.css ??= {};
|
|
@@ -7994,6 +7998,7 @@ class StateManager {
|
|
|
7994
7998
|
errorsSet = new Set();
|
|
7995
7999
|
processTimeoutCauses = new Set();
|
|
7996
8000
|
reportedTasksMap = new WeakMap();
|
|
8001
|
+
blobs;
|
|
7997
8002
|
catchError(err, type) {
|
|
7998
8003
|
if (isAggregateError(err)) {
|
|
7999
8004
|
return err.errors.forEach((error) => this.catchError(error, type));
|
|
@@ -8505,8 +8510,8 @@ async function resolveBrowserWorkspace(vitest, names, resolvedProjects) {
|
|
|
8505
8510
|
return;
|
|
8506
8511
|
}
|
|
8507
8512
|
const instances = project.config.browser.instances || [];
|
|
8508
|
-
|
|
8509
|
-
|
|
8513
|
+
const browser = project.config.browser.name;
|
|
8514
|
+
if (instances.length === 0 && browser) {
|
|
8510
8515
|
instances.push({
|
|
8511
8516
|
browser,
|
|
8512
8517
|
name: project.name ? `${project.name} (${browser})` : browser
|
|
@@ -8595,7 +8600,7 @@ function cloneConfig(project, { browser,...config }) {
|
|
|
8595
8600
|
testerHtmlPath: testerHtmlPath ?? currentConfig.testerHtmlPath,
|
|
8596
8601
|
screenshotDirectory: screenshotDirectory ?? currentConfig.screenshotDirectory,
|
|
8597
8602
|
screenshotFailures: screenshotFailures ?? currentConfig.screenshotFailures,
|
|
8598
|
-
headless:
|
|
8603
|
+
headless: headless ?? currentConfig.headless,
|
|
8599
8604
|
name: browser,
|
|
8600
8605
|
providerOptions: config,
|
|
8601
8606
|
instances: undefined
|
|
@@ -8910,8 +8915,19 @@ class Vitest {
|
|
|
8910
8915
|
injectTestProjects: this.injectTestProject
|
|
8911
8916
|
}));
|
|
8912
8917
|
}));
|
|
8918
|
+
if (options.browser?.enabled) {
|
|
8919
|
+
const browserProjects = this.projects.filter((p) => p.config.browser.enabled);
|
|
8920
|
+
if (!browserProjects.length) {
|
|
8921
|
+
throw new Error(`Vitest received --browser flag, but no project had a browser configuration.`);
|
|
8922
|
+
}
|
|
8923
|
+
}
|
|
8913
8924
|
if (!this.projects.length) {
|
|
8914
|
-
|
|
8925
|
+
const filter = toArray(resolved.project).join("\", \"");
|
|
8926
|
+
if (filter) {
|
|
8927
|
+
throw new Error(`No projects matched the filter "${filter}".`);
|
|
8928
|
+
} else {
|
|
8929
|
+
throw new Error(`Vitest wasn't able to resolve any project.`);
|
|
8930
|
+
}
|
|
8915
8931
|
}
|
|
8916
8932
|
if (!this.coreWorkspaceProject) {
|
|
8917
8933
|
this.coreWorkspaceProject = TestProject._createBasicProject(this);
|
|
@@ -9047,7 +9063,13 @@ class Vitest {
|
|
|
9047
9063
|
if (this.reporters.some((r) => r instanceof BlobReporter)) {
|
|
9048
9064
|
throw new Error("Cannot merge reports when `--reporter=blob` is used. Remove blob reporter from the config first.");
|
|
9049
9065
|
}
|
|
9050
|
-
const { files, errors, coverages } = await readBlobs(this.version, directory || this.config.mergeReports, this.projects);
|
|
9066
|
+
const { files, errors, coverages, executionTimes } = await readBlobs(this.version, directory || this.config.mergeReports, this.projects);
|
|
9067
|
+
this.state.blobs = {
|
|
9068
|
+
files,
|
|
9069
|
+
errors,
|
|
9070
|
+
coverages,
|
|
9071
|
+
executionTimes
|
|
9072
|
+
};
|
|
9051
9073
|
await this.report("onInit", this);
|
|
9052
9074
|
await this.report("onPathsCollected", files.flatMap((f) => f.filepath));
|
|
9053
9075
|
const specifications = [];
|
|
@@ -9246,7 +9268,9 @@ class Vitest {
|
|
|
9246
9268
|
process.exitCode = 1;
|
|
9247
9269
|
}
|
|
9248
9270
|
this.cache.results.updateResults(files);
|
|
9249
|
-
|
|
9271
|
+
try {
|
|
9272
|
+
await this.cache.results.writeToCache();
|
|
9273
|
+
} catch {}
|
|
9250
9274
|
return {
|
|
9251
9275
|
testModules: this.state.getTestModules(),
|
|
9252
9276
|
unhandledErrors: this.state.getUnhandledErrors()
|
|
@@ -7932,17 +7932,16 @@ function resolveConfig$1(vitest, options, viteConfig) {
|
|
|
7932
7932
|
}
|
|
7933
7933
|
}
|
|
7934
7934
|
const browser = resolved.browser;
|
|
7935
|
-
if (browser.enabled) {
|
|
7935
|
+
if (browser.enabled && viteConfig.test?.browser) {
|
|
7936
7936
|
if (!browser.name && !browser.instances) {
|
|
7937
|
-
browser.
|
|
7938
|
-
}
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
}
|
|
7937
|
+
throw new Error(`Vitest Browser Mode requires "browser.name" (deprecated) or "browser.instances" options, none were set.`);
|
|
7938
|
+
}
|
|
7939
|
+
const instances = browser.instances;
|
|
7940
|
+
if (browser.name && browser.instances) {
|
|
7941
|
+
browser.instances = browser.instances.filter((instance) => instance.browser === browser.name);
|
|
7942
|
+
}
|
|
7943
|
+
if (browser.instances && !browser.instances.length) {
|
|
7944
|
+
throw new Error([`"browser.instances" was set in the config, but the array is empty. Define at least one browser config.`, browser.name && instances?.length ? ` The "browser.name" was set to "${browser.name}" which filtered all configs (${instances.map((c) => c.browser).join(", ")}). Did you mean to use another name?` : ""].join(""));
|
|
7946
7945
|
}
|
|
7947
7946
|
}
|
|
7948
7947
|
const playwrightChromiumOnly = isPlaywrightChromiumOnly(vitest, resolved);
|
|
@@ -573,6 +573,25 @@ function listenForErrors(state) {
|
|
|
573
573
|
process.off("unhandledRejection", unhandledRejection);
|
|
574
574
|
});
|
|
575
575
|
}
|
|
576
|
+
const relativeIds = {};
|
|
577
|
+
function getVitestImport(id, state) {
|
|
578
|
+
if (externalizeMap.has(id)) {
|
|
579
|
+
return { externalize: externalizeMap.get(id) };
|
|
580
|
+
}
|
|
581
|
+
const root = state().config.root;
|
|
582
|
+
const relativeRoot = relativeIds[root] ?? (relativeIds[root] = normalizedDistDir.slice(root.length));
|
|
583
|
+
if (id.includes(distDir) || id.includes(normalizedDistDir) || relativeRoot && relativeRoot !== "/" && id.startsWith(relativeRoot)) {
|
|
584
|
+
const { path } = toFilePath(id, root);
|
|
585
|
+
const externalize = pathToFileURL(path).toString();
|
|
586
|
+
externalizeMap.set(id, externalize);
|
|
587
|
+
return { externalize };
|
|
588
|
+
}
|
|
589
|
+
if (bareVitestRegexp.test(id)) {
|
|
590
|
+
externalizeMap.set(id, id);
|
|
591
|
+
return { externalize: id };
|
|
592
|
+
}
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
576
595
|
async function startVitestExecutor(options) {
|
|
577
596
|
const state = () => globalThis.__vitest_worker__ || options.state;
|
|
578
597
|
const rpc = () => state().rpc;
|
|
@@ -585,18 +604,9 @@ async function startVitestExecutor(options) {
|
|
|
585
604
|
};
|
|
586
605
|
return await createVitestExecutor({
|
|
587
606
|
async fetchModule(id) {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
if (id.includes(distDir) || id.includes(normalizedDistDir)) {
|
|
592
|
-
const { path } = toFilePath(id, state().config.root);
|
|
593
|
-
const externalize = pathToFileURL(path).toString();
|
|
594
|
-
externalizeMap.set(id, externalize);
|
|
595
|
-
return { externalize };
|
|
596
|
-
}
|
|
597
|
-
if (bareVitestRegexp.test(id)) {
|
|
598
|
-
externalizeMap.set(id, id);
|
|
599
|
-
return { externalize: id };
|
|
607
|
+
const vitest = getVitestImport(id, state);
|
|
608
|
+
if (vitest) {
|
|
609
|
+
return vitest;
|
|
600
610
|
}
|
|
601
611
|
const result = await rpc().fetch(id, getTransformMode());
|
|
602
612
|
if (result.id && !result.externalize) {
|
|
@@ -10,7 +10,7 @@ import { performance as performance$1 } from 'node:perf_hooks';
|
|
|
10
10
|
import { parseErrorStacktrace, parseStacktrace } from '@vitest/utils/source-map';
|
|
11
11
|
import { i as isTTY } from './env.Dq0hM4Xv.js';
|
|
12
12
|
import { T as TypeCheckError, g as getOutputFile, h as hasFailedSnapshot } from './typechecker.DYQbn8uK.js';
|
|
13
|
-
import {
|
|
13
|
+
import { readdir, stat, readFile, mkdir, writeFile } from 'node:fs/promises';
|
|
14
14
|
import { Console } from 'node:console';
|
|
15
15
|
import { Writable } from 'node:stream';
|
|
16
16
|
import { createRequire } from 'node:module';
|
|
@@ -406,6 +406,7 @@ function lineNo(no = "") {
|
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
class BlobReporter {
|
|
409
|
+
start = 0;
|
|
409
410
|
ctx;
|
|
410
411
|
options;
|
|
411
412
|
constructor(options) {
|
|
@@ -416,8 +417,10 @@ class BlobReporter {
|
|
|
416
417
|
throw new Error("Blob reporter is not supported in watch mode");
|
|
417
418
|
}
|
|
418
419
|
this.ctx = ctx;
|
|
420
|
+
this.start = performance.now();
|
|
419
421
|
}
|
|
420
422
|
async onFinished(files = [], errors = [], coverage) {
|
|
423
|
+
const executionTime = performance.now() - this.start;
|
|
421
424
|
let outputFile = this.options.outputFile ?? getOutputFile(this.ctx.config, "blob");
|
|
422
425
|
if (!outputFile) {
|
|
423
426
|
const shard = this.ctx.config.shard;
|
|
@@ -435,22 +438,27 @@ class BlobReporter {
|
|
|
435
438
|
];
|
|
436
439
|
}).filter((x) => x != null)];
|
|
437
440
|
});
|
|
438
|
-
const report =
|
|
441
|
+
const report = [
|
|
439
442
|
this.ctx.version,
|
|
440
443
|
files,
|
|
441
444
|
errors,
|
|
442
445
|
modules,
|
|
443
|
-
coverage
|
|
444
|
-
|
|
446
|
+
coverage,
|
|
447
|
+
executionTime
|
|
448
|
+
];
|
|
445
449
|
const reportFile = resolve(this.ctx.config.root, outputFile);
|
|
446
|
-
|
|
447
|
-
if (!existsSync(dir)) {
|
|
448
|
-
await mkdir(dir, { recursive: true });
|
|
449
|
-
}
|
|
450
|
-
await writeFile(reportFile, report, "utf-8");
|
|
450
|
+
await writeBlob(report, reportFile);
|
|
451
451
|
this.ctx.logger.log("blob report written to", reportFile);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
+
async function writeBlob(content, filename) {
|
|
455
|
+
const report = stringify(content);
|
|
456
|
+
const dir = dirname(filename);
|
|
457
|
+
if (!existsSync(dir)) {
|
|
458
|
+
await mkdir(dir, { recursive: true });
|
|
459
|
+
}
|
|
460
|
+
await writeFile(filename, report, "utf-8");
|
|
461
|
+
}
|
|
454
462
|
async function readBlobs(currentVersion, blobsDirectory, projectsArray) {
|
|
455
463
|
const resolvedDir = resolve(process.cwd(), blobsDirectory);
|
|
456
464
|
const blobsFiles = await readdir(resolvedDir);
|
|
@@ -461,7 +469,7 @@ async function readBlobs(currentVersion, blobsDirectory, projectsArray) {
|
|
|
461
469
|
throw new TypeError(`vitest.mergeReports() expects all paths in "${blobsDirectory}" to be files generated by the blob reporter, but "${filename}" is not a file`);
|
|
462
470
|
}
|
|
463
471
|
const content = await readFile(fullPath, "utf-8");
|
|
464
|
-
const [version, files, errors, moduleKeys, coverage] = parse(content);
|
|
472
|
+
const [version, files, errors, moduleKeys, coverage, executionTime] = parse(content);
|
|
465
473
|
if (!version) {
|
|
466
474
|
throw new TypeError(`vitest.mergeReports() expects all paths in "${blobsDirectory}" to be files generated by the blob reporter, but "${filename}" is not a valid blob file`);
|
|
467
475
|
}
|
|
@@ -471,7 +479,8 @@ async function readBlobs(currentVersion, blobsDirectory, projectsArray) {
|
|
|
471
479
|
errors,
|
|
472
480
|
moduleKeys,
|
|
473
481
|
coverage,
|
|
474
|
-
file: filename
|
|
482
|
+
file: filename,
|
|
483
|
+
executionTime
|
|
475
484
|
};
|
|
476
485
|
});
|
|
477
486
|
const blobs = await Promise.all(promises);
|
|
@@ -507,10 +516,12 @@ async function readBlobs(currentVersion, blobsDirectory, projectsArray) {
|
|
|
507
516
|
});
|
|
508
517
|
const errors = blobs.flatMap((blob) => blob.errors);
|
|
509
518
|
const coverages = blobs.map((blob) => blob.coverage);
|
|
519
|
+
const executionTimes = blobs.map((blob) => blob.executionTime);
|
|
510
520
|
return {
|
|
511
521
|
files,
|
|
512
522
|
errors,
|
|
513
|
-
coverages
|
|
523
|
+
coverages,
|
|
524
|
+
executionTimes
|
|
514
525
|
};
|
|
515
526
|
}
|
|
516
527
|
|
|
@@ -829,7 +840,8 @@ class BaseReporter {
|
|
|
829
840
|
if (this.watchFilters) {
|
|
830
841
|
this.log(padSummaryTitle("Duration"), formatTime(collectTime + testsTime + setupTime));
|
|
831
842
|
} else {
|
|
832
|
-
const
|
|
843
|
+
const blobs = this.ctx.state.blobs;
|
|
844
|
+
const executionTime = blobs?.executionTimes ? sum(blobs.executionTimes, (time) => time) : this.end - this.start;
|
|
833
845
|
const environmentTime = sum(files, (file) => file.environmentLoad);
|
|
834
846
|
const prepareTime = sum(files, (file) => file.prepareDuration);
|
|
835
847
|
const transformTime = sum(this.ctx.projects, (project) => project.vitenode.getTotalDuration());
|
|
@@ -844,6 +856,9 @@ class BaseReporter {
|
|
|
844
856
|
typecheck && `typecheck ${formatTime(typecheck)}`
|
|
845
857
|
].filter(Boolean).join(", ");
|
|
846
858
|
this.log(padSummaryTitle("Duration"), formatTime(executionTime) + c.dim(` (${timers})`));
|
|
859
|
+
if (blobs?.executionTimes) {
|
|
860
|
+
this.log(padSummaryTitle("Per blob") + blobs.executionTimes.map((time) => ` ${formatTime(time)}`).join(""));
|
|
861
|
+
}
|
|
847
862
|
}
|
|
848
863
|
this.log();
|
|
849
864
|
}
|
|
@@ -683,12 +683,19 @@ interface BlobOptions {
|
|
|
683
683
|
outputFile?: string;
|
|
684
684
|
}
|
|
685
685
|
declare class BlobReporter implements Reporter {
|
|
686
|
+
start: number;
|
|
686
687
|
ctx: Vitest;
|
|
687
688
|
options: BlobOptions;
|
|
688
689
|
constructor(options: BlobOptions);
|
|
689
690
|
onInit(ctx: Vitest): void;
|
|
690
691
|
onFinished(files: File[] | undefined, errors: unknown[] | undefined, coverage: unknown): Promise<void>;
|
|
691
692
|
}
|
|
693
|
+
interface MergedBlobs {
|
|
694
|
+
files: File[];
|
|
695
|
+
errors: unknown[];
|
|
696
|
+
coverages: unknown[];
|
|
697
|
+
executionTimes: number[];
|
|
698
|
+
}
|
|
692
699
|
|
|
693
700
|
interface DefaultReporterOptions extends BaseOptions {
|
|
694
701
|
summary?: boolean;
|
|
@@ -2741,6 +2748,7 @@ declare class StateManager {
|
|
|
2741
2748
|
errorsSet: Set<unknown>;
|
|
2742
2749
|
processTimeoutCauses: Set<string>;
|
|
2743
2750
|
reportedTasksMap: WeakMap<Task, TestModule | TestCase | TestSuite>;
|
|
2751
|
+
blobs?: MergedBlobs;
|
|
2744
2752
|
catchError(err: unknown, type: string): void;
|
|
2745
2753
|
clearErrors(): void;
|
|
2746
2754
|
getUnhandledErrors(): unknown[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HookHandler } from 'vite';
|
|
2
|
-
import { V as Vitest, T as TestProject, b as TestProjectConfiguration, I as InlineConfig } from './reporters.d.
|
|
2
|
+
import { V as Vitest, T as TestProject, b as TestProjectConfiguration, I as InlineConfig } from './reporters.d.DG9VKi4m.js';
|
|
3
3
|
|
|
4
4
|
interface VitestPluginContext {
|
|
5
5
|
vitest: Vitest;
|
|
@@ -3,7 +3,7 @@ import vm, { isContext } from 'node:vm';
|
|
|
3
3
|
import { dirname, basename, extname, normalize, join, resolve } from 'pathe';
|
|
4
4
|
import { distDir } from '../path.js';
|
|
5
5
|
import { createCustomConsole } from './console.K1NMVOSc.js';
|
|
6
|
-
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.
|
|
6
|
+
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.BpmIjFTD.js';
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import { dirname as dirname$1 } from 'node:path';
|
|
9
9
|
import { isPrimitive, isNodeBuiltin, toArray, getCachedData, setCacheData, isBareImport } from 'vite-node/utils';
|
package/dist/cli.js
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport, b as TestProjectConfiguration } from './chunks/reporters.d.
|
|
4
|
-
export { f as TestProjectInlineConfiguration, W as WorkspaceProjectConfiguration } from './chunks/reporters.d.
|
|
5
|
-
import './chunks/vite.d.
|
|
3
|
+
import { c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport, b as TestProjectConfiguration } from './chunks/reporters.d.DG9VKi4m.js';
|
|
4
|
+
export { f as TestProjectInlineConfiguration, W as WorkspaceProjectConfiguration } from './chunks/reporters.d.DG9VKi4m.js';
|
|
5
|
+
import './chunks/vite.d.D3ndlJcw.js';
|
|
6
6
|
import { F as FakeTimerInstallOpts } from './chunks/config.d.UqE-KR0o.js';
|
|
7
7
|
import '@vitest/runner';
|
|
8
8
|
import './chunks/environment.d.Dmw5ulng.js';
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.d.
|
|
1
|
+
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.d.DG9VKi4m.js';
|
|
2
2
|
import { TransformResult } from 'vite';
|
|
3
3
|
import { A as AfterSuiteRunMeta } from './chunks/environment.d.Dmw5ulng.js';
|
|
4
4
|
import '@vitest/runner';
|
package/dist/coverage.js
CHANGED
package/dist/execute.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { File as File$1, TaskResultPack as TaskResultPack$1, TaskEventPack, TaskPopulated, Suite as Suite$1, Test as Test$1, Custom as Custom$1, Task as Task$1, TaskBase as TaskBase$1, TaskResult as TaskResult$1, DoneCallback as DoneCallback$1, RuntimeContext as RuntimeContext$1, SuiteHooks as SuiteHooks$1, SequenceHooks as SequenceHooks$1, SequenceSetupFiles as SequenceSetupFiles$1 } from '@vitest/runner';
|
|
2
2
|
export { CancelReason, ExtendedContext, HookCleanupCallback, HookListener, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Custom as RunnerCustomCase, 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, TaskContext, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
3
|
-
import { S as SerializedTestSpecification, g as CoverageProvider$1, a as ReportContext$1, h as CoverageProviderModule$1, i as CoverageReporter$1, j as CoverageProviderName, k as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, l as CoverageIstanbulOptions$1, c as CoverageV8Options$1, m as CustomProviderOptions$1, n as Reporter$1, V as Vitest$1, o as BrowserScript$1, p as BrowserConfigOptions$1, q as BuiltinEnvironment$1, r as VitestEnvironment$1, P as Pool$1, s as PoolOptions$1, t as CSSModuleScopeStrategy$1, A as ApiConfig$1, u as VitestRunMode$1, D as DepsOptimizationOptions$1, v as TransformModePatterns$1, I as InlineConfig$1, w as TypecheckConfig$1, x as UserConfig$1, y as ResolvedConfig$1, z as ProjectConfig$1, U as UserWorkspaceConfig$1, E as BenchmarkUserOptions$1 } from './chunks/reporters.d.
|
|
4
|
-
export { F as BrowserTesterOptions } from './chunks/reporters.d.
|
|
3
|
+
import { S as SerializedTestSpecification, g as CoverageProvider$1, a as ReportContext$1, h as CoverageProviderModule$1, i as CoverageReporter$1, j as CoverageProviderName, k as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, l as CoverageIstanbulOptions$1, c as CoverageV8Options$1, m as CustomProviderOptions$1, n as Reporter$1, V as Vitest$1, o as BrowserScript$1, p as BrowserConfigOptions$1, q as BuiltinEnvironment$1, r as VitestEnvironment$1, P as Pool$1, s as PoolOptions$1, t as CSSModuleScopeStrategy$1, A as ApiConfig$1, u as VitestRunMode$1, D as DepsOptimizationOptions$1, v as TransformModePatterns$1, I as InlineConfig$1, w as TypecheckConfig$1, x as UserConfig$1, y as ResolvedConfig$1, z as ProjectConfig$1, U as UserWorkspaceConfig$1, E as BenchmarkUserOptions$1 } from './chunks/reporters.d.DG9VKi4m.js';
|
|
4
|
+
export { F as BrowserTesterOptions } from './chunks/reporters.d.DG9VKi4m.js';
|
|
5
5
|
import { W as WorkerContext$1 } from './chunks/worker.d.C-KN07Ls.js';
|
|
6
6
|
import { R as RawErrsMap$1, T as TscErrorInfo$1, C as CollectLineNumbers$1, a as CollectLines$1, b as RootAndTarget$1, c as Context$1 } from './chunks/global.d.CXRAxnWc.js';
|
|
7
7
|
import { b as Awaitable$1, U as UserConsoleLog, M as ModuleGraphData, P as ProvidedContext, N as Nullable$1, c as Arrayable$1, d as ArgumentsType$1, e as MutableArray$1, C as Constructable$1, a as EnvironmentReturn$1, V as VmEnvironmentReturn$1, E as Environment$1, R as ResolvedTestEnvironment$1, J as JSDOMOptions$1, H as HappyDOMOptions$1, f as EnvironmentOptions$1 } from './chunks/environment.d.Dmw5ulng.js';
|
|
8
8
|
export { A as AfterSuiteRunMeta, g as ModuleCache } from './chunks/environment.d.Dmw5ulng.js';
|
|
9
9
|
import { a as BirpcReturn, b as WorkerRPC$1 } from './chunks/worker.d.CHGSOG0s.js';
|
|
10
10
|
export { C as ContextRPC, d as ContextTestEnvironment, e as ResolveIdFunction, c as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.CHGSOG0s.js';
|
|
11
|
-
import './chunks/vite.d.
|
|
11
|
+
import './chunks/vite.d.D3ndlJcw.js';
|
|
12
12
|
import { a as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.UqE-KR0o.js';
|
|
13
13
|
export { b as RuntimeConfig, S as SerializedCoverageConfig } from './chunks/config.d.UqE-KR0o.js';
|
|
14
14
|
import { ExpectStatic } from '@vitest/expect';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { y as ResolvedConfig, x as UserConfig, u as VitestRunMode, G as VitestOptions, V as Vitest, A as ApiConfig, T as TestProject, H as TestSequencer, J as TestSpecification, L as Logger, K as TestModule, M as ModuleDiagnostic } from './chunks/reporters.d.
|
|
2
|
-
export { B as BaseCoverageOptions, E as BenchmarkUserOptions, af as BrowserBuiltinProvider, ag as BrowserCommand, ah as BrowserCommandContext, p as BrowserConfigOptions, ai as BrowserInstanceOption, aj as BrowserModuleMocker, ak as BrowserOrchestrator, al as BrowserProvider, am as BrowserProviderInitializationOptions, an as BrowserProviderModule, ao as BrowserProviderOptions, o as BrowserScript, ap as BrowserServerState, aq as BrowserServerStateSession, q as BuiltinEnvironment, ar as CDPSession, t as CSSModuleScopeStrategy, l as CoverageIstanbulOptions, k as CoverageOptions, g as CoverageProvider, h as CoverageProviderModule, i as CoverageReporter, c as CoverageV8Options, m as CustomProviderOptions, D as DepsOptimizationOptions, $ as HTMLOptions, I as InlineConfig, a1 as JUnitOptions, a0 as JsonOptions, O as OnServerRestartHandler, N as OnTestsRerunHandler, as as ParentProjectBrowser, P as Pool, s as PoolOptions, X as ProcessPool, at as ProjectBrowser, z as ProjectConfig, a as ReportContext, az as ReportedHookContext, n as Reporter, aw as ResolveSnapshotPathHandler, ax as ResolveSnapshotPathHandlerContext, au as ResolvedBrowserOptions, R as ResolvedCoverageOptions, av as ResolvedProjectConfig, _ as SerializedTestProject, a2 as TaskOptions, a3 as TestCase, a4 as TestCollection, a5 as TestDiagnostic, a6 as TestModuleState, a7 as TestResult, a8 as TestResultFailed, a9 as TestResultPassed, aa as TestResultSkipped, aA as TestRunEndReason, ay as TestRunResult, ae as TestSequencerConstructor, ab as TestState, ac as TestSuite, ad as TestSuiteState, v as TransformModePatterns, w as TypecheckConfig, U as UserWorkspaceConfig, r as VitestEnvironment, Q as VitestPackageInstaller, Y as WorkspaceSpec, Z as getFilePoolName } from './chunks/reporters.d.
|
|
1
|
+
import { y as ResolvedConfig, x as UserConfig, u as VitestRunMode, G as VitestOptions, V as Vitest, A as ApiConfig, T as TestProject, H as TestSequencer, J as TestSpecification, L as Logger, K as TestModule, M as ModuleDiagnostic } from './chunks/reporters.d.DG9VKi4m.js';
|
|
2
|
+
export { B as BaseCoverageOptions, E as BenchmarkUserOptions, af as BrowserBuiltinProvider, ag as BrowserCommand, ah as BrowserCommandContext, p as BrowserConfigOptions, ai as BrowserInstanceOption, aj as BrowserModuleMocker, ak as BrowserOrchestrator, al as BrowserProvider, am as BrowserProviderInitializationOptions, an as BrowserProviderModule, ao as BrowserProviderOptions, o as BrowserScript, ap as BrowserServerState, aq as BrowserServerStateSession, q as BuiltinEnvironment, ar as CDPSession, t as CSSModuleScopeStrategy, l as CoverageIstanbulOptions, k as CoverageOptions, g as CoverageProvider, h as CoverageProviderModule, i as CoverageReporter, c as CoverageV8Options, m as CustomProviderOptions, D as DepsOptimizationOptions, $ as HTMLOptions, I as InlineConfig, a1 as JUnitOptions, a0 as JsonOptions, O as OnServerRestartHandler, N as OnTestsRerunHandler, as as ParentProjectBrowser, P as Pool, s as PoolOptions, X as ProcessPool, at as ProjectBrowser, z as ProjectConfig, a as ReportContext, az as ReportedHookContext, n as Reporter, aw as ResolveSnapshotPathHandler, ax as ResolveSnapshotPathHandlerContext, au as ResolvedBrowserOptions, R as ResolvedCoverageOptions, av as ResolvedProjectConfig, _ as SerializedTestProject, a2 as TaskOptions, a3 as TestCase, a4 as TestCollection, a5 as TestDiagnostic, a6 as TestModuleState, a7 as TestResult, a8 as TestResultFailed, a9 as TestResultPassed, aa as TestResultSkipped, aA as TestRunEndReason, ay as TestRunResult, ae as TestSequencerConstructor, ab as TestState, ac as TestSuite, ad as TestSuiteState, v as TransformModePatterns, w as TypecheckConfig, U as UserWorkspaceConfig, r as VitestEnvironment, Q as VitestPackageInstaller, Y as WorkspaceSpec, Z as getFilePoolName } from './chunks/reporters.d.DG9VKi4m.js';
|
|
3
3
|
import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, LogLevel, LoggerOptions, Logger as Logger$1, createServer as createServer$1 } from 'vite';
|
|
4
4
|
import * as vite from 'vite';
|
|
5
5
|
export { vite as Vite };
|
|
@@ -8,7 +8,7 @@ import { IncomingMessage } from 'node:http';
|
|
|
8
8
|
import { R as RuntimeRPC } from './chunks/worker.d.CHGSOG0s.js';
|
|
9
9
|
export { T as TestExecutionType } from './chunks/worker.d.CHGSOG0s.js';
|
|
10
10
|
import { Writable } from 'node:stream';
|
|
11
|
-
export { V as VitestPluginContext } from './chunks/vite.d.
|
|
11
|
+
export { V as VitestPluginContext } from './chunks/vite.d.D3ndlJcw.js';
|
|
12
12
|
export { W as WorkerContext } from './chunks/worker.d.C-KN07Ls.js';
|
|
13
13
|
export { C as TypeCheckCollectLineNumbers, a as TypeCheckCollectLines, c as TypeCheckContext, T as TypeCheckErrorInfo, R as TypeCheckRawErrorsMap, b as TypeCheckRootAndTarget } from './chunks/global.d.CXRAxnWc.js';
|
|
14
14
|
import { Debugger } from 'debug';
|
package/dist/node.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { resolveConfig as resolveConfig$1, mergeConfig, createServer as createServer$1 } from 'vite';
|
|
2
2
|
export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
3
|
-
import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.
|
|
4
|
-
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
5
|
-
export { p as parseCLI } from './chunks/cac.
|
|
6
|
-
import { r as resolveConfig$2 } from './chunks/coverage.
|
|
7
|
-
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.
|
|
3
|
+
import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.Bti1vevt.js';
|
|
4
|
+
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.Bti1vevt.js';
|
|
5
|
+
export { p as parseCLI } from './chunks/cac.BN2e7cE1.js';
|
|
6
|
+
import { r as resolveConfig$2 } from './chunks/coverage.87S59-Sl.js';
|
|
7
|
+
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.87S59-Sl.js';
|
|
8
8
|
import { slash } from '@vitest/utils';
|
|
9
9
|
import { f as findUp } from './chunks/index.DBIGubLC.js';
|
|
10
10
|
import { resolve } from 'pathe';
|
|
@@ -19,7 +19,7 @@ import '@vitest/snapshot/manager';
|
|
|
19
19
|
import 'vite-node/client';
|
|
20
20
|
import 'vite-node/server';
|
|
21
21
|
import './chunks/index.CJ0plNrh.js';
|
|
22
|
-
import './chunks/index.
|
|
22
|
+
import './chunks/index.De2FqGmR.js';
|
|
23
23
|
import 'tinyrainbow';
|
|
24
24
|
import './chunks/utils.Cc45eY3L.js';
|
|
25
25
|
import 'node:util';
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aP as BaseReporter, aB as BasicReporter, aQ as BenchmarkBuiltinReporters, aC as BenchmarkReporter, aD as BenchmarkReportsMap, aR as BuiltinReporterOptions, aS as BuiltinReporters, aE as DefaultReporter, aF as DotReporter, aG as GithubActionsReporter, aH as HangingProcessReporter, aJ as JUnitReporter, aT as JsonAssertionResult, aI as JsonReporter, aU as JsonTestResult, aV as JsonTestResults, az as ReportedHookContext, n as Reporter, aK as ReportersMap, aL as TapFlatReporter, aM as TapReporter, aA as TestRunEndReason, aN as VerboseBenchmarkReporter, aO as VerboseReporter } from './chunks/reporters.d.
|
|
1
|
+
export { aP as BaseReporter, aB as BasicReporter, aQ as BenchmarkBuiltinReporters, aC as BenchmarkReporter, aD as BenchmarkReportsMap, aR as BuiltinReporterOptions, aS as BuiltinReporters, aE as DefaultReporter, aF as DotReporter, aG as GithubActionsReporter, aH as HangingProcessReporter, aJ as JUnitReporter, aT as JsonAssertionResult, aI as JsonReporter, aU as JsonTestResult, aV as JsonTestResults, az as ReportedHookContext, n as Reporter, aK as ReportersMap, aL as TapFlatReporter, aM as TapReporter, aA as TestRunEndReason, aN as VerboseBenchmarkReporter, aO as VerboseReporter } from './chunks/reporters.d.DG9VKi4m.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import './chunks/environment.d.Dmw5ulng.js';
|
|
4
4
|
import 'vitest/optional-types.js';
|
package/dist/reporters.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BasicReporter, a as BenchmarkReporter, b as BenchmarkReportsMap, D as DefaultReporter, c as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, d as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, e as TapReporter, V as VerboseBenchmarkReporter, f as VerboseReporter } from './chunks/index.
|
|
1
|
+
export { B as BasicReporter, a as BenchmarkReporter, b as BenchmarkReportsMap, D as DefaultReporter, c as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, d as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, e as TapReporter, V as VerboseBenchmarkReporter, f as VerboseReporter } from './chunks/index.De2FqGmR.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import '@vitest/runner/utils';
|
|
4
4
|
import 'pathe';
|
package/dist/runners.js
CHANGED
|
@@ -183,7 +183,6 @@ class VitestTestRunner {
|
|
|
183
183
|
if (test.mode !== "run" && test.mode !== "queued") {
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
clearModuleMocks(this.config);
|
|
187
186
|
this.workerState.current = test;
|
|
188
187
|
}
|
|
189
188
|
async onBeforeRunSuite(suite) {
|
|
@@ -196,6 +195,7 @@ class VitestTestRunner {
|
|
|
196
195
|
this.workerState.current = suite;
|
|
197
196
|
}
|
|
198
197
|
onBeforeTryTask(test) {
|
|
198
|
+
clearModuleMocks(this.config);
|
|
199
199
|
this.snapshotClient.clearTest(test.file.filepath, test.id);
|
|
200
200
|
setState({
|
|
201
201
|
assertionCalls: 0,
|
package/dist/workers/forks.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
2
|
+
import { r as runBaseTests } from '../chunks/base.DslwPSCy.js';
|
|
3
3
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.BfxieIyZ.js';
|
|
4
4
|
import 'vite-node/client';
|
|
5
|
-
import '../chunks/execute.
|
|
5
|
+
import '../chunks/execute.BpmIjFTD.js';
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'node:vm';
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
1
|
+
import { r as runBaseTests } from '../chunks/base.DslwPSCy.js';
|
|
2
2
|
import { a as createThreadsRpcOptions } from '../chunks/utils.BfxieIyZ.js';
|
|
3
3
|
import 'vite-node/client';
|
|
4
|
-
import '../chunks/execute.
|
|
4
|
+
import '../chunks/execute.BpmIjFTD.js';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:url';
|
|
7
7
|
import 'node:vm';
|
package/dist/workers/vmForks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
2
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.BfxieIyZ.js';
|
|
3
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
3
|
+
import { r as runVmTests } from '../chunks/vm.CuLHT1BG.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'node:vm';
|
|
@@ -13,7 +13,7 @@ import 'node:stream';
|
|
|
13
13
|
import 'tinyrainbow';
|
|
14
14
|
import '../chunks/date.CDOsz-HY.js';
|
|
15
15
|
import '../chunks/utils.CgTj3MsC.js';
|
|
16
|
-
import '../chunks/execute.
|
|
16
|
+
import '../chunks/execute.BpmIjFTD.js';
|
|
17
17
|
import 'node:fs';
|
|
18
18
|
import '@vitest/utils/error';
|
|
19
19
|
import 'vite-node/client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as createThreadsRpcOptions } from '../chunks/utils.BfxieIyZ.js';
|
|
2
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
2
|
+
import { r as runVmTests } from '../chunks/vm.CuLHT1BG.js';
|
|
3
3
|
import '@vitest/utils';
|
|
4
4
|
import 'node:url';
|
|
5
5
|
import 'node:vm';
|
|
@@ -12,7 +12,7 @@ import 'node:stream';
|
|
|
12
12
|
import 'tinyrainbow';
|
|
13
13
|
import '../chunks/date.CDOsz-HY.js';
|
|
14
14
|
import '../chunks/utils.CgTj3MsC.js';
|
|
15
|
-
import '../chunks/execute.
|
|
15
|
+
import '../chunks/execute.BpmIjFTD.js';
|
|
16
16
|
import 'node:fs';
|
|
17
17
|
import '@vitest/utils/error';
|
|
18
18
|
import 'vite-node/client';
|
package/dist/workers.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { p as provideWorkerState } from './chunks/utils.CgTj3MsC.js';
|
|
2
2
|
export { collect as collectVitestWorkerTests, run as runVitestWorker } from './worker.js';
|
|
3
|
-
export { r as runBaseTests } from './chunks/base.
|
|
3
|
+
export { r as runBaseTests } from './chunks/base.DslwPSCy.js';
|
|
4
4
|
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './chunks/utils.BfxieIyZ.js';
|
|
5
|
-
export { r as runVmTests } from './chunks/vm.
|
|
5
|
+
export { r as runVmTests } from './chunks/vm.CuLHT1BG.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import '@vitest/utils/source-map';
|
|
@@ -16,7 +16,7 @@ import './chunks/inspector.DbDkSkFn.js';
|
|
|
16
16
|
import 'node:module';
|
|
17
17
|
import './chunks/rpc.D9_013TY.js';
|
|
18
18
|
import './chunks/index.CJ0plNrh.js';
|
|
19
|
-
import './chunks/execute.
|
|
19
|
+
import './chunks/execute.BpmIjFTD.js';
|
|
20
20
|
import 'node:vm';
|
|
21
21
|
import '@vitest/utils/error';
|
|
22
22
|
import 'vite-node/utils';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.3",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -123,8 +123,8 @@
|
|
|
123
123
|
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
|
|
124
124
|
"happy-dom": "*",
|
|
125
125
|
"jsdom": "*",
|
|
126
|
-
"@vitest/
|
|
127
|
-
"@vitest/
|
|
126
|
+
"@vitest/browser": "3.1.3",
|
|
127
|
+
"@vitest/ui": "3.1.3"
|
|
128
128
|
},
|
|
129
129
|
"peerDependenciesMeta": {
|
|
130
130
|
"@edge-runtime/vm": {
|
|
@@ -163,14 +163,14 @@
|
|
|
163
163
|
"tinyrainbow": "^2.0.0",
|
|
164
164
|
"vite": "^5.0.0 || ^6.0.0",
|
|
165
165
|
"why-is-node-running": "^2.3.0",
|
|
166
|
-
"@vitest/expect": "3.1.
|
|
167
|
-
"@vitest/
|
|
168
|
-
"@vitest/
|
|
169
|
-
"@vitest/
|
|
170
|
-
"@vitest/spy": "3.1.
|
|
171
|
-
"@vitest/
|
|
172
|
-
"
|
|
173
|
-
"
|
|
166
|
+
"@vitest/expect": "3.1.3",
|
|
167
|
+
"@vitest/pretty-format": "^3.1.3",
|
|
168
|
+
"@vitest/snapshot": "3.1.3",
|
|
169
|
+
"@vitest/runner": "3.1.3",
|
|
170
|
+
"@vitest/spy": "3.1.3",
|
|
171
|
+
"@vitest/mocker": "3.1.3",
|
|
172
|
+
"vite-node": "3.1.3",
|
|
173
|
+
"@vitest/utils": "3.1.3"
|
|
174
174
|
},
|
|
175
175
|
"devDependencies": {
|
|
176
176
|
"@ampproject/remapping": "^2.3.0",
|