vitest 4.0.10 → 4.0.11
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 +4 -3
- package/dist/browser.js +1 -1
- package/dist/chunks/{base.BFVArrYW.js → base.DiCUKpyF.js} +46 -39
- package/dist/chunks/{browser.d.DnU_kh8a.d.ts → browser.d.D-d8eZY4.d.ts} +1 -1
- package/dist/chunks/{cac.D9CYcNPM.js → cac.aVhqBj0-.js} +21 -7
- package/dist/chunks/{cli-api.RnIE1JbW.js → cli-api.-bIZD4XU.js} +910 -297
- package/dist/chunks/{coverage.BUlIqJrL.js → coverage.CtyeYmKM.js} +7 -1
- package/dist/chunks/{creator.DU9qFjsW.js → creator.DAmOKTvJ.js} +3 -3
- package/dist/chunks/{global.d.BQDgW9Pr.d.ts → global.d.uY4Q0M5z.d.ts} +1 -1
- package/dist/chunks/{globals.NLOzC_A5.js → globals.C0izxiX3.js} +1 -1
- package/dist/chunks/{index.B8lJfb0J.js → index.CMvpbrsJ.js} +1 -1
- package/dist/chunks/{index.Dua7TZg_.js → index.CQwQ_SLL.js} +16 -4
- package/dist/chunks/{index.DZ-mI_Nm.js → index.DBx1AtPJ.js} +2 -1
- package/dist/chunks/{index.BYek7GgP.js → index.DWDW6mLz.js} +10 -1
- package/dist/chunks/{init-forks.BZSlxfwV.js → init-forks.DIuGPyId.js} +5 -5
- package/dist/chunks/{init-threads.CwE2n-Bv.js → init-threads.jC_8JdoN.js} +3 -3
- package/dist/chunks/{init.Cz2kTB9a.js → init.B3IeC_yW.js} +59 -21
- package/dist/chunks/{moduleRunner.d.BxT-OjLR.d.ts → moduleRunner.d.B5SW5pMI.d.ts} +9 -1
- package/dist/chunks/plugin.d.N8khPRFb.d.ts +38 -0
- package/dist/chunks/{reporters.d.keG-yFSu.d.ts → reporters.d.DgZLBdyd.d.ts} +107 -47
- package/dist/chunks/{setup-common.BOzbXE3x.js → setup-common.DGHc_BUK.js} +1 -1
- package/dist/chunks/{startModuleRunner.DLjmA_wU.js → startModuleRunner.DaBMy1JT.js} +97 -49
- package/dist/chunks/{test.BPErLMrw.js → test.DqQZzsWf.js} +14 -4
- package/dist/chunks/traces.BVPrsYso.js +151 -0
- package/dist/chunks/{config.d.BTfZNUu9.d.ts → traces.d.B8ukBJqA.d.ts} +36 -1
- package/dist/chunks/{vm.wSHjz-et.js → vm.BKyGp1KW.js} +12 -8
- package/dist/chunks/{worker.d.ZGohxCEd.d.ts → worker.d.B_PZTrCQ.d.ts} +5 -4
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +8 -7
- package/dist/coverage.d.ts +6 -5
- package/dist/coverage.js +2 -2
- package/dist/index.d.ts +12 -10
- package/dist/index.js +2 -2
- package/dist/module-evaluator.d.ts +7 -6
- package/dist/module-evaluator.js +14 -1
- package/dist/module-runner.js +2 -1
- package/dist/node.d.ts +11 -10
- package/dist/node.js +8 -7
- package/dist/reporters.d.ts +6 -5
- package/dist/reporters.js +2 -2
- package/dist/runners.d.ts +5 -1
- package/dist/runners.js +1 -1
- package/dist/worker.d.ts +8 -7
- package/dist/worker.js +8 -7
- package/dist/workers/forks.js +9 -8
- package/dist/workers/runVmTests.js +22 -20
- package/dist/workers/threads.js +9 -8
- package/dist/workers/vmForks.js +5 -4
- package/dist/workers/vmThreads.js +5 -4
- package/package.json +17 -12
- package/dist/chunks/plugin.d.C6KrdvNG.d.ts +0 -9
package/dist/node.d.ts
CHANGED
|
@@ -3,23 +3,23 @@ import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as Res
|
|
|
3
3
|
export { vite as Vite };
|
|
4
4
|
export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
5
5
|
import { IncomingMessage } from 'node:http';
|
|
6
|
-
import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.
|
|
7
|
-
export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig,
|
|
6
|
+
import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.DgZLBdyd.js';
|
|
7
|
+
export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig, a as ReportContext, aB as ReportedHookContext, aC as Reporter, ap as ResolveSnapshotPathHandler, aq as ResolveSnapshotPathHandlerContext, af as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ao as ResolvedProjectConfig, S as SerializedTestProject, u as TaskOptions, v as TestCase, w as TestCollection, x as TestDiagnostic, y as TestModule, z as TestModuleState, B as TestResult, D as TestResultFailed, E as TestResultPassed, F as TestResultSkipped, aD as TestRunEndReason, aA as TestRunResult, X as TestSequencerConstructor, G as TestState, K as TestSuite, N as TestSuiteState, ag as ToMatchScreenshotComparators, ah as ToMatchScreenshotOptions, ar as TypecheckConfig, U as UserWorkspaceConfig, as as VitestEnvironment, p as VitestPackageInstaller, W as WatcherTriggerPattern, s as WorkerResponse, _ as _BrowserNames, Q as experimental_getRunnerTask } from './chunks/reporters.d.DgZLBdyd.js';
|
|
8
|
+
export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.d.N8khPRFb.js';
|
|
8
9
|
import { Awaitable } from '@vitest/utils';
|
|
9
10
|
export { SerializedError } from '@vitest/utils';
|
|
10
|
-
import { R as RuntimeRPC, C as ContextRPC } from './chunks/worker.d.
|
|
11
|
-
export { T as TestExecutionType } from './chunks/worker.d.
|
|
11
|
+
import { R as RuntimeRPC, C as ContextRPC } from './chunks/worker.d.B_PZTrCQ.js';
|
|
12
|
+
export { T as TestExecutionType } from './chunks/worker.d.B_PZTrCQ.js';
|
|
12
13
|
import { Writable } from 'node:stream';
|
|
13
|
-
export { V as VitestPluginContext } from './chunks/plugin.d.C6KrdvNG.js';
|
|
14
14
|
import { Debugger } from 'debug';
|
|
15
|
-
import './chunks/global.d.
|
|
15
|
+
import './chunks/global.d.uY4Q0M5z.js';
|
|
16
16
|
export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
17
|
-
export { b as RuntimeConfig } from './chunks/
|
|
17
|
+
export { b as RuntimeConfig } from './chunks/traces.d.B8ukBJqA.js';
|
|
18
18
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
19
19
|
import '@vitest/mocker';
|
|
20
20
|
import '@vitest/utils/source-map';
|
|
21
21
|
import 'vitest/browser';
|
|
22
|
-
import './chunks/browser.d.
|
|
22
|
+
import './chunks/browser.d.D-d8eZY4.js';
|
|
23
23
|
import '@vitest/pretty-format';
|
|
24
24
|
import '@vitest/snapshot';
|
|
25
25
|
import '@vitest/utils/diff';
|
|
@@ -29,10 +29,11 @@ import './chunks/benchmark.d.DAaHLpsq.js';
|
|
|
29
29
|
import 'tinybench';
|
|
30
30
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
31
31
|
import '@vitest/snapshot/manager';
|
|
32
|
-
import 'node:fs';
|
|
33
32
|
import 'node:console';
|
|
33
|
+
import 'node:fs';
|
|
34
34
|
import 'vite/module-runner';
|
|
35
35
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
36
|
+
import '@opentelemetry/api';
|
|
36
37
|
|
|
37
38
|
type RawErrsMap = Map<string, TscErrorInfo[]>;
|
|
38
39
|
interface TscErrorInfo {
|
|
@@ -139,7 +140,7 @@ interface MethodsOptions {
|
|
|
139
140
|
cacheFs?: boolean;
|
|
140
141
|
collect?: boolean;
|
|
141
142
|
}
|
|
142
|
-
declare function createMethodsRPC(project: TestProject,
|
|
143
|
+
declare function createMethodsRPC(project: TestProject, methodsOptions?: MethodsOptions): RuntimeRPC;
|
|
143
144
|
|
|
144
145
|
/** @experimental */
|
|
145
146
|
declare class ForksPoolWorker implements PoolWorker {
|
package/dist/node.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import { resolveConfig as resolveConfig$1, mergeConfig } from 'vite';
|
|
3
3
|
export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
4
|
-
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.
|
|
5
|
-
export { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, o as createDebugger, d as createMethodsRPC, n as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
6
|
-
export { p as parseCLI } from './chunks/cac.
|
|
7
|
-
import { r as resolveConfig$2 } from './chunks/coverage.
|
|
8
|
-
export { b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.
|
|
4
|
+
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.-bIZD4XU.js';
|
|
5
|
+
export { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, o as createDebugger, d as createMethodsRPC, n as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.-bIZD4XU.js';
|
|
6
|
+
export { p as parseCLI } from './chunks/cac.aVhqBj0-.js';
|
|
7
|
+
import { r as resolveConfig$2 } from './chunks/coverage.CtyeYmKM.js';
|
|
8
|
+
export { b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.CtyeYmKM.js';
|
|
9
9
|
import { slash, deepClone } from '@vitest/utils/helpers';
|
|
10
10
|
import { a as any } from './chunks/index.D4KonVSU.js';
|
|
11
11
|
import { resolve } from 'pathe';
|
|
@@ -19,7 +19,7 @@ import 'node:os';
|
|
|
19
19
|
import '@vitest/snapshot/manager';
|
|
20
20
|
import 'node:perf_hooks';
|
|
21
21
|
import './chunks/index.0kCJoeWi.js';
|
|
22
|
-
import './chunks/index.
|
|
22
|
+
import './chunks/index.DWDW6mLz.js';
|
|
23
23
|
import 'node:fs/promises';
|
|
24
24
|
import '@vitest/utils/source-map';
|
|
25
25
|
import 'tinyrainbow';
|
|
@@ -44,6 +44,7 @@ import 'zlib';
|
|
|
44
44
|
import 'buffer';
|
|
45
45
|
import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
46
46
|
import 'node:crypto';
|
|
47
|
+
import './chunks/traces.BVPrsYso.js';
|
|
47
48
|
import 'debug';
|
|
48
49
|
import '#module-evaluator';
|
|
49
50
|
import 'vite/module-runner';
|
|
@@ -61,7 +62,7 @@ import './chunks/defaults.BOqNVLsY.js';
|
|
|
61
62
|
import '@vitest/utils/constants';
|
|
62
63
|
import '@vitest/utils/resolver';
|
|
63
64
|
import 'es-module-lexer';
|
|
64
|
-
import './chunks/index.
|
|
65
|
+
import './chunks/index.CMvpbrsJ.js';
|
|
65
66
|
import 'node:assert';
|
|
66
67
|
import '@vitest/utils/serialize';
|
|
67
68
|
import 'node:readline';
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
export { aR as BaseReporter, aS as BenchmarkBuiltinReporters, aE as BenchmarkReporter, aF as BenchmarkReportsMap, aT as BuiltinReporterOptions, aU as BuiltinReporters, aG as DefaultReporter, aH as DotReporter, aI as GithubActionsReporter, aJ as HangingProcessReporter, aL as JUnitReporter, aV as JsonAssertionResult, aK as JsonReporter, aW as JsonTestResult, aX as JsonTestResults, aB as ReportedHookContext, aC as Reporter, aM as ReportersMap, aN as TapFlatReporter, aO as TapReporter, aD as TestRunEndReason, aP as VerboseBenchmarkReporter, aQ as VerboseReporter } from './chunks/reporters.d.
|
|
1
|
+
export { aR as BaseReporter, aS as BenchmarkBuiltinReporters, aE as BenchmarkReporter, aF as BenchmarkReportsMap, aT as BuiltinReporterOptions, aU as BuiltinReporters, aG as DefaultReporter, aH as DotReporter, aI as GithubActionsReporter, aJ as HangingProcessReporter, aL as JUnitReporter, aV as JsonAssertionResult, aK as JsonReporter, aW as JsonTestResult, aX as JsonTestResults, aB as ReportedHookContext, aC as Reporter, aM as ReportersMap, aN as TapFlatReporter, aO as TapReporter, aD as TestRunEndReason, aP as VerboseBenchmarkReporter, aQ as VerboseReporter } from './chunks/reporters.d.DgZLBdyd.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import '@vitest/utils';
|
|
4
|
-
import './chunks/worker.d.
|
|
4
|
+
import './chunks/worker.d.B_PZTrCQ.js';
|
|
5
5
|
import 'vite/module-runner';
|
|
6
|
-
import './chunks/
|
|
6
|
+
import './chunks/traces.d.B8ukBJqA.js';
|
|
7
7
|
import '@vitest/pretty-format';
|
|
8
8
|
import '@vitest/snapshot';
|
|
9
9
|
import '@vitest/utils/diff';
|
|
10
|
+
import '@opentelemetry/api';
|
|
10
11
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
11
12
|
import 'node:stream';
|
|
12
13
|
import 'vite';
|
|
13
14
|
import '@vitest/mocker';
|
|
14
15
|
import '@vitest/utils/source-map';
|
|
15
16
|
import 'vitest/browser';
|
|
16
|
-
import './chunks/browser.d.
|
|
17
|
+
import './chunks/browser.d.D-d8eZY4.js';
|
|
17
18
|
import '@vitest/expect';
|
|
18
19
|
import 'vitest/optional-types.js';
|
|
19
20
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
@@ -21,5 +22,5 @@ import '@vitest/runner/utils';
|
|
|
21
22
|
import 'tinybench';
|
|
22
23
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
23
24
|
import '@vitest/snapshot/manager';
|
|
24
|
-
import 'node:fs';
|
|
25
25
|
import 'node:console';
|
|
26
|
+
import 'node:fs';
|
package/dist/reporters.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.
|
|
2
|
-
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.
|
|
1
|
+
export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.DWDW6mLz.js';
|
|
2
|
+
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.CMvpbrsJ.js';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:fs/promises';
|
|
5
5
|
import 'pathe';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as tinybench from 'tinybench';
|
|
2
2
|
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration } from '@vitest/runner';
|
|
3
3
|
export { VitestRunner } from '@vitest/runner';
|
|
4
|
-
import { S as SerializedConfig } from './chunks/
|
|
4
|
+
import { S as SerializedConfig, T as Traces } from './chunks/traces.d.B8ukBJqA.js';
|
|
5
5
|
import '@vitest/pretty-format';
|
|
6
6
|
import '@vitest/snapshot';
|
|
7
7
|
import '@vitest/utils/diff';
|
|
8
|
+
import '@opentelemetry/api';
|
|
8
9
|
|
|
9
10
|
declare class NodeBenchmarkRunner implements VitestRunner {
|
|
10
11
|
config: SerializedConfig;
|
|
@@ -24,6 +25,7 @@ declare class VitestTestRunner implements VitestRunner {
|
|
|
24
25
|
private cancelRun;
|
|
25
26
|
private assertionsErrors;
|
|
26
27
|
pool: string;
|
|
28
|
+
private _otel;
|
|
27
29
|
constructor(config: SerializedConfig);
|
|
28
30
|
importFile(filepath: string, source: VitestRunnerImportSource): unknown;
|
|
29
31
|
onCollectStart(file: File): void;
|
|
@@ -40,6 +42,8 @@ declare class VitestTestRunner implements VitestRunner {
|
|
|
40
42
|
onAfterTryTask(test: Test): void;
|
|
41
43
|
extendTaskContext(context: TestContext): TestContext;
|
|
42
44
|
getImportDurations(): Record<string, ImportDuration>;
|
|
45
|
+
trace: <T>(name: string, attributes: Record<string, any> | (() => T), cb?: () => T) => T;
|
|
46
|
+
__setTraces(traces: Traces): void;
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
export { NodeBenchmarkRunner, VitestTestRunner };
|
package/dist/runners.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { N as NodeBenchmarkRunner, V as VitestTestRunner } from './chunks/test.
|
|
1
|
+
export { N as NodeBenchmarkRunner, V as VitestTestRunner } from './chunks/test.DqQZzsWf.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import '@vitest/utils/helpers';
|
|
4
4
|
import '@vitest/utils/timers';
|
package/dist/worker.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { W as WorkerGlobalState, B as BirpcOptions, R as RuntimeRPC, a as WorkerSetupContext } from './chunks/worker.d.
|
|
1
|
+
import { W as WorkerGlobalState, B as BirpcOptions, R as RuntimeRPC, a as WorkerSetupContext } from './chunks/worker.d.B_PZTrCQ.js';
|
|
2
|
+
import { T as Traces } from './chunks/traces.d.B8ukBJqA.js';
|
|
2
3
|
import { Awaitable } from '@vitest/utils';
|
|
3
4
|
import '@vitest/runner';
|
|
4
5
|
import 'vite/module-runner';
|
|
5
|
-
import './chunks/
|
|
6
|
-
import '@vitest/pretty-format';
|
|
6
|
+
import './chunks/environment.d.CrsxCzP1.js';
|
|
7
7
|
import '@vitest/snapshot';
|
|
8
|
+
import '@vitest/pretty-format';
|
|
8
9
|
import '@vitest/utils/diff';
|
|
9
|
-
import '
|
|
10
|
+
import '@opentelemetry/api';
|
|
10
11
|
|
|
11
12
|
/** @experimental */
|
|
12
|
-
declare function runBaseTests(method: "run" | "collect", state: WorkerGlobalState): Promise<void>;
|
|
13
|
+
declare function runBaseTests(method: "run" | "collect", state: WorkerGlobalState, traces: Traces): Promise<void>;
|
|
13
14
|
|
|
14
15
|
type WorkerRpcOptions = Pick<BirpcOptions<RuntimeRPC>, "on" | "off" | "post" | "serialize" | "deserialize">;
|
|
15
16
|
interface VitestWorker extends WorkerRpcOptions {
|
|
16
|
-
runTests: (state: WorkerGlobalState) => Awaitable<unknown>;
|
|
17
|
-
collectTests: (state: WorkerGlobalState) => Awaitable<unknown>;
|
|
17
|
+
runTests: (state: WorkerGlobalState, traces: Traces) => Awaitable<unknown>;
|
|
18
|
+
collectTests: (state: WorkerGlobalState, traces: Traces) => Awaitable<unknown>;
|
|
18
19
|
setup?: (context: WorkerSetupContext) => Promise<() => Promise<unknown>>;
|
|
19
20
|
}
|
|
20
21
|
|
package/dist/worker.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { r as runBaseTests } from './chunks/base.
|
|
2
|
-
export { i as init } from './chunks/init.
|
|
1
|
+
export { r as runBaseTests } from './chunks/base.DiCUKpyF.js';
|
|
2
|
+
export { i as init } from './chunks/init.B3IeC_yW.js';
|
|
3
3
|
import 'node:vm';
|
|
4
4
|
import '@vitest/spy';
|
|
5
|
-
import './chunks/index.
|
|
5
|
+
import './chunks/index.CQwQ_SLL.js';
|
|
6
6
|
import '@vitest/expect';
|
|
7
|
-
import './chunks/setup-common.
|
|
7
|
+
import './chunks/setup-common.DGHc_BUK.js';
|
|
8
8
|
import './chunks/coverage.D_JHT54q.js';
|
|
9
9
|
import '@vitest/snapshot';
|
|
10
10
|
import '@vitest/utils/timers';
|
|
11
11
|
import './chunks/utils.DvEY5TfP.js';
|
|
12
12
|
import './chunks/rpc.BytlcPfC.js';
|
|
13
13
|
import './chunks/index.0kCJoeWi.js';
|
|
14
|
-
import './chunks/test.
|
|
14
|
+
import './chunks/test.DqQZzsWf.js';
|
|
15
15
|
import '@vitest/runner';
|
|
16
16
|
import '@vitest/utils/helpers';
|
|
17
17
|
import './chunks/benchmark.B3N2zMcH.js';
|
|
@@ -25,7 +25,7 @@ import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
|
25
25
|
import './chunks/date.Bq6ZW5rf.js';
|
|
26
26
|
import './chunks/evaluatedModules.Dg1zASAC.js';
|
|
27
27
|
import 'vite/module-runner';
|
|
28
|
-
import './chunks/startModuleRunner.
|
|
28
|
+
import './chunks/startModuleRunner.DaBMy1JT.js';
|
|
29
29
|
import 'node:fs';
|
|
30
30
|
import 'node:module';
|
|
31
31
|
import 'node:url';
|
|
@@ -33,6 +33,7 @@ import './path.js';
|
|
|
33
33
|
import 'node:path';
|
|
34
34
|
import '@vitest/utils/serialize';
|
|
35
35
|
import './module-evaluator.js';
|
|
36
|
+
import './chunks/traces.BVPrsYso.js';
|
|
36
37
|
import '@vitest/mocker';
|
|
37
38
|
import 'node:perf_hooks';
|
|
38
39
|
import './chunks/inspector.CvyFGlXm.js';
|
|
@@ -40,7 +41,7 @@ import 'node:timers';
|
|
|
40
41
|
import 'node:timers/promises';
|
|
41
42
|
import 'node:util';
|
|
42
43
|
import '@vitest/utils/constants';
|
|
43
|
-
import './chunks/index.
|
|
44
|
+
import './chunks/index.DBx1AtPJ.js';
|
|
44
45
|
import 'expect-type';
|
|
45
46
|
import './chunks/index.QWbK7rHY.js';
|
|
46
47
|
import 'node:console';
|
package/dist/workers/forks.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { r as runBaseTests, s as setupEnvironment } from '../chunks/base.
|
|
2
|
-
import { w as workerInit } from '../chunks/init-forks.
|
|
1
|
+
import { r as runBaseTests, s as setupEnvironment } from '../chunks/base.DiCUKpyF.js';
|
|
2
|
+
import { w as workerInit } from '../chunks/init-forks.DIuGPyId.js';
|
|
3
3
|
import 'node:vm';
|
|
4
4
|
import '@vitest/spy';
|
|
5
|
-
import '../chunks/index.
|
|
5
|
+
import '../chunks/index.CQwQ_SLL.js';
|
|
6
6
|
import '@vitest/expect';
|
|
7
|
-
import '../chunks/setup-common.
|
|
7
|
+
import '../chunks/setup-common.DGHc_BUK.js';
|
|
8
8
|
import '../chunks/coverage.D_JHT54q.js';
|
|
9
9
|
import '@vitest/snapshot';
|
|
10
10
|
import '@vitest/utils/timers';
|
|
11
11
|
import '../chunks/utils.DvEY5TfP.js';
|
|
12
12
|
import '../chunks/rpc.BytlcPfC.js';
|
|
13
13
|
import '../chunks/index.0kCJoeWi.js';
|
|
14
|
-
import '../chunks/test.
|
|
14
|
+
import '../chunks/test.DqQZzsWf.js';
|
|
15
15
|
import '@vitest/runner';
|
|
16
16
|
import '@vitest/utils/helpers';
|
|
17
17
|
import '../chunks/benchmark.B3N2zMcH.js';
|
|
@@ -23,16 +23,17 @@ import '@vitest/utils/offset';
|
|
|
23
23
|
import '@vitest/utils/source-map';
|
|
24
24
|
import '../chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
25
25
|
import '../chunks/date.Bq6ZW5rf.js';
|
|
26
|
-
import '../chunks/init.
|
|
26
|
+
import '../chunks/init.B3IeC_yW.js';
|
|
27
27
|
import 'node:fs';
|
|
28
28
|
import 'node:module';
|
|
29
29
|
import 'node:url';
|
|
30
30
|
import 'vite/module-runner';
|
|
31
|
-
import '../chunks/startModuleRunner.
|
|
31
|
+
import '../chunks/startModuleRunner.DaBMy1JT.js';
|
|
32
32
|
import '../path.js';
|
|
33
33
|
import 'node:path';
|
|
34
34
|
import '@vitest/utils/serialize';
|
|
35
35
|
import '../module-evaluator.js';
|
|
36
|
+
import '../chunks/traces.BVPrsYso.js';
|
|
36
37
|
import '@vitest/mocker';
|
|
37
38
|
import '../chunks/index.QWbK7rHY.js';
|
|
38
39
|
import 'node:console';
|
|
@@ -43,7 +44,7 @@ import 'node:timers';
|
|
|
43
44
|
import 'node:timers/promises';
|
|
44
45
|
import 'node:util';
|
|
45
46
|
import '@vitest/utils/constants';
|
|
46
|
-
import '../chunks/index.
|
|
47
|
+
import '../chunks/index.DBx1AtPJ.js';
|
|
47
48
|
import 'expect-type';
|
|
48
49
|
|
|
49
50
|
workerInit({
|
|
@@ -5,9 +5,9 @@ import timersPromises from 'node:timers/promises';
|
|
|
5
5
|
import util from 'node:util';
|
|
6
6
|
import { startTests, collectTests } from '@vitest/runner';
|
|
7
7
|
import { KNOWN_ASSET_TYPES } from '@vitest/utils/constants';
|
|
8
|
-
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.
|
|
9
|
-
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/setup-common.
|
|
10
|
-
import { i as index } from '../chunks/index.
|
|
8
|
+
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.CQwQ_SLL.js';
|
|
9
|
+
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/setup-common.DGHc_BUK.js';
|
|
10
|
+
import { i as index } from '../chunks/index.DBx1AtPJ.js';
|
|
11
11
|
import { c as closeInspector } from '../chunks/inspector.CvyFGlXm.js';
|
|
12
12
|
import { g as getWorkerState } from '../chunks/utils.DvEY5TfP.js';
|
|
13
13
|
import { g as globalExpect } from '../chunks/vi.BiaV1qII.js';
|
|
@@ -15,7 +15,7 @@ import '@vitest/expect';
|
|
|
15
15
|
import '../chunks/rpc.BytlcPfC.js';
|
|
16
16
|
import '@vitest/utils/timers';
|
|
17
17
|
import '../chunks/index.0kCJoeWi.js';
|
|
18
|
-
import '../chunks/test.
|
|
18
|
+
import '../chunks/test.DqQZzsWf.js';
|
|
19
19
|
import '@vitest/utils/helpers';
|
|
20
20
|
import '../chunks/benchmark.B3N2zMcH.js';
|
|
21
21
|
import '@vitest/runner/utils';
|
|
@@ -33,9 +33,9 @@ import '@vitest/utils/source-map';
|
|
|
33
33
|
import '../chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
34
34
|
import '../chunks/date.Bq6ZW5rf.js';
|
|
35
35
|
|
|
36
|
-
async function run(method, files, config, moduleRunner) {
|
|
36
|
+
async function run(method, files, config, moduleRunner, traces) {
|
|
37
37
|
const workerState = getWorkerState();
|
|
38
|
-
await setupCommonEnv(config);
|
|
38
|
+
await traces.$("vitest.runtime.global_env", () => setupCommonEnv(config));
|
|
39
39
|
Object.defineProperty(globalThis, "__vitest_index__", {
|
|
40
40
|
value: index,
|
|
41
41
|
enumerable: false
|
|
@@ -61,27 +61,29 @@ async function run(method, files, config, moduleRunner) {
|
|
|
61
61
|
timers,
|
|
62
62
|
timersPromises
|
|
63
63
|
};
|
|
64
|
-
await startCoverageInsideWorker(config.coverage, moduleRunner, { isolate: false });
|
|
64
|
+
await traces.$("vitest.runtime.coverage.start", () => startCoverageInsideWorker(config.coverage, moduleRunner, { isolate: false }));
|
|
65
65
|
if (config.chaiConfig) setupChaiConfig(config.chaiConfig);
|
|
66
|
-
const [
|
|
66
|
+
const [testRunner, snapshotEnvironment] = await Promise.all([traces.$("vitest.runtime.runner", () => resolveTestRunner(config, moduleRunner, traces)), traces.$("vitest.runtime.snapshot.environment", () => resolveSnapshotEnvironment(config, moduleRunner))]);
|
|
67
67
|
config.snapshotOptions.snapshotEnvironment = snapshotEnvironment;
|
|
68
|
-
|
|
68
|
+
testRunner.getWorkerContext = void 0;
|
|
69
69
|
workerState.onCancel((reason) => {
|
|
70
70
|
closeInspector(config);
|
|
71
|
-
|
|
71
|
+
testRunner.cancel?.(reason);
|
|
72
72
|
});
|
|
73
73
|
workerState.durations.prepare = performance.now() - workerState.durations.prepare;
|
|
74
74
|
const { vi } = index;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
await traces.$(`vitest.test.runner.${method}`, async () => {
|
|
76
|
+
for (const file of files) {
|
|
77
|
+
workerState.filepath = file.filepath;
|
|
78
|
+
if (method === "run") await traces.$(`vitest.test.runner.${method}.module`, { attributes: { "code.file.path": file.filepath } }, () => startTests([file], testRunner));
|
|
79
|
+
else await traces.$(`vitest.test.runner.${method}.module`, { attributes: { "code.file.path": file.filepath } }, () => collectTests([file], testRunner));
|
|
80
|
+
// reset after tests, because user might call `vi.setConfig` in setupFile
|
|
81
|
+
vi.resetConfig();
|
|
82
|
+
// mocks should not affect different files
|
|
83
|
+
vi.restoreAllMocks();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
await traces.$("vitest.runtime.coverage.stop", () => stopCoverageInsideWorker(config.coverage, moduleRunner, { isolate: false }));
|
|
85
87
|
}
|
|
86
88
|
function resolveCss(mod) {
|
|
87
89
|
mod.exports = "";
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { s as setupEnvironment, r as runBaseTests } from '../chunks/base.
|
|
2
|
-
import { w as workerInit } from '../chunks/init-threads.
|
|
1
|
+
import { s as setupEnvironment, r as runBaseTests } from '../chunks/base.DiCUKpyF.js';
|
|
2
|
+
import { w as workerInit } from '../chunks/init-threads.jC_8JdoN.js';
|
|
3
3
|
import 'node:vm';
|
|
4
4
|
import '@vitest/spy';
|
|
5
|
-
import '../chunks/index.
|
|
5
|
+
import '../chunks/index.CQwQ_SLL.js';
|
|
6
6
|
import '@vitest/expect';
|
|
7
|
-
import '../chunks/setup-common.
|
|
7
|
+
import '../chunks/setup-common.DGHc_BUK.js';
|
|
8
8
|
import '../chunks/coverage.D_JHT54q.js';
|
|
9
9
|
import '@vitest/snapshot';
|
|
10
10
|
import '@vitest/utils/timers';
|
|
11
11
|
import '../chunks/utils.DvEY5TfP.js';
|
|
12
12
|
import '../chunks/rpc.BytlcPfC.js';
|
|
13
13
|
import '../chunks/index.0kCJoeWi.js';
|
|
14
|
-
import '../chunks/test.
|
|
14
|
+
import '../chunks/test.DqQZzsWf.js';
|
|
15
15
|
import '@vitest/runner';
|
|
16
16
|
import '@vitest/utils/helpers';
|
|
17
17
|
import '../chunks/benchmark.B3N2zMcH.js';
|
|
@@ -23,16 +23,17 @@ import '@vitest/utils/offset';
|
|
|
23
23
|
import '@vitest/utils/source-map';
|
|
24
24
|
import '../chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
25
25
|
import '../chunks/date.Bq6ZW5rf.js';
|
|
26
|
-
import '../chunks/init.
|
|
26
|
+
import '../chunks/init.B3IeC_yW.js';
|
|
27
27
|
import 'node:fs';
|
|
28
28
|
import 'node:module';
|
|
29
29
|
import 'node:url';
|
|
30
30
|
import 'vite/module-runner';
|
|
31
|
-
import '../chunks/startModuleRunner.
|
|
31
|
+
import '../chunks/startModuleRunner.DaBMy1JT.js';
|
|
32
32
|
import '../path.js';
|
|
33
33
|
import 'node:path';
|
|
34
34
|
import '@vitest/utils/serialize';
|
|
35
35
|
import '../module-evaluator.js';
|
|
36
|
+
import '../chunks/traces.BVPrsYso.js';
|
|
36
37
|
import '@vitest/mocker';
|
|
37
38
|
import '../chunks/index.QWbK7rHY.js';
|
|
38
39
|
import 'node:console';
|
|
@@ -43,7 +44,7 @@ import 'node:timers';
|
|
|
43
44
|
import 'node:timers/promises';
|
|
44
45
|
import 'node:util';
|
|
45
46
|
import '@vitest/utils/constants';
|
|
46
|
-
import '../chunks/index.
|
|
47
|
+
import '../chunks/index.DBx1AtPJ.js';
|
|
47
48
|
import 'expect-type';
|
|
48
49
|
import 'node:worker_threads';
|
|
49
50
|
|
package/dist/workers/vmForks.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { w as workerInit } from '../chunks/init-forks.
|
|
2
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
3
|
-
import '../chunks/init.
|
|
1
|
+
import { w as workerInit } from '../chunks/init-forks.DIuGPyId.js';
|
|
2
|
+
import { r as runVmTests } from '../chunks/vm.BKyGp1KW.js';
|
|
3
|
+
import '../chunks/init.B3IeC_yW.js';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'node:module';
|
|
6
6
|
import 'node:url';
|
|
7
7
|
import 'pathe';
|
|
8
8
|
import 'vite/module-runner';
|
|
9
|
-
import '../chunks/startModuleRunner.
|
|
9
|
+
import '../chunks/startModuleRunner.DaBMy1JT.js';
|
|
10
10
|
import '@vitest/utils/helpers';
|
|
11
11
|
import '../path.js';
|
|
12
12
|
import 'node:path';
|
|
13
13
|
import '@vitest/utils/serialize';
|
|
14
14
|
import '../module-evaluator.js';
|
|
15
15
|
import 'node:vm';
|
|
16
|
+
import '../chunks/traces.BVPrsYso.js';
|
|
16
17
|
import '@vitest/mocker';
|
|
17
18
|
import '../chunks/index.QWbK7rHY.js';
|
|
18
19
|
import 'node:console';
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { w as workerInit } from '../chunks/init-threads.
|
|
2
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
1
|
+
import { w as workerInit } from '../chunks/init-threads.jC_8JdoN.js';
|
|
2
|
+
import { r as runVmTests } from '../chunks/vm.BKyGp1KW.js';
|
|
3
3
|
import 'node:worker_threads';
|
|
4
|
-
import '../chunks/init.
|
|
4
|
+
import '../chunks/init.B3IeC_yW.js';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:module';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'pathe';
|
|
9
9
|
import 'vite/module-runner';
|
|
10
|
-
import '../chunks/startModuleRunner.
|
|
10
|
+
import '../chunks/startModuleRunner.DaBMy1JT.js';
|
|
11
11
|
import '@vitest/utils/helpers';
|
|
12
12
|
import '../path.js';
|
|
13
13
|
import 'node:path';
|
|
14
14
|
import '@vitest/utils/serialize';
|
|
15
15
|
import '../module-evaluator.js';
|
|
16
16
|
import 'node:vm';
|
|
17
|
+
import '../chunks/traces.BVPrsYso.js';
|
|
17
18
|
import '@vitest/mocker';
|
|
18
19
|
import '../chunks/index.QWbK7rHY.js';
|
|
19
20
|
import 'node:console';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.11",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -130,19 +130,23 @@
|
|
|
130
130
|
},
|
|
131
131
|
"peerDependencies": {
|
|
132
132
|
"@edge-runtime/vm": "*",
|
|
133
|
+
"@opentelemetry/api": "^1.9.0",
|
|
133
134
|
"@types/debug": "^4.1.12",
|
|
134
135
|
"@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
|
|
135
136
|
"happy-dom": "*",
|
|
136
137
|
"jsdom": "*",
|
|
137
|
-
"@vitest/browser-
|
|
138
|
-
"@vitest/browser-webdriverio": "4.0.
|
|
139
|
-
"@vitest/browser-
|
|
140
|
-
"@vitest/ui": "4.0.
|
|
138
|
+
"@vitest/browser-preview": "4.0.11",
|
|
139
|
+
"@vitest/browser-webdriverio": "4.0.11",
|
|
140
|
+
"@vitest/browser-playwright": "4.0.11",
|
|
141
|
+
"@vitest/ui": "4.0.11"
|
|
141
142
|
},
|
|
142
143
|
"peerDependenciesMeta": {
|
|
143
144
|
"@edge-runtime/vm": {
|
|
144
145
|
"optional": true
|
|
145
146
|
},
|
|
147
|
+
"@opentelemetry/api": {
|
|
148
|
+
"optional": true
|
|
149
|
+
},
|
|
146
150
|
"@types/debug": {
|
|
147
151
|
"optional": true
|
|
148
152
|
},
|
|
@@ -182,18 +186,19 @@
|
|
|
182
186
|
"tinyrainbow": "^3.0.3",
|
|
183
187
|
"vite": "^6.0.0 || ^7.0.0",
|
|
184
188
|
"why-is-node-running": "^2.3.0",
|
|
185
|
-
"@vitest/expect": "4.0.
|
|
186
|
-
"@vitest/pretty-format": "4.0.
|
|
187
|
-
"@vitest/
|
|
188
|
-
"@vitest/
|
|
189
|
-
"@vitest/snapshot": "4.0.
|
|
190
|
-
"@vitest/
|
|
191
|
-
"@vitest/
|
|
189
|
+
"@vitest/expect": "4.0.11",
|
|
190
|
+
"@vitest/pretty-format": "4.0.11",
|
|
191
|
+
"@vitest/mocker": "4.0.11",
|
|
192
|
+
"@vitest/runner": "4.0.11",
|
|
193
|
+
"@vitest/snapshot": "4.0.11",
|
|
194
|
+
"@vitest/spy": "4.0.11",
|
|
195
|
+
"@vitest/utils": "4.0.11"
|
|
192
196
|
},
|
|
193
197
|
"devDependencies": {
|
|
194
198
|
"@antfu/install-pkg": "^1.1.0",
|
|
195
199
|
"@edge-runtime/vm": "^5.0.0",
|
|
196
200
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
201
|
+
"@opentelemetry/api": "^1.9.0",
|
|
197
202
|
"@sinonjs/fake-timers": "14.0.0",
|
|
198
203
|
"@types/debug": "^4.1.12",
|
|
199
204
|
"@types/estree": "^1.0.8",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { V as Vitest, T as TestProject, a as TestProjectConfiguration } from './reporters.d.keG-yFSu.js';
|
|
2
|
-
|
|
3
|
-
interface VitestPluginContext {
|
|
4
|
-
vitest: Vitest;
|
|
5
|
-
project: TestProject;
|
|
6
|
-
injectTestProjects: (config: TestProjectConfiguration | TestProjectConfiguration[]) => Promise<TestProject[]>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export type { VitestPluginContext as V };
|