vitest 3.1.2 → 3.2.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 -2
- package/dist/browser.js +1 -1
- package/dist/chunks/{base.k5EeHg0m.js → base.SfTiRNZf.js} +2 -2
- package/dist/chunks/{cac.C5_4mAsf.js → cac.TfX2-DVH.js} +9 -7
- package/dist/chunks/{cli-api.z029PxYZ.js → cli-api.2970Nj9J.js} +937 -852
- package/dist/chunks/{coverage.BUdIvXbr.js → coverage.z0LVMxgb.js} +12 -11
- package/dist/chunks/{environment.d.Dmw5ulng.d.ts → environment.d.D8YDy2v5.d.ts} +2 -1
- package/dist/chunks/{execute.CwmnH2oH.js → execute.BpmIjFTD.js} +22 -12
- package/dist/chunks/{global.d.CXRAxnWc.d.ts → global.d.BCOHQEpR.d.ts} +7 -2
- package/dist/chunks/{globals.CZAEe_Gf.js → globals.Cg4NtV4P.js} +2 -2
- package/dist/chunks/{index.B0uVAVvx.js → index.BPc7M5ni.js} +1 -1
- package/dist/chunks/{index._vwY_KdO.js → index.CUacZlWG.js} +42 -21
- package/dist/chunks/{index.Cu2UlluP.js → index.DbWBPwtH.js} +2 -2
- package/dist/chunks/{reporters.d.79o4mouw.d.ts → reporters.d.DGm4k1Wx.d.ts} +59 -11
- package/dist/chunks/{runBaseTests.BV8m0B-u.js → runBaseTests.CguliJB5.js} +5 -5
- package/dist/chunks/{setup-common.AQcDs321.js → setup-common.BP6KrF_Z.js} +1 -1
- package/dist/chunks/{utils.Cc45eY3L.js → utils.8gfOgtry.js} +19 -12
- package/dist/chunks/{vi.ClIskdbk.js → vi.BFR5YIgu.js} +3 -0
- package/dist/chunks/{vite.d.BVr6Nvdj.d.ts → vite.d.DjP_ALCZ.d.ts} +1 -1
- package/dist/chunks/{vm.BmHENIuV.js → vm.CuLHT1BG.js} +1 -1
- package/dist/chunks/{worker.d.CHGSOG0s.d.ts → worker.d.CoCI7hzP.d.ts} +1 -1
- package/dist/chunks/{worker.d.C-KN07Ls.d.ts → worker.d.D5Xdi-Zr.d.ts} +1 -1
- package/dist/cli.js +1 -1
- package/dist/config.cjs +3 -0
- package/dist/config.d.ts +8 -5
- package/dist/config.js +3 -0
- package/dist/coverage.d.ts +3 -3
- package/dist/coverage.js +1 -1
- package/dist/environments.d.ts +2 -2
- package/dist/execute.d.ts +2 -2
- package/dist/execute.js +1 -1
- package/dist/index.d.ts +45 -10
- package/dist/index.js +2 -2
- package/dist/node.d.ts +8 -8
- package/dist/node.js +7 -7
- package/dist/reporters.d.ts +3 -3
- package/dist/reporters.js +2 -2
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +3 -3
- package/dist/workers/forks.js +2 -2
- package/dist/workers/runVmTests.js +5 -5
- package/dist/workers/threads.js +2 -2
- package/dist/workers/vmForks.js +2 -2
- package/dist/workers/vmThreads.js +2 -2
- package/dist/workers.d.ts +3 -3
- package/dist/workers.js +3 -3
- package/package.json +11 -11
|
@@ -7605,7 +7605,7 @@ function getDefaultPoolName(project) {
|
|
|
7605
7605
|
function getFilePoolName(project, file) {
|
|
7606
7606
|
for (const [glob, pool] of project.config.poolMatchGlobs) {
|
|
7607
7607
|
if (pool === "browser") {
|
|
7608
|
-
throw new Error("Since Vitest 0.31.0 \"browser\" pool is not supported in \"poolMatchGlobs\". You can create a
|
|
7608
|
+
throw new Error("Since Vitest 0.31.0 \"browser\" pool is not supported in \"poolMatchGlobs\". You can create a project to run some of your tests in browser in parallel. Read more: https://vitest.dev/guide/projects");
|
|
7609
7609
|
}
|
|
7610
7610
|
if (mm.isMatch(file, glob, { cwd: project.config.root })) {
|
|
7611
7611
|
return pool;
|
|
@@ -7872,6 +7872,8 @@ function resolveConfig$1(vitest, options, viteConfig) {
|
|
|
7872
7872
|
};
|
|
7873
7873
|
resolved.project = toArray(resolved.project);
|
|
7874
7874
|
resolved.provide ??= {};
|
|
7875
|
+
resolved.name = typeof options.name === "string" ? options.name : options.name?.label || "";
|
|
7876
|
+
resolved.color = typeof options.name !== "string" ? options.name?.color : undefined;
|
|
7875
7877
|
const inspector = resolved.inspect || resolved.inspectBrk;
|
|
7876
7878
|
resolved.inspector = {
|
|
7877
7879
|
...resolved.inspector,
|
|
@@ -7932,17 +7934,16 @@ function resolveConfig$1(vitest, options, viteConfig) {
|
|
|
7932
7934
|
}
|
|
7933
7935
|
}
|
|
7934
7936
|
const browser = resolved.browser;
|
|
7935
|
-
if (browser.enabled) {
|
|
7937
|
+
if (browser.enabled && viteConfig.test?.browser) {
|
|
7936
7938
|
if (!browser.name && !browser.instances) {
|
|
7937
|
-
browser.
|
|
7938
|
-
}
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
}
|
|
7939
|
+
throw new Error(`Vitest Browser Mode requires "browser.name" (deprecated) or "browser.instances" options, none were set.`);
|
|
7940
|
+
}
|
|
7941
|
+
const instances = browser.instances;
|
|
7942
|
+
if (browser.name && browser.instances) {
|
|
7943
|
+
browser.instances = browser.instances.filter((instance) => instance.browser === browser.name);
|
|
7944
|
+
}
|
|
7945
|
+
if (browser.instances && !browser.instances.length) {
|
|
7946
|
+
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
7947
|
}
|
|
7947
7948
|
}
|
|
7948
7949
|
const playwrightChromiumOnly = isPlaywrightChromiumOnly(vitest, resolved);
|
|
@@ -36,6 +36,7 @@ interface ModuleGraphData {
|
|
|
36
36
|
inlined: string[];
|
|
37
37
|
}
|
|
38
38
|
interface ProvidedContext {}
|
|
39
|
+
type LabelColor = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white";
|
|
39
40
|
|
|
40
41
|
type HappyDOMOptions = Omit<NonNullable<ConstructorParameters<typeof happyDomTypes.Window>[0]>, "console">;
|
|
41
42
|
|
|
@@ -114,4 +115,4 @@ interface ResolvedTestEnvironment {
|
|
|
114
115
|
options: Record<string, any> | null;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
|
-
export type { AfterSuiteRunMeta as A, Constructable as C, Environment as E, HappyDOMOptions as H, JSDOMOptions as J, ModuleGraphData as M, Nullable as N, ProvidedContext as P, ResolvedTestEnvironment as R, TransformMode as T, UserConsoleLog as U, VmEnvironmentReturn as V, EnvironmentReturn as a, Awaitable as b, Arrayable as c, ArgumentsType as d, MutableArray as e, EnvironmentOptions as f, ModuleCache as g };
|
|
118
|
+
export type { AfterSuiteRunMeta as A, Constructable as C, Environment as E, HappyDOMOptions as H, JSDOMOptions as J, LabelColor as L, ModuleGraphData as M, Nullable as N, ProvidedContext as P, ResolvedTestEnvironment as R, TransformMode as T, UserConsoleLog as U, VmEnvironmentReturn as V, EnvironmentReturn as a, Awaitable as b, Arrayable as c, ArgumentsType as d, MutableArray as e, EnvironmentOptions as f, ModuleCache as g };
|
|
@@ -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) {
|
|
@@ -2,7 +2,7 @@ import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect';
|
|
|
2
2
|
import { Plugin } from '@vitest/pretty-format';
|
|
3
3
|
import { SnapshotState } from '@vitest/snapshot';
|
|
4
4
|
import { B as BenchmarkResult } from './benchmark.d.BwvBVTda.js';
|
|
5
|
-
import { U as UserConsoleLog } from './environment.d.
|
|
5
|
+
import { U as UserConsoleLog } from './environment.d.D8YDy2v5.js';
|
|
6
6
|
|
|
7
7
|
type RawErrsMap = Map<string, TscErrorInfo[]>;
|
|
8
8
|
interface TscErrorInfo {
|
|
@@ -105,7 +105,12 @@ declare module "@vitest/expect" {
|
|
|
105
105
|
}
|
|
106
106
|
declare module "@vitest/runner" {
|
|
107
107
|
interface TestContext {
|
|
108
|
-
|
|
108
|
+
/**
|
|
109
|
+
* `expect` instance bound to the current test.
|
|
110
|
+
*
|
|
111
|
+
* This API is useful for running snapshot tests concurrently because global expect cannot track them.
|
|
112
|
+
*/
|
|
113
|
+
readonly expect: ExpectStatic;
|
|
109
114
|
}
|
|
110
115
|
interface TaskMeta {
|
|
111
116
|
typecheck?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as globalApis } from './constants.BZZyIeIE.js';
|
|
2
|
-
import { V as VitestIndex } from './index.
|
|
3
|
-
import './vi.
|
|
2
|
+
import { V as VitestIndex } from './index.BPc7M5ni.js';
|
|
3
|
+
import './vi.BFR5YIgu.js';
|
|
4
4
|
import '@vitest/expect';
|
|
5
5
|
import '@vitest/runner';
|
|
6
6
|
import '@vitest/runner/utils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createExpect, a as globalExpect, i as inject, v as vi, b as vitest } from './vi.
|
|
1
|
+
import { c as createExpect, a as globalExpect, i as inject, v as vi, b as vitest } from './vi.BFR5YIgu.js';
|
|
2
2
|
import { i as isFirstRun, a as runOnce } from './run-once.Dimr7O9f.js';
|
|
3
3
|
import { b as bench } from './benchmark.BoF7jW0Q.js';
|
|
4
4
|
import { expectTypeOf } from 'expect-type';
|
|
@@ -3,14 +3,14 @@ import { getTestName, hasFailed, getFullName, getTests, getSuites, getTasks } fr
|
|
|
3
3
|
import * as pathe from 'pathe';
|
|
4
4
|
import { relative, normalize, resolve, dirname } from 'pathe';
|
|
5
5
|
import c from 'tinyrainbow';
|
|
6
|
-
import { t as truncateString, e as errorBanner, F as F_POINTER, d as divider, f as formatTimeString, a as taskFail, b as F_CHECK, g as getStateSymbol, c as formatProjectName, h as F_RIGHT, w as withLabel, r as renderSnapshotSummary, p as padSummaryTitle, i as getStateString$1, j as formatTime, k as countTestErrors, l as F_TREE_NODE_END, m as F_TREE_NODE_MIDDLE } from './utils.
|
|
6
|
+
import { t as truncateString, e as errorBanner, F as F_POINTER, d as divider, f as formatTimeString, a as taskFail, b as F_CHECK, g as getStateSymbol, c as formatProjectName, h as F_RIGHT, w as withLabel, r as renderSnapshotSummary, p as padSummaryTitle, i as getStateString$1, j as formatTime, k as countTestErrors, l as F_TREE_NODE_END, m as F_TREE_NODE_MIDDLE } from './utils.8gfOgtry.js';
|
|
7
7
|
import { stripVTControlCharacters } from 'node:util';
|
|
8
8
|
import { positionToOffset, lineSplitRE, isPrimitive, inspect, toArray, notNullish } from '@vitest/utils';
|
|
9
9
|
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
|
|
|
@@ -676,7 +687,7 @@ class BaseReporter {
|
|
|
676
687
|
title += ` ${c.bgBlue(c.bold(" TS "))}`;
|
|
677
688
|
}
|
|
678
689
|
if (testModule.project.name) {
|
|
679
|
-
title += ` ${formatProjectName(testModule.project
|
|
690
|
+
title += ` ${formatProjectName(testModule.project, "")}`;
|
|
680
691
|
}
|
|
681
692
|
return ` ${title} ${testModule.task.name} ${suffix}`;
|
|
682
693
|
}
|
|
@@ -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
|
}
|
|
@@ -878,7 +893,8 @@ class BaseReporter {
|
|
|
878
893
|
continue;
|
|
879
894
|
}
|
|
880
895
|
const groupName = getFullName(group, c.dim(" > "));
|
|
881
|
-
this.
|
|
896
|
+
const project = this.ctx.projects.find((p) => p.name === bench.file.projectName);
|
|
897
|
+
this.log(` ${formatProjectName(project)}${bench.name}${c.dim(` - ${groupName}`)}`);
|
|
882
898
|
const siblings = group.tasks.filter((i) => i.meta.benchmark && i.result?.benchmark && i !== bench).sort((a, b) => a.result.benchmark.rank - b.result.benchmark.rank);
|
|
883
899
|
for (const sibling of siblings) {
|
|
884
900
|
const number = (sibling.result.benchmark.mean / bench.result.benchmark.mean).toFixed(2);
|
|
@@ -913,11 +929,12 @@ class BaseReporter {
|
|
|
913
929
|
for (const task of tasks) {
|
|
914
930
|
const filepath = task?.filepath || "";
|
|
915
931
|
const projectName = task?.projectName || task.file?.projectName || "";
|
|
932
|
+
const project = this.ctx.projects.find((p) => p.name === projectName);
|
|
916
933
|
let name = getFullName(task, c.dim(" > "));
|
|
917
934
|
if (filepath) {
|
|
918
935
|
name += c.dim(` [ ${this.relative(filepath)} ]`);
|
|
919
936
|
}
|
|
920
|
-
this.ctx.logger.error(`${c.bgRed(c.bold(" FAIL "))} ${formatProjectName(
|
|
937
|
+
this.ctx.logger.error(`${c.bgRed(c.bold(" FAIL "))} ${formatProjectName(project)}${name}`);
|
|
921
938
|
}
|
|
922
939
|
const screenshotPaths = tasks.map((t) => t.meta?.failScreenshotPath).filter((screenshot) => screenshot != null);
|
|
923
940
|
this.ctx.logger.printError(error, {
|
|
@@ -943,7 +960,7 @@ class BasicReporter extends BaseReporter {
|
|
|
943
960
|
}
|
|
944
961
|
onInit(ctx) {
|
|
945
962
|
super.onInit(ctx);
|
|
946
|
-
ctx.logger.
|
|
963
|
+
ctx.logger.deprecate(`'basic' reporter is deprecated and will be removed in Vitest v3.\n` + `Remove 'basic' from 'reporters' option. To match 'basic' reporter 100%, use configuration:\n${JSON.stringify({ test: { reporters: [["default", { summary: false }]] } }, null, 2)}`);
|
|
947
964
|
}
|
|
948
965
|
reportSummary(files, errors) {
|
|
949
966
|
this.ctx.logger.log();
|
|
@@ -1277,7 +1294,10 @@ class SummaryReporter {
|
|
|
1277
1294
|
const summary = [""];
|
|
1278
1295
|
for (const testFile of Array.from(this.runningModules.values()).sort(sortRunningModules)) {
|
|
1279
1296
|
const typecheck = testFile.typecheck ? `${c.bgBlue(c.bold(" TS "))} ` : "";
|
|
1280
|
-
summary.push(c.bold(c.yellow(` ${F_POINTER} `)) + formatProjectName(
|
|
1297
|
+
summary.push(c.bold(c.yellow(` ${F_POINTER} `)) + formatProjectName({
|
|
1298
|
+
name: testFile.projectName,
|
|
1299
|
+
color: testFile.projectColor
|
|
1300
|
+
}) + typecheck + testFile.filename + c.dim(!testFile.completed && !testFile.total ? " [queued]" : ` ${testFile.completed}/${testFile.total}`));
|
|
1281
1301
|
const slowTasks = [testFile.hook, ...Array.from(testFile.tests.values())].filter((t) => t != null && t.visible);
|
|
1282
1302
|
for (const [index, task] of slowTasks.entries()) {
|
|
1283
1303
|
const elapsed = this.currentTime - task.startTime;
|
|
@@ -1351,6 +1371,7 @@ function initializeStats(module) {
|
|
|
1351
1371
|
completed: 0,
|
|
1352
1372
|
filename: module.task.name,
|
|
1353
1373
|
projectName: module.project.name,
|
|
1374
|
+
projectColor: module.project.color,
|
|
1354
1375
|
tests: new Map(),
|
|
1355
1376
|
typecheck: !!module.task.meta.typecheck
|
|
1356
1377
|
};
|
|
@@ -2097,7 +2118,7 @@ class VerboseReporter extends DefaultReporter {
|
|
|
2097
2118
|
}
|
|
2098
2119
|
let title = ` ${getStateSymbol(test.task)} `;
|
|
2099
2120
|
if (test.project.name) {
|
|
2100
|
-
title += formatProjectName(test.project
|
|
2121
|
+
title += formatProjectName(test.project);
|
|
2101
2122
|
}
|
|
2102
2123
|
title += getFullName(test.task, c.dim(" > "));
|
|
2103
2124
|
title += this.getDurationPrefix(test.task);
|
|
@@ -2362,7 +2383,7 @@ class BenchmarkReporter extends DefaultReporter {
|
|
|
2362
2383
|
const benches = testTask.task.tasks.filter((t) => t.meta.benchmark);
|
|
2363
2384
|
const duration = testTask.task.result?.duration || 0;
|
|
2364
2385
|
if (benches.length > 0 && benches.every((t) => t.result?.state !== "run" && t.result?.state !== "queued")) {
|
|
2365
|
-
let title = `\n ${getStateSymbol(testTask.task)} ${formatProjectName(testTask.project
|
|
2386
|
+
let title = `\n ${getStateSymbol(testTask.task)} ${formatProjectName(testTask.project)}${getFullName(testTask.task, c.dim(" > "))}`;
|
|
2366
2387
|
if (duration != null && duration > this.ctx.config.slowTestThreshold) {
|
|
2367
2388
|
title += c.yellow(` ${Math.round(duration)}${c.dim("ms")}`);
|
|
2368
2389
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as chai from 'chai';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
import { l as loadDiffConfig, b as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.
|
|
3
|
+
import { l as loadDiffConfig, b as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.BP6KrF_Z.js';
|
|
4
4
|
import { distDir } from '../path.js';
|
|
5
5
|
import { r as rpc } from './rpc.D9_013TY.js';
|
|
6
6
|
import { g as getWorkerState } from './utils.CgTj3MsC.js';
|
|
@@ -93,7 +93,7 @@ async function resolveTestRunner(config, executor) {
|
|
|
93
93
|
const currentFailures = 1 + previousFailures;
|
|
94
94
|
if (currentFailures >= config.bail) {
|
|
95
95
|
rpc().onCancel("test-failure");
|
|
96
|
-
testRunner.
|
|
96
|
+
testRunner.cancel?.("test-failure");
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
await originalOnAfterRunTask?.call(testRunner, test);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Task, TaskMeta, Suite, File, TaskResultPack, SequenceSetupFiles, SequenceHooks, CancelReason } from '@vitest/runner';
|
|
2
|
-
import { b as Awaitable, U as UserConsoleLog, c as Arrayable$1, A as AfterSuiteRunMeta, f as EnvironmentOptions, P as ProvidedContext } from './environment.d.
|
|
2
|
+
import { b as Awaitable, U as UserConsoleLog, c as Arrayable$1, A as AfterSuiteRunMeta, L as LabelColor, f as EnvironmentOptions, P as ProvidedContext } from './environment.d.D8YDy2v5.js';
|
|
3
3
|
import { ParsedStack, TestError, SerializedError, ErrorWithDiff, Arrayable, Awaitable as Awaitable$1 } from '@vitest/utils';
|
|
4
4
|
import { Writable } from 'node:stream';
|
|
5
5
|
import { TransformResult as TransformResult$1, UserConfig as UserConfig$1, DepOptimizationConfig, ServerOptions, ConfigEnv, AliasOptions, ViteDevServer, ModuleNode } from 'vite';
|
|
6
6
|
import { Console } from 'node:console';
|
|
7
7
|
import { MockedModule } from '@vitest/mocker';
|
|
8
8
|
import { StackTraceParserOptions } from '@vitest/utils/source-map';
|
|
9
|
-
import { T as TestExecutionMethod } from './worker.d.
|
|
9
|
+
import { T as TestExecutionMethod } from './worker.d.CoCI7hzP.js';
|
|
10
10
|
import { a as SerializedConfig, F as FakeTimerInstallOpts } from './config.d.UqE-KR0o.js';
|
|
11
11
|
import { PrettyFormatOptions } from '@vitest/pretty-format';
|
|
12
12
|
import { SnapshotSummary, SnapshotStateOptions } from '@vitest/snapshot';
|
|
@@ -51,6 +51,7 @@ declare class Logger {
|
|
|
51
51
|
clearScreen(message: string, force?: boolean): void;
|
|
52
52
|
private _clearScreen;
|
|
53
53
|
printError(err: unknown, options?: ErrorOptions): void;
|
|
54
|
+
deprecate(message: string): void;
|
|
54
55
|
clearHighlightCache(filename?: string): void;
|
|
55
56
|
highlight(filename: string, source: string): string;
|
|
56
57
|
printNoTestFound(filters?: string[]): void;
|
|
@@ -683,12 +684,19 @@ interface BlobOptions {
|
|
|
683
684
|
outputFile?: string;
|
|
684
685
|
}
|
|
685
686
|
declare class BlobReporter implements Reporter {
|
|
687
|
+
start: number;
|
|
686
688
|
ctx: Vitest;
|
|
687
689
|
options: BlobOptions;
|
|
688
690
|
constructor(options: BlobOptions);
|
|
689
691
|
onInit(ctx: Vitest): void;
|
|
690
692
|
onFinished(files: File[] | undefined, errors: unknown[] | undefined, coverage: unknown): Promise<void>;
|
|
691
693
|
}
|
|
694
|
+
interface MergedBlobs {
|
|
695
|
+
files: File[];
|
|
696
|
+
errors: unknown[];
|
|
697
|
+
coverages: unknown[];
|
|
698
|
+
executionTimes: number[];
|
|
699
|
+
}
|
|
692
700
|
|
|
693
701
|
interface DefaultReporterOptions extends BaseOptions {
|
|
694
702
|
summary?: boolean;
|
|
@@ -1058,6 +1066,11 @@ interface TestSequencerConstructor {
|
|
|
1058
1066
|
new (ctx: Vitest): TestSequencer;
|
|
1059
1067
|
}
|
|
1060
1068
|
|
|
1069
|
+
interface WatcherTriggerPattern {
|
|
1070
|
+
pattern: RegExp;
|
|
1071
|
+
testsToRun: (file: string, match: RegExpMatchArray) => string[] | string | null | undefined | void;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1061
1074
|
interface BenchmarkUserOptions {
|
|
1062
1075
|
/**
|
|
1063
1076
|
* Include globs for benchmark test files
|
|
@@ -1370,8 +1383,21 @@ interface CoverageIstanbulOptions extends BaseCoverageOptions {
|
|
|
1370
1383
|
interface CoverageV8Options extends BaseCoverageOptions {
|
|
1371
1384
|
/**
|
|
1372
1385
|
* Ignore empty lines, comments and other non-runtime code, e.g. Typescript types
|
|
1386
|
+
* - Requires `experimentalAstAwareRemapping: false`
|
|
1373
1387
|
*/
|
|
1374
1388
|
ignoreEmptyLines?: boolean;
|
|
1389
|
+
/**
|
|
1390
|
+
* Remap coverage with experimental AST based analysis
|
|
1391
|
+
* - Provides more accurate results compared to default mode
|
|
1392
|
+
*/
|
|
1393
|
+
experimentalAstAwareRemapping?: boolean;
|
|
1394
|
+
/**
|
|
1395
|
+
* Set to array of class method names to ignore for coverage.
|
|
1396
|
+
* - Requires `experimentalAstAwareRemapping: true`
|
|
1397
|
+
*
|
|
1398
|
+
* @default []
|
|
1399
|
+
*/
|
|
1400
|
+
ignoreClassMethods?: string[];
|
|
1375
1401
|
}
|
|
1376
1402
|
interface CustomProviderOptions extends Pick<BaseCoverageOptions, FieldsWithDefaultValues> {
|
|
1377
1403
|
/** Name of the module or path to a file to load the custom provider from */
|
|
@@ -1405,6 +1431,10 @@ type CSSModuleScopeStrategy = "stable" | "scoped" | "non-scoped";
|
|
|
1405
1431
|
type ApiConfig = Pick<ServerOptions, "port" | "strictPort" | "host" | "middlewareMode">;
|
|
1406
1432
|
|
|
1407
1433
|
type VitestRunMode = "test" | "benchmark";
|
|
1434
|
+
interface ProjectName {
|
|
1435
|
+
label: string;
|
|
1436
|
+
color?: LabelColor;
|
|
1437
|
+
}
|
|
1408
1438
|
interface SequenceOptions {
|
|
1409
1439
|
/**
|
|
1410
1440
|
* Class that handles sorting and sharding algorithm.
|
|
@@ -1571,7 +1601,7 @@ interface InlineConfig {
|
|
|
1571
1601
|
/**
|
|
1572
1602
|
* Name of the project. Will be used to display in the reporter.
|
|
1573
1603
|
*/
|
|
1574
|
-
name?: string;
|
|
1604
|
+
name?: string | ProjectName;
|
|
1575
1605
|
/**
|
|
1576
1606
|
* Benchmark options.
|
|
1577
1607
|
*
|
|
@@ -1636,7 +1666,7 @@ interface InlineConfig {
|
|
|
1636
1666
|
*
|
|
1637
1667
|
* Format: [glob, environment-name]
|
|
1638
1668
|
*
|
|
1639
|
-
* @deprecated use [`
|
|
1669
|
+
* @deprecated use [`projects`](https://vitest.dev/config/#projects) instead
|
|
1640
1670
|
* @default []
|
|
1641
1671
|
* @example [
|
|
1642
1672
|
* // all tests in tests/dom will run in jsdom
|
|
@@ -1687,7 +1717,7 @@ interface InlineConfig {
|
|
|
1687
1717
|
*
|
|
1688
1718
|
* Format: [glob, pool-name]
|
|
1689
1719
|
*
|
|
1690
|
-
* @deprecated use [`
|
|
1720
|
+
* @deprecated use [`projects`](https://vitest.dev/config/#projects) instead
|
|
1691
1721
|
* @default []
|
|
1692
1722
|
* @example [
|
|
1693
1723
|
* // all tests in "forks" directory will run using "poolOptions.forks" API
|
|
@@ -1698,7 +1728,12 @@ interface InlineConfig {
|
|
|
1698
1728
|
*/
|
|
1699
1729
|
poolMatchGlobs?: [string, Exclude<Pool, "browser">][];
|
|
1700
1730
|
/**
|
|
1731
|
+
* Options for projects
|
|
1732
|
+
*/
|
|
1733
|
+
projects?: TestProjectConfiguration[];
|
|
1734
|
+
/**
|
|
1701
1735
|
* Path to a workspace configuration file
|
|
1736
|
+
* @deprecated use `projects` instead
|
|
1702
1737
|
*/
|
|
1703
1738
|
workspace?: string | TestProjectConfiguration[];
|
|
1704
1739
|
/**
|
|
@@ -1780,6 +1815,11 @@ interface InlineConfig {
|
|
|
1780
1815
|
*/
|
|
1781
1816
|
forceRerunTriggers?: string[];
|
|
1782
1817
|
/**
|
|
1818
|
+
* Pattern configuration to rerun only the tests that are affected
|
|
1819
|
+
* by the changes of specific files in the repository.
|
|
1820
|
+
*/
|
|
1821
|
+
watchTriggerPatterns?: WatcherTriggerPattern[];
|
|
1822
|
+
/**
|
|
1783
1823
|
* Coverage options
|
|
1784
1824
|
*/
|
|
1785
1825
|
coverage?: CoverageOptions;
|
|
@@ -2194,8 +2234,10 @@ interface UserConfig extends InlineConfig {
|
|
|
2194
2234
|
*/
|
|
2195
2235
|
mergeReports?: string;
|
|
2196
2236
|
}
|
|
2197
|
-
interface ResolvedConfig extends Omit<Required<UserConfig>, "project" | "config" | "filters" | "browser" | "coverage" | "testNamePattern" | "related" | "api" | "reporters" | "resolveSnapshotPath" | "benchmark" | "shard" | "cache" | "sequence" | "typecheck" | "runner" | "poolOptions" | "pool" | "cliExclude" | "diff" | "setupFiles" | "snapshotEnvironment" | "bail"> {
|
|
2237
|
+
interface ResolvedConfig extends Omit<Required<UserConfig>, "project" | "config" | "filters" | "browser" | "coverage" | "testNamePattern" | "related" | "api" | "reporters" | "resolveSnapshotPath" | "benchmark" | "shard" | "cache" | "sequence" | "typecheck" | "runner" | "poolOptions" | "pool" | "cliExclude" | "diff" | "setupFiles" | "snapshotEnvironment" | "bail" | "name"> {
|
|
2198
2238
|
mode: VitestRunMode;
|
|
2239
|
+
name: ProjectName["label"];
|
|
2240
|
+
color?: ProjectName["color"];
|
|
2199
2241
|
base?: string;
|
|
2200
2242
|
diff?: string | SerializedDiffOptions;
|
|
2201
2243
|
bail?: number;
|
|
@@ -2243,7 +2285,7 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, "project" | "config"
|
|
|
2243
2285
|
maxWorkers: number;
|
|
2244
2286
|
minWorkers: number;
|
|
2245
2287
|
}
|
|
2246
|
-
type NonProjectOptions = "shard" | "watch" | "run" | "cache" | "update" | "reporters" | "outputFile" | "teardownTimeout" | "silent" | "forceRerunTriggers" | "testNamePattern" | "ui" | "open" | "uiBase" | "snapshotFormat" | "resolveSnapshotPath" | "passWithNoTests" | "onConsoleLog" | "onStackTrace" | "dangerouslyIgnoreUnhandledErrors" | "slowTestThreshold" | "inspect" | "inspectBrk" | "coverage" | "maxWorkers" | "minWorkers" | "fileParallelism" | "workspace";
|
|
2288
|
+
type NonProjectOptions = "shard" | "watch" | "run" | "cache" | "update" | "reporters" | "outputFile" | "teardownTimeout" | "silent" | "forceRerunTriggers" | "testNamePattern" | "ui" | "open" | "uiBase" | "snapshotFormat" | "resolveSnapshotPath" | "passWithNoTests" | "onConsoleLog" | "onStackTrace" | "dangerouslyIgnoreUnhandledErrors" | "slowTestThreshold" | "inspect" | "inspectBrk" | "coverage" | "maxWorkers" | "minWorkers" | "fileParallelism" | "workspace" | "watchTriggerPatterns";
|
|
2247
2289
|
type ProjectConfig = Omit<InlineConfig, NonProjectOptions | "sequencer" | "deps" | "poolOptions"> & {
|
|
2248
2290
|
mode?: string
|
|
2249
2291
|
sequencer?: Omit<SequenceOptions, "sequencer" | "seed">
|
|
@@ -2306,12 +2348,13 @@ interface BrowserProviderModule {
|
|
|
2306
2348
|
}
|
|
2307
2349
|
interface BrowserProviderOptions {}
|
|
2308
2350
|
type BrowserBuiltinProvider = "webdriverio" | "playwright" | "preview";
|
|
2309
|
-
type UnsupportedProperties = "browser" | "typecheck" | "alias" | "sequence" | "root" | "pool" | "poolOptions" | "runner" | "api" | "deps" | "testTransformMode" | "poolMatchGlobs" | "environmentMatchGlobs" | "environment" | "environmentOptions" | "server" | "benchmark";
|
|
2351
|
+
type UnsupportedProperties = "browser" | "typecheck" | "alias" | "sequence" | "root" | "pool" | "poolOptions" | "runner" | "api" | "deps" | "testTransformMode" | "poolMatchGlobs" | "environmentMatchGlobs" | "environment" | "environmentOptions" | "server" | "benchmark" | "name";
|
|
2310
2352
|
interface BrowserInstanceOption extends BrowserProviderOptions, Omit<ProjectConfig, UnsupportedProperties>, Pick<BrowserConfigOptions, "headless" | "locators" | "viewport" | "testerHtmlPath" | "screenshotDirectory" | "screenshotFailures"> {
|
|
2311
2353
|
/**
|
|
2312
2354
|
* Name of the browser
|
|
2313
2355
|
*/
|
|
2314
2356
|
browser: string;
|
|
2357
|
+
name?: string;
|
|
2315
2358
|
}
|
|
2316
2359
|
interface BrowserConfigOptions {
|
|
2317
2360
|
/**
|
|
@@ -2581,6 +2624,10 @@ declare class TestProject {
|
|
|
2581
2624
|
*/
|
|
2582
2625
|
get name(): string;
|
|
2583
2626
|
/**
|
|
2627
|
+
* The color used when reporting tasks of this project.
|
|
2628
|
+
*/
|
|
2629
|
+
get color(): ProjectName["color"];
|
|
2630
|
+
/**
|
|
2584
2631
|
* Serialized project configuration. This is the config that tests receive.
|
|
2585
2632
|
*/
|
|
2586
2633
|
get serializedConfig(): SerializedConfig;
|
|
@@ -2741,6 +2788,7 @@ declare class StateManager {
|
|
|
2741
2788
|
errorsSet: Set<unknown>;
|
|
2742
2789
|
processTimeoutCauses: Set<string>;
|
|
2743
2790
|
reportedTasksMap: WeakMap<Task, TestModule | TestCase | TestSuite>;
|
|
2791
|
+
blobs?: MergedBlobs;
|
|
2744
2792
|
catchError(err: unknown, type: string): void;
|
|
2745
2793
|
clearErrors(): void;
|
|
2746
2794
|
getUnhandledErrors(): unknown[];
|
|
@@ -2881,7 +2929,7 @@ declare class Vitest {
|
|
|
2881
2929
|
*/
|
|
2882
2930
|
import<T>(moduleId: string): Promise<T>;
|
|
2883
2931
|
private resolveWorkspaceConfigPath;
|
|
2884
|
-
private
|
|
2932
|
+
private resolveProjects;
|
|
2885
2933
|
/**
|
|
2886
2934
|
* Glob test files in every project and create a TestSpecification for each file and pool.
|
|
2887
2935
|
* @param filters String filters to match the test files.
|
|
@@ -3045,5 +3093,5 @@ declare class Vitest {
|
|
|
3045
3093
|
type OnServerRestartHandler = (reason?: string) => Promise<void> | void;
|
|
3046
3094
|
type OnTestsRerunHandler = (testFiles: TestSpecification[]) => Promise<void> | void;
|
|
3047
3095
|
|
|
3048
|
-
export { CoverageMap as C, TestSpecification as
|
|
3049
|
-
export type {
|
|
3096
|
+
export { CoverageMap as C, TestSpecification as K, Logger as L, TestModule as M, TestProject as T, Vitest as V, VitestPackageInstaller as X, getFilePoolName as _, TestCase as a4, TestCollection as a5, BasicReporter as aC, BenchmarkReporter as aD, BenchmarkReportsMap as aE, DefaultReporter as aF, DotReporter as aG, GithubActionsReporter as aH, HangingProcessReporter as aI, JsonReporter as aJ, JUnitReporter as aK, ReportersMap as aL, TapFlatReporter as aM, TapReporter as aN, VerboseBenchmarkReporter as aO, VerboseReporter as aP, BaseReporter as aQ, TestSuite as ad };
|
|
3097
|
+
export type { SerializedTestProject as $, ApiConfig as A, BaseCoverageOptions as B, DepsOptimizationOptions as D, ProjectConfig as E, BenchmarkUserOptions as F, BrowserTesterOptions as G, VitestOptions as H, InlineConfig as I, TestSequencer as J, ModuleDiagnostic as N, OnServerRestartHandler as O, Pool as P, OnTestsRerunHandler as Q, ResolvedCoverageOptions as R, SerializedTestSpecification as S, UserWorkspaceConfig as U, WorkspaceProjectConfiguration as W, ProcessPool as Y, WorkspaceSpec as Z, ReportContext as a, HTMLOptions as a0, JsonOptions$1 as a1, JUnitOptions as a2, TaskOptions as a3, TestDiagnostic as a6, TestModuleState as a7, TestResult as a8, TestResultFailed as a9, ReportedHookContext as aA, TestRunEndReason as aB, BenchmarkBuiltinReporters as aR, BuiltinReporterOptions as aS, BuiltinReporters as aT, JsonAssertionResult as aU, JsonTestResult as aV, JsonTestResults as aW, TestResultPassed as aa, TestResultSkipped as ab, TestState as ac, TestSuiteState as ae, TestSequencerConstructor as af, BrowserBuiltinProvider as ag, BrowserCommand as ah, BrowserCommandContext as ai, BrowserInstanceOption as aj, BrowserModuleMocker as ak, BrowserOrchestrator as al, BrowserProvider as am, BrowserProviderInitializationOptions as an, BrowserProviderModule as ao, BrowserProviderOptions as ap, BrowserServerState as aq, BrowserServerStateSession as ar, CDPSession as as, ParentProjectBrowser as at, ProjectBrowser as au, ResolvedBrowserOptions as av, ResolvedProjectConfig as aw, ResolveSnapshotPathHandler as ax, ResolveSnapshotPathHandlerContext as ay, TestRunResult as az, TestProjectConfiguration as b, CoverageV8Options as c, UserProjectConfigFn as d, UserProjectConfigExport as e, TestProjectInlineConfiguration as f, WatcherTriggerPattern as g, CoverageProvider as h, CoverageProviderModule as i, CoverageReporter as j, CoverageProviderName as k, CoverageOptions as l, CoverageIstanbulOptions as m, CustomProviderOptions as n, Reporter as o, BrowserScript as p, BrowserConfigOptions as q, BuiltinEnvironment as r, VitestEnvironment as s, PoolOptions as t, CSSModuleScopeStrategy as u, VitestRunMode as v, TransformModePatterns as w, TypecheckConfig as x, UserConfig as y, ResolvedConfig as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
2
|
import { startTests, collectTests } from '@vitest/runner';
|
|
3
|
-
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.
|
|
4
|
-
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.
|
|
5
|
-
import { a as globalExpect, v as vi } from './vi.
|
|
3
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.DbWBPwtH.js';
|
|
4
|
+
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.BP6KrF_Z.js';
|
|
5
|
+
import { a as globalExpect, v as vi } from './vi.BFR5YIgu.js';
|
|
6
6
|
import { c as closeInspector } from './inspector.DbDkSkFn.js';
|
|
7
7
|
import { createRequire } from 'node:module';
|
|
8
8
|
import timers from 'node:timers';
|
|
@@ -11,7 +11,7 @@ import util from 'node:util';
|
|
|
11
11
|
import { getSafeTimers } from '@vitest/utils';
|
|
12
12
|
import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
|
|
13
13
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
14
|
-
import { V as VitestIndex } from './index.
|
|
14
|
+
import { V as VitestIndex } from './index.BPc7M5ni.js';
|
|
15
15
|
import { g as getWorkerState, r as resetModules } from './utils.CgTj3MsC.js';
|
|
16
16
|
import 'chai';
|
|
17
17
|
import 'node:path';
|
|
@@ -106,7 +106,7 @@ async function run(method, files, config, environment, executor) {
|
|
|
106
106
|
const runner = await resolveTestRunner(config, executor);
|
|
107
107
|
workerState.onCancel.then((reason) => {
|
|
108
108
|
closeInspector(config);
|
|
109
|
-
runner.
|
|
109
|
+
runner.cancel?.(reason);
|
|
110
110
|
});
|
|
111
111
|
workerState.durations.prepare = performance.now() - workerState.durations.prepare;
|
|
112
112
|
workerState.durations.environment = performance.now();
|
|
@@ -36,7 +36,7 @@ async function setupCommonEnv(config) {
|
|
|
36
36
|
globalSetup = true;
|
|
37
37
|
setSafeTimers();
|
|
38
38
|
if (config.globals) {
|
|
39
|
-
(await import('./globals.
|
|
39
|
+
(await import('./globals.Cg4NtV4P.js')).registerApiGlobally();
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
function setupDefines(defines) {
|