vitest 4.1.5 → 5.0.0-beta.2

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.
Files changed (80) hide show
  1. package/LICENSE.md +7 -0
  2. package/dist/browser.d.ts +9 -9
  3. package/dist/browser.js +4 -4
  4. package/dist/chunks/{base.RR7zL1h0.js → base.Opc_YHkk.js} +10 -11
  5. package/dist/chunks/browser.d.BUhkKcDl.d.ts +899 -0
  6. package/dist/chunks/{cac.DJJmV0dT.js → cac.8N4bOkkB.js} +23 -11
  7. package/dist/chunks/{cli-api.Cjt90eJu.js → cli-api.B0RFke2g.js} +5799 -353
  8. package/dist/chunks/{config.d.A1h_Y6Jt.d.ts → config.d.D91DHYaD.d.ts} +11 -3
  9. package/dist/chunks/{console.3WNpx0tS.js → console.B3IRP8fX.js} +3 -1
  10. package/dist/chunks/{constants.CPYnjOGj.js → constants.-juJ8b_4.js} +1 -1
  11. package/dist/chunks/{coverage.d.BZtK59WP.d.ts → coverage.d.g2xbl2sP.d.ts} +4 -0
  12. package/dist/chunks/{creator.DgVhQm5q.js → creator.BqL2U_x4.js} +1 -1
  13. package/dist/chunks/{defaults.9aQKnqFk.js → defaults.szbHWQun.js} +4 -2
  14. package/dist/chunks/environment.d-DOJxxZV9.d.DOJxxZV9.d.ts +17 -0
  15. package/dist/chunks/general.d.DFAHgpC2.d.ts +247 -0
  16. package/dist/chunks/{global.d.DVsSRdQ5.d.ts → global.d.DhbKSQoV.d.ts} +4 -5
  17. package/dist/chunks/{globals.Dj1TGiMC.js → globals.EHmmu0nC.js} +15 -14
  18. package/dist/chunks/{index.DXx9Dtk7.js → index.CViWo__T.js} +5 -5
  19. package/dist/chunks/{startVitestModuleRunner.bRl2_oI_.js → index.CbgUM9E5.js} +731 -5
  20. package/dist/chunks/{test.DNmyFkvJ.js → index.D_7-4CaB.js} +2659 -14
  21. package/dist/chunks/{init-forks.UV3ZQGQH.js → init-forks.DMge3WTt.js} +1 -1
  22. package/dist/chunks/{init-threads.D3eCsY76.js → init-threads.eIoyCTon.js} +1 -1
  23. package/dist/chunks/{init.D98-gwRW.js → init.BVd7SaCA.js} +3 -5
  24. package/dist/chunks/{nativeModuleMocker.BRN2oBJd.js → nativeModuleMocker.DKpFw0pk.js} +3 -2
  25. package/dist/chunks/{index.BCY_7LL2.js → nativeModuleRunner.BOeMnHl4.js} +43 -12
  26. package/dist/chunks/node.CwFbQqI1.js +47 -0
  27. package/dist/chunks/{reporters.d.CEnv6XRv.d.ts → plugin.d.cIKZEZ16.d.ts} +306 -19
  28. package/dist/chunks/plugins.DrsmdUE2.js +37 -0
  29. package/dist/chunks/{rpc.MzXet3jl.js → rpc.DFRWVnRh.js} +16 -1
  30. package/dist/chunks/{rpc.d.B_8sPU0w.d.ts → rpc.d.7JZuxZ8u.d.ts} +19 -3
  31. package/dist/chunks/{setup-common.DYx3LtFI.js → setup-common.Hpq30zVk.js} +7 -3
  32. package/dist/chunks/{utils.BS4fH3nR.js → utils.DKODp04v.js} +3 -4
  33. package/dist/chunks/{vm.DVLYObm9.js → vm.2okbRRME.js} +6 -6
  34. package/dist/chunks/{worker.d.ZpHpO4yb.d.ts → worker.d.Bu1kXGw4.d.ts} +3 -3
  35. package/dist/cli.js +2 -2
  36. package/dist/config.cjs +4 -2
  37. package/dist/config.d.ts +21 -18
  38. package/dist/config.js +2 -2
  39. package/dist/index.d.ts +84 -22
  40. package/dist/index.js +15 -13
  41. package/dist/module-evaluator.d.ts +5 -3
  42. package/dist/module-evaluator.js +1 -1
  43. package/dist/node.d.ts +114 -19
  44. package/dist/node.js +21 -26
  45. package/dist/runtime.d.ts +40 -4
  46. package/dist/runtime.js +5 -6
  47. package/dist/{chunks/traces.DT5aQ62U.js → traces.js} +1 -1
  48. package/dist/worker.d.ts +5 -5
  49. package/dist/worker.js +21 -23
  50. package/dist/workers/forks.js +21 -23
  51. package/dist/workers/runVmTests.js +17 -16
  52. package/dist/workers/threads.js +21 -23
  53. package/dist/workers/vmForks.js +7 -9
  54. package/dist/workers/vmThreads.js +7 -9
  55. package/package.json +21 -38
  56. package/dist/chunks/benchmark.CX_oY03V.js +0 -40
  57. package/dist/chunks/benchmark.d.DAaHLpsq.d.ts +0 -24
  58. package/dist/chunks/browser.d.BcoexmFG.d.ts +0 -62
  59. package/dist/chunks/coverage.DM_a_rWm.js +0 -1087
  60. package/dist/chunks/evaluatedModules.Dg1zASAC.js +0 -17
  61. package/dist/chunks/index.DC7d2Pf8.js +0 -729
  62. package/dist/chunks/index.DdgEv5B1.js +0 -42
  63. package/dist/chunks/index.UpGiHP7g.js +0 -4255
  64. package/dist/chunks/nativeModuleRunner.BIakptoF.js +0 -36
  65. package/dist/chunks/node.COQbm6gK.js +0 -14
  66. package/dist/chunks/plugin.d.BM2TCi12.d.ts +0 -38
  67. package/dist/chunks/suite.d.udJtyAgw.d.ts +0 -10
  68. package/dist/chunks/traces.d.D2T_R8rx.d.ts +0 -60
  69. package/dist/coverage.d.ts +0 -123
  70. package/dist/coverage.js +0 -27
  71. package/dist/environments.d.ts +0 -22
  72. package/dist/environments.js +0 -5
  73. package/dist/reporters.d.ts +0 -27
  74. package/dist/reporters.js +0 -26
  75. package/dist/runners.d.ts +0 -70
  76. package/dist/runners.js +0 -19
  77. package/dist/snapshot.d.ts +0 -9
  78. package/dist/snapshot.js +0 -6
  79. package/dist/suite.d.ts +0 -5
  80. package/dist/suite.js +0 -8
@@ -1,36 +0,0 @@
1
- import { pathToFileURL } from 'node:url';
2
- import { r as resolveModule } from './index.BCY_7LL2.js';
3
- import { resolve } from 'pathe';
4
- import { ModuleRunner } from 'vite/module-runner';
5
-
6
- class NativeModuleRunner extends ModuleRunner {
7
- /**
8
- * @internal
9
- */
10
- mocker;
11
- constructor(root, mocker) {
12
- super({
13
- hmr: false,
14
- sourcemapInterceptor: false,
15
- transport: { invoke() {
16
- throw new Error("Unexpected `invoke`");
17
- } }
18
- });
19
- this.root = root;
20
- this.mocker = mocker;
21
- if (mocker) Object.defineProperty(globalThis, "__vitest_mocker__", {
22
- configurable: true,
23
- writable: true,
24
- value: mocker
25
- });
26
- }
27
- async import(moduleId) {
28
- const path = resolveModule(moduleId, { paths: [this.root] }) ?? resolve(this.root, moduleId);
29
- // resolveModule doesn't keep the query params, so we need to add them back
30
- let queryParams = "";
31
- if (moduleId.includes("?") && !path.includes("?")) queryParams = moduleId.slice(moduleId.indexOf("?"));
32
- return import(pathToFileURL(path + queryParams).toString());
33
- }
34
- }
35
-
36
- export { NativeModuleRunner as N };
@@ -1,14 +0,0 @@
1
- import { NodeSnapshotEnvironment } from '@vitest/snapshot/environment';
2
- import { g as getWorkerState } from './utils.BX5Fg8C4.js';
3
- import '@vitest/utils/timers';
4
-
5
- class VitestNodeSnapshotEnvironment extends NodeSnapshotEnvironment {
6
- getHeader() {
7
- return `// Vitest Snapshot v${this.getVersion()}, https://vitest.dev/guide/snapshot.html`;
8
- }
9
- resolvePath(filepath) {
10
- return getWorkerState().rpc.resolveSnapshotPath(filepath);
11
- }
12
- }
13
-
14
- export { VitestNodeSnapshotEnvironment };
@@ -1,38 +0,0 @@
1
- import { DevEnvironment } from 'vite';
2
- import { V as Vitest, T as TestProject, a as TestProjectConfiguration } from './reporters.d.CEnv6XRv.js';
3
-
4
- /**
5
- * Generate a unique cache identifier.
6
- *
7
- * Return `false` to disable caching of the file.
8
- * @experimental
9
- */
10
- interface CacheKeyIdGenerator {
11
- (context: CacheKeyIdGeneratorContext): string | undefined | null | false;
12
- }
13
- /**
14
- * @experimental
15
- */
16
- interface CacheKeyIdGeneratorContext {
17
- environment: DevEnvironment;
18
- id: string;
19
- sourceCode: string;
20
- }
21
-
22
- interface VitestPluginContext {
23
- vitest: Vitest;
24
- project: TestProject;
25
- injectTestProjects: (config: TestProjectConfiguration | TestProjectConfiguration[]) => Promise<TestProject[]>;
26
- /**
27
- * Define a generator that will be applied before hashing the cache key.
28
- *
29
- * Use this to make sure Vitest generates correct hash. It is a good idea
30
- * to define this function if your plugin can be registered with different options.
31
- *
32
- * This is called only if `experimental.fsModuleCache` is defined.
33
- * @experimental
34
- */
35
- experimental_defineCacheKeyGenerator: (callback: CacheKeyIdGenerator) => void;
36
- }
37
-
38
- export type { CacheKeyIdGenerator as C, VitestPluginContext as V, CacheKeyIdGeneratorContext as a };
@@ -1,10 +0,0 @@
1
- import { Test } from '@vitest/runner';
2
- import { a as BenchFunction, c as BenchmarkAPI } from './benchmark.d.DAaHLpsq.js';
3
- import { Options } from 'tinybench';
4
- import '@vitest/runner/utils';
5
-
6
- declare function getBenchOptions(key: Test): Options;
7
- declare function getBenchFn(key: Test): BenchFunction;
8
- declare const bench: BenchmarkAPI;
9
-
10
- export { getBenchOptions as a, bench as b, getBenchFn as g };
@@ -1,60 +0,0 @@
1
- interface AfterSuiteRunMeta {
2
- coverage?: unknown;
3
- testFiles: string[];
4
- environment: string;
5
- projectName?: string;
6
- }
7
- interface UserConsoleLog {
8
- content: string;
9
- origin?: string;
10
- browser?: boolean;
11
- type: "stdout" | "stderr";
12
- taskId?: string;
13
- time: number;
14
- size: number;
15
- }
16
- interface ModuleGraphData {
17
- graph: Record<string, string[]>;
18
- externalized: string[];
19
- inlined: string[];
20
- }
21
- interface ProvidedContext {}
22
- interface ResolveFunctionResult {
23
- id: string;
24
- file: string;
25
- url: string;
26
- }
27
- interface FetchCachedFileSystemResult {
28
- cached: true;
29
- tmp: string;
30
- id: string;
31
- file: string | null;
32
- url: string;
33
- invalidate: boolean;
34
- }
35
- type LabelColor = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white";
36
- interface AsyncLeak {
37
- filename: string;
38
- projectName: string;
39
- stack: string;
40
- type: string;
41
- }
42
-
43
- interface OTELCarrier {
44
- traceparent?: string;
45
- tracestate?: string;
46
- }
47
- interface TracesOptions {
48
- enabled: boolean;
49
- watchMode?: boolean;
50
- sdkPath?: string;
51
- tracerName?: string;
52
- }
53
- declare class Traces {
54
- #private;
55
- constructor(options: TracesOptions);
56
- isEnabled(): boolean;
57
- }
58
-
59
- export { Traces as T };
60
- export type { AsyncLeak as A, FetchCachedFileSystemResult as F, LabelColor as L, ModuleGraphData as M, OTELCarrier as O, ProvidedContext as P, ResolveFunctionResult as R, UserConsoleLog as U, AfterSuiteRunMeta as a };
@@ -1,123 +0,0 @@
1
- import { V as Vitest, av as ResolvedCoverageOptions, a$ as CoverageMap, ao as ReportContext, T as TestProject } from './chunks/reporters.d.CEnv6XRv.js';
2
- import { TransformResult } from 'vite';
3
- import { a as AfterSuiteRunMeta } from './chunks/traces.d.D2T_R8rx.js';
4
- import '@vitest/runner';
5
- import '@vitest/utils';
6
- import 'node:stream';
7
- import './chunks/config.d.A1h_Y6Jt.js';
8
- import '@vitest/pretty-format';
9
- import '@vitest/snapshot';
10
- import '@vitest/utils/diff';
11
- import './chunks/browser.d.BcoexmFG.js';
12
- import './chunks/worker.d.ZpHpO4yb.js';
13
- import 'vite/module-runner';
14
- import './chunks/environment.d.CrsxCzP1.js';
15
- import './chunks/rpc.d.B_8sPU0w.js';
16
- import '@vitest/expect';
17
- import 'vitest/optional-types.js';
18
- import './chunks/benchmark.d.DAaHLpsq.js';
19
- import '@vitest/runner/utils';
20
- import 'tinybench';
21
- import '@vitest/mocker';
22
- import '@vitest/utils/source-map';
23
- import 'vitest/browser';
24
- import './chunks/coverage.d.BZtK59WP.js';
25
- import '@vitest/snapshot/manager';
26
- import 'node:console';
27
- import 'node:fs';
28
-
29
- type Threshold = "lines" | "functions" | "statements" | "branches";
30
- interface ResolvedThreshold {
31
- coverageMap: CoverageMap;
32
- name: string;
33
- thresholds: Partial<Record<Threshold, number | undefined>>;
34
- }
35
- /**
36
- * Holds info about raw coverage results that are stored on file system:
37
- *
38
- * ```json
39
- * "project-a": {
40
- * "web": {
41
- * "tests/math.test.ts": "coverage-1.json",
42
- * "tests/utils.test.ts": "coverage-2.json",
43
- * // ^^^^^^^^^^^^^^^ Raw coverage on file system
44
- * },
45
- * "ssr": { ... },
46
- * "browser": { ... },
47
- * },
48
- * "project-b": ...
49
- * ```
50
- */
51
- type CoverageFiles = Map<NonNullable<AfterSuiteRunMeta["projectName"]> | symbol, Record<AfterSuiteRunMeta["environment"], {
52
- [TestFilenames: string]: string;
53
- }>>;
54
- declare class BaseCoverageProvider {
55
- ctx: Vitest;
56
- readonly name: "v8" | "istanbul";
57
- version: string;
58
- options: ResolvedCoverageOptions;
59
- globCache: Map<string, boolean>;
60
- autoUpdateMarker: string;
61
- coverageFiles: CoverageFiles;
62
- pendingPromises: Promise<void>[];
63
- coverageFilesDirectory: string;
64
- roots: string[];
65
- changedFiles?: string[];
66
- _initialize(ctx: Vitest): void;
67
- /**
68
- * Check if file matches `coverage.include` but not `coverage.exclude`
69
- */
70
- isIncluded(_filename: string, root?: string): boolean;
71
- private getUntestedFilesByRoot;
72
- getUntestedFiles(testedFiles: string[]): Promise<string[]>;
73
- createCoverageMap(): CoverageMap;
74
- generateReports(_: CoverageMap, __: boolean | undefined): Promise<void>;
75
- parseConfigModule(_: string): Promise<{
76
- generate: () => {
77
- code: string;
78
- };
79
- }>;
80
- resolveOptions(): ResolvedCoverageOptions;
81
- clean(clean?: boolean): Promise<void>;
82
- private normalizeCoverageFileError;
83
- onAfterSuiteRun({ coverage, environment, projectName, testFiles }: AfterSuiteRunMeta): void;
84
- readCoverageFiles<CoverageType>({ onFileRead, onFinished, onDebug }: {
85
- /** Callback invoked with a single coverage result */
86
- onFileRead: (data: CoverageType) => void;
87
- /** Callback invoked once all results of a project for specific transform mode are read */
88
- onFinished: (project: Vitest["projects"][number], environment: string) => Promise<void>;
89
- onDebug: ((...logs: any[]) => void) & {
90
- enabled: boolean;
91
- };
92
- }): Promise<void>;
93
- cleanAfterRun(): Promise<void>;
94
- onTestRunStart(): Promise<void>;
95
- onTestFailure(): Promise<void>;
96
- reportCoverage(coverageMap: unknown, { allTestsRun }: ReportContext): Promise<void>;
97
- reportThresholds(coverageMap: CoverageMap, allTestsRun: boolean | undefined): Promise<void>;
98
- /**
99
- * Constructs collected coverage and users' threshold options into separate sets
100
- * where each threshold set holds their own coverage maps. Threshold set is either
101
- * for specific files defined by glob pattern or global for all other files.
102
- */
103
- private resolveThresholds;
104
- /**
105
- * Check collected coverage against configured thresholds. Sets exit code to 1 when thresholds not reached.
106
- */
107
- private checkThresholds;
108
- /**
109
- * Check if current coverage is above configured thresholds and bump the thresholds if needed
110
- */
111
- updateThresholds({ thresholds: allThresholds, onUpdate, configurationFile }: {
112
- thresholds: ResolvedThreshold[];
113
- configurationFile: unknown;
114
- onUpdate: () => void;
115
- }): Promise<void>;
116
- mergeReports(coverageMaps: unknown[]): Promise<void>;
117
- hasTerminalReporter(reporters: ResolvedCoverageOptions["reporter"]): boolean;
118
- toSlices<T>(array: T[], size: number): T[][];
119
- transformFile(url: string, project: TestProject, viteEnvironment: string): Promise<TransformResult | null | undefined>;
120
- createUncoveredFileTransformer(ctx: Vitest): (filename: string) => Promise<TransformResult | null | undefined>;
121
- }
122
-
123
- export { BaseCoverageProvider };
package/dist/coverage.js DELETED
@@ -1,27 +0,0 @@
1
- export { B as BaseCoverageProvider } from './chunks/coverage.DM_a_rWm.js';
2
- import 'node:fs';
3
- import 'node:module';
4
- import 'node:path';
5
- import 'node:url';
6
- import '@vitest/utils/helpers';
7
- import 'pathe';
8
- import 'picomatch';
9
- import 'tinyglobby';
10
- import 'tinyrainbow';
11
- import './chunks/defaults.9aQKnqFk.js';
12
- import 'node:os';
13
- import './chunks/env.D4Lgay0q.js';
14
- import 'std-env';
15
- import 'node:crypto';
16
- import './chunks/index.BCY_7LL2.js';
17
- import 'node:process';
18
- import 'node:fs/promises';
19
- import 'node:assert';
20
- import 'node:v8';
21
- import 'node:util';
22
- import 'vite';
23
- import './chunks/constants.CPYnjOGj.js';
24
- import './chunks/utils.BS4fH3nR.js';
25
- import './chunks/coverage.CTzCuANN.js';
26
-
27
- console.warn("Importing from \"vitest/coverage\" is deprecated since Vitest 4.1. Please use \"vitest/node\" instead.");
@@ -1,22 +0,0 @@
1
- import { E as Environment } from './chunks/environment.d.CrsxCzP1.js';
2
- export { a as EnvironmentReturn, V as VmEnvironmentReturn } from './chunks/environment.d.CrsxCzP1.js';
3
- import '@vitest/utils';
4
-
5
- declare const environments: {
6
- "node": Environment;
7
- "jsdom": Environment;
8
- "happy-dom": Environment;
9
- "edge-runtime": Environment;
10
- };
11
-
12
- interface PopulateOptions {
13
- bindFunctions?: boolean;
14
- additionalKeys?: string[];
15
- }
16
- declare function populateGlobal(global: any, win: any, options?: PopulateOptions): {
17
- keys: Set<string>;
18
- skipKeys: string[];
19
- originals: Map<string | symbol, any>;
20
- };
21
-
22
- export { Environment, environments as builtinEnvironments, populateGlobal };
@@ -1,5 +0,0 @@
1
- export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.DC7d2Pf8.js';
2
- import 'node:url';
3
- import 'node:console';
4
-
5
- console.warn("Importing from \"vitest/environments\" is deprecated since Vitest 4.1. Please use \"vitest/runtime\" instead.");
@@ -1,27 +0,0 @@
1
- export { M as AgentReporter, l as BaseReporter, m as BenchmarkBuiltinReporters, n as BenchmarkReporter, o as BenchmarkReportsMap, K as BuiltinReporterOptions, N as BuiltinReporters, a0 as DefaultReporter, a2 as DotReporter, a4 as GithubActionsReporter, a6 as HangingProcessReporter, a9 as JUnitReporter, aa as JsonAssertionResult, ac as JsonReporter, ad as JsonTestResult, ae as JsonTestResults, M as MinimalReporter, ap as ReportedHookContext, aq as Reporter, ar as ReportersMap, ay as TapFlatReporter, az as TapReporter, aK as TestRunEndReason, aU as VerboseBenchmarkReporter, aV as VerboseReporter } from './chunks/reporters.d.CEnv6XRv.js';
2
- import '@vitest/runner';
3
- import '@vitest/utils';
4
- import './chunks/traces.d.D2T_R8rx.js';
5
- import 'node:stream';
6
- import 'vite';
7
- import './chunks/config.d.A1h_Y6Jt.js';
8
- import '@vitest/pretty-format';
9
- import '@vitest/snapshot';
10
- import '@vitest/utils/diff';
11
- import './chunks/browser.d.BcoexmFG.js';
12
- import './chunks/worker.d.ZpHpO4yb.js';
13
- import 'vite/module-runner';
14
- import './chunks/environment.d.CrsxCzP1.js';
15
- import './chunks/rpc.d.B_8sPU0w.js';
16
- import '@vitest/expect';
17
- import 'vitest/optional-types.js';
18
- import './chunks/benchmark.d.DAaHLpsq.js';
19
- import '@vitest/runner/utils';
20
- import 'tinybench';
21
- import '@vitest/mocker';
22
- import '@vitest/utils/source-map';
23
- import 'vitest/browser';
24
- import './chunks/coverage.d.BZtK59WP.js';
25
- import '@vitest/snapshot/manager';
26
- import 'node:console';
27
- import 'node:fs';
package/dist/reporters.js DELETED
@@ -1,26 +0,0 @@
1
- export { M as AgentReporter, B as BenchmarkReporter, a as BenchmarkReportsMap, D as DefaultReporter, b as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, J as JUnitReporter, c as JsonReporter, M as MinimalReporter, R as ReportersMap, T as TapFlatReporter, d as TapReporter, V as VerboseBenchmarkReporter, e as VerboseReporter } from './chunks/index.UpGiHP7g.js';
2
- import 'node:fs';
3
- import '@vitest/runner/utils';
4
- import 'pathe';
5
- import 'tinyrainbow';
6
- import './chunks/utils.BS4fH3nR.js';
7
- import 'node:util';
8
- import '@vitest/utils/helpers';
9
- import 'node:fs/promises';
10
- import 'node:perf_hooks';
11
- import '@vitest/utils/source-map';
12
- import './chunks/env.D4Lgay0q.js';
13
- import 'std-env';
14
- import 'node:console';
15
- import 'node:stream';
16
- import '@vitest/utils/display';
17
- import 'node:os';
18
- import 'tinyexec';
19
- import './path.js';
20
- import 'node:path';
21
- import 'node:url';
22
- import 'vite';
23
- import '@vitest/utils/offset';
24
- import 'node:module';
25
-
26
- console.warn("Importing from \"vitest/reporters\" is deprecated since Vitest 4.1. Please use \"vitest/node\" instead.");
package/dist/runners.d.ts DELETED
@@ -1,70 +0,0 @@
1
- import * as tinybench from 'tinybench';
2
- import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration, createTaskCollector, getCurrentSuite, getCurrentTest, getHooks, getFn } from '@vitest/runner';
3
- export { VitestRunner } from '@vitest/runner';
4
- import { S as SerializedConfig } from './chunks/config.d.A1h_Y6Jt.js';
5
- import { T as Traces } from './chunks/traces.d.D2T_R8rx.js';
6
- import { createChainable, matchesTags } from '@vitest/runner/utils';
7
- import { g as getBenchFn, a as getBenchOptions } from './chunks/suite.d.udJtyAgw.js';
8
- import '@vitest/pretty-format';
9
- import '@vitest/snapshot';
10
- import '@vitest/utils/diff';
11
- import './chunks/benchmark.d.DAaHLpsq.js';
12
-
13
- declare class NodeBenchmarkRunner implements VitestRunner {
14
- config: SerializedConfig;
15
- private moduleRunner;
16
- constructor(config: SerializedConfig);
17
- importTinybench(): Promise<typeof tinybench>;
18
- importFile(filepath: string, source: VitestRunnerImportSource): unknown;
19
- runSuite(suite: Suite): Promise<void>;
20
- runTask(): Promise<void>;
21
- }
22
-
23
- declare class TestRunner implements VitestRunner {
24
- config: SerializedConfig;
25
- private snapshotClient;
26
- private workerState;
27
- private moduleRunner;
28
- private cancelRun;
29
- private assertionsErrors;
30
- pool: string;
31
- private _otel;
32
- viteEnvironment: string;
33
- private viteModuleRunner;
34
- constructor(config: SerializedConfig);
35
- importFile(filepath: string, source: VitestRunnerImportSource): unknown;
36
- onCollectStart(file: File): void;
37
- onCleanupWorkerContext(listener: () => unknown): void;
38
- onAfterRunFiles(): void;
39
- onAfterRunSuite(suite: Suite): Promise<void>;
40
- onAfterRunTask(test: Task): void;
41
- cancel(_reason: CancelReason): void;
42
- injectValue(key: string): any;
43
- onBeforeRunTask(test: Task): Promise<void>;
44
- onBeforeRunSuite(suite: Suite): Promise<void>;
45
- onBeforeTryTask(test: Task): void;
46
- onAfterTryTask(test: Test): void;
47
- extendTaskContext(context: TestContext): TestContext;
48
- getImportDurations(): Record<string, ImportDuration>;
49
- trace: <T>(name: string, attributes: Record<string, any> | (() => T), cb?: () => T) => T;
50
- __setTraces(traces: Traces): void;
51
- static createTaskCollector: typeof createTaskCollector;
52
- static getCurrentSuite: typeof getCurrentSuite;
53
- static getCurrentTest: typeof getCurrentTest;
54
- static createChainable: typeof createChainable;
55
- static getSuiteHooks: typeof getHooks;
56
- static getTestFn: typeof getFn;
57
- static setSuiteHooks: typeof getHooks;
58
- static setTestFn: typeof getFn;
59
- static matchesTags: typeof matchesTags;
60
- /**
61
- * @deprecated
62
- */
63
- static getBenchFn: typeof getBenchFn;
64
- /**
65
- * @deprecated
66
- */
67
- static getBenchOptions: typeof getBenchOptions;
68
- }
69
-
70
- export { NodeBenchmarkRunner, TestRunner as VitestTestRunner };
package/dist/runners.js DELETED
@@ -1,19 +0,0 @@
1
- export { N as NodeBenchmarkRunner, T as VitestTestRunner } from './chunks/test.DNmyFkvJ.js';
2
- import '@vitest/runner';
3
- import '@vitest/utils/helpers';
4
- import '@vitest/utils/timers';
5
- import './chunks/benchmark.CX_oY03V.js';
6
- import '@vitest/runner/utils';
7
- import './chunks/utils.BX5Fg8C4.js';
8
- import '@vitest/expect';
9
- import '@vitest/utils/error';
10
- import 'pathe';
11
- import '@vitest/spy';
12
- import '@vitest/utils/offset';
13
- import '@vitest/utils/source-map';
14
- import './chunks/_commonjsHelpers.D26ty3Ew.js';
15
- import './chunks/rpc.MzXet3jl.js';
16
- import './chunks/index.Chj8NDwU.js';
17
- import '@vitest/snapshot';
18
-
19
- console.warn("Importing from \"vitest/runners\" is deprecated since Vitest 4.1. Please use \"vitest\" instead.");
@@ -1,9 +0,0 @@
1
- import { NodeSnapshotEnvironment } from '@vitest/snapshot/environment';
2
- export { SnapshotEnvironment } from '@vitest/snapshot/environment';
3
-
4
- declare class VitestNodeSnapshotEnvironment extends NodeSnapshotEnvironment {
5
- getHeader(): string;
6
- resolvePath(filepath: string): Promise<string>;
7
- }
8
-
9
- export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment };
package/dist/snapshot.js DELETED
@@ -1,6 +0,0 @@
1
- export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.COQbm6gK.js';
2
- import '@vitest/snapshot/environment';
3
- import './chunks/utils.BX5Fg8C4.js';
4
- import '@vitest/utils/timers';
5
-
6
- console.warn("Importing from \"vitest/snapshot\" is deprecated since Vitest 4.1. Please use \"vitest/runtime\" instead.");
package/dist/suite.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.d.udJtyAgw.js';
2
- export { VitestRunner, VitestRunnerConfig, createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
3
- export { createChainable } from '@vitest/runner/utils';
4
- import './chunks/benchmark.d.DAaHLpsq.js';
5
- import 'tinybench';
package/dist/suite.js DELETED
@@ -1,8 +0,0 @@
1
- export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.CX_oY03V.js';
2
- export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
3
- export { createChainable } from '@vitest/runner/utils';
4
- import '@vitest/utils/helpers';
5
- import './chunks/utils.BX5Fg8C4.js';
6
- import '@vitest/utils/timers';
7
-
8
- console.warn("Importing from \"vitest/suite\" is deprecated since Vitest 4.1. Please use static methods of \"TestRunner\" from the \"vitest\" entry point instead: e.g., `TestRunner.getCurrentTest()`.");