vitest 2.0.0 → 2.0.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.
- package/dist/browser.d.ts +16 -16
- package/dist/chunks/{browser-creator.DSqYDthP.js → browser-creator.CyaOd8pl.js} +1 -1
- package/dist/chunks/{runtime-console.O41g23Zj.js → runtime-console.C2L2zykk.js} +3 -2
- package/dist/chunks/{runtime-runBaseTests.DX3h28Mp.js → runtime-runBaseTests.DJ9UidQ0.js} +2 -4
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +2 -1
- package/dist/coverage.d.ts +2 -1
- package/dist/environments.d.ts +2 -1
- package/dist/execute.d.ts +3 -2
- package/dist/index.d.ts +4 -3
- package/dist/node.d.ts +3 -2
- package/dist/node.js +6 -6
- package/dist/{reporters-DrhyxxXt.d.ts → reporters-BECoY4-b.d.ts} +7 -276
- package/dist/reporters.d.ts +2 -1
- package/dist/reporters.js +4 -4
- package/dist/runners.d.ts +2 -1
- package/dist/{suite-DCPwkk7G.d.ts → suite-BWgaIsVn.d.ts} +1 -1
- package/dist/suite.d.ts +3 -2
- package/dist/vendor/{base.CdA1i5tB.js → base.pB8aBRcE.js} +1 -1
- package/dist/vendor/{cac.5nBDv26-.js → cac.C2zVnLp0.js} +9 -9
- package/dist/vendor/{cli-api.BT4NJtxX.js → cli-api.FtQZKvQk.js} +11 -7
- package/dist/vendor/{index.3x3MdmUV.js → index.BCwvoAaf.js} +3 -3
- package/dist/vendor/{utils.BVMrsl6E.js → utils.DyTe1Nxn.js} +1 -1
- package/dist/vendor/{vm.BrDS6p7h.js → vm.D1T5Rxan.js} +1 -1
- package/dist/workers/forks.js +1 -1
- package/dist/workers/runVmTests.js +1 -3
- package/dist/workers/threads.js +1 -1
- package/dist/workers/vmForks.js +3 -2
- package/dist/workers/vmThreads.js +3 -2
- package/dist/workers.d.ts +2 -1
- package/dist/workers.js +4 -3
- package/package.json +11 -10
package/dist/browser.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { collectTests, processError, startTests } from '@vitest/runner';
|
|
2
|
-
import { R as ResolvedConfig, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule } from './reporters-
|
|
2
|
+
import { R as ResolvedConfig, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule } from './reporters-BECoY4-b.js';
|
|
3
|
+
import { Formatter } from 'tinyrainbow';
|
|
3
4
|
import { VitestExecutor } from './execute.js';
|
|
4
5
|
import * as spy$1 from '@vitest/spy';
|
|
5
6
|
import 'vite';
|
|
7
|
+
import '@vitest/pretty-format';
|
|
6
8
|
import 'vite-node';
|
|
7
9
|
import '@vitest/snapshot';
|
|
8
10
|
import '@vitest/expect';
|
|
@@ -20,26 +22,24 @@ import 'chai';
|
|
|
20
22
|
import 'node:vm';
|
|
21
23
|
|
|
22
24
|
function _mergeNamespaces(n, m) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
m.forEach(function (e) {
|
|
26
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
27
|
+
if (k !== 'default' && !(k in n)) {
|
|
28
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
29
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return e[k]; }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
return Object.freeze(n);
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
var spy = /*#__PURE__*/_mergeNamespaces({
|
|
38
|
-
|
|
40
|
+
__proto__: null
|
|
39
41
|
}, [spy$1]);
|
|
40
42
|
|
|
41
|
-
type Formatter = (input: string | number | null | undefined) => string;
|
|
42
|
-
|
|
43
43
|
interface DiffOptions {
|
|
44
44
|
aAnnotation?: string;
|
|
45
45
|
aColor?: Formatter;
|
|
@@ -2,7 +2,7 @@ import { resolve, dirname, relative } from 'node:path';
|
|
|
2
2
|
import { existsSync, writeFileSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
4
4
|
import { p as prompt, f as findUp } from '../vendor/index.D6GZqexG.js';
|
|
5
|
-
import c from '
|
|
5
|
+
import c from 'tinyrainbow';
|
|
6
6
|
import { detectPackageManager, installPackage } from './install-pkg.DNUmWFkO.js';
|
|
7
7
|
import { execa } from 'execa';
|
|
8
8
|
import { c as configFiles } from '../vendor/constants.CsnA4eRy.js';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Writable } from 'node:stream';
|
|
2
2
|
import { Console } from 'node:console';
|
|
3
3
|
import { relative } from 'node:path';
|
|
4
|
-
import { getSafeTimers
|
|
4
|
+
import { getSafeTimers } from '@vitest/utils';
|
|
5
|
+
import c from 'tinyrainbow';
|
|
5
6
|
import { R as RealDate } from '../vendor/date.W2xKR2qe.js';
|
|
6
7
|
import 'pathe';
|
|
7
8
|
import '@vitest/runner/utils';
|
|
@@ -168,7 +169,7 @@ function createCustomConsole(defaultState) {
|
|
|
168
169
|
return new Console({
|
|
169
170
|
stdout,
|
|
170
171
|
stderr,
|
|
171
|
-
colorMode:
|
|
172
|
+
colorMode: c.isColorSupported,
|
|
172
173
|
groupIndentation: 2
|
|
173
174
|
});
|
|
174
175
|
}
|
|
@@ -2,7 +2,7 @@ import { performance } from 'node:perf_hooks';
|
|
|
2
2
|
import { startTests, collectTests } from '@vitest/runner';
|
|
3
3
|
import 'pathe';
|
|
4
4
|
import '@vitest/runner/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { getSafeTimers } from '@vitest/utils';
|
|
6
6
|
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
7
7
|
import '../vendor/env.2ltrQNq0.js';
|
|
8
8
|
import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.DXACdGTu.js';
|
|
@@ -11,7 +11,6 @@ import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTest
|
|
|
11
11
|
import { createRequire } from 'node:module';
|
|
12
12
|
import util from 'node:util';
|
|
13
13
|
import timers from 'node:timers';
|
|
14
|
-
import { isatty } from 'node:tty';
|
|
15
14
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
16
15
|
import { V as VitestIndex } from '../vendor/index.Hqvcg1pf.js';
|
|
17
16
|
import { s as setupCommonEnv } from '../vendor/setup-common.yHaxjRhz.js';
|
|
@@ -50,7 +49,6 @@ async function setupGlobalEnv(config, { environment }, executor) {
|
|
|
50
49
|
return;
|
|
51
50
|
}
|
|
52
51
|
globalSetup = true;
|
|
53
|
-
setupColors(createColors(isatty(1)));
|
|
54
52
|
if (environment.transformMode === "web") {
|
|
55
53
|
const _require = createRequire(import.meta.url);
|
|
56
54
|
_require.extensions[".css"] = () => ({});
|
|
@@ -73,7 +71,7 @@ async function setupGlobalEnv(config, { environment }, executor) {
|
|
|
73
71
|
}
|
|
74
72
|
}
|
|
75
73
|
async function setupConsoleLogSpy() {
|
|
76
|
-
const { createCustomConsole } = await import('./runtime-console.
|
|
74
|
+
const { createCustomConsole } = await import('./runtime-console.C2L2zykk.js');
|
|
77
75
|
globalThis.console = createCustomConsole();
|
|
78
76
|
}
|
|
79
77
|
async function withEnv({ environment }, options, fn) {
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as createCLI } from './vendor/cac.
|
|
1
|
+
import { c as createCLI } from './vendor/cac.C2zVnLp0.js';
|
|
2
2
|
import 'pathe';
|
|
3
3
|
import 'events';
|
|
4
|
-
import '
|
|
4
|
+
import 'tinyrainbow';
|
|
5
5
|
import './vendor/base.CTYV4Gnz.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
7
|
import './vendor/constants.CsnA4eRy.js';
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ConfigEnv, Plugin, UserConfig, mergeConfig } from 'vite';
|
|
2
|
-
export { aO as UserConfigExport, aN as UserConfigFn, aL as UserConfigFnObject, aM as UserConfigFnPromise, aQ as UserProjectConfigExport, aP as UserProjectConfigFn, K as UserWorkspaceConfig, aV as configDefaults, aY as coverageConfigDefaults, aU as defaultBrowserPort, aX as defaultExclude, aW as defaultInclude, aR as defineConfig, aS as defineProject, aT as defineWorkspace, aZ as extraInlineDeps } from './reporters-
|
|
2
|
+
export { aO as UserConfigExport, aN as UserConfigFn, aL as UserConfigFnObject, aM as UserConfigFnPromise, aQ as UserProjectConfigExport, aP as UserProjectConfigFn, K as UserWorkspaceConfig, aV as configDefaults, aY as coverageConfigDefaults, aU as defaultBrowserPort, aX as defaultExclude, aW as defaultInclude, aR as defineConfig, aS as defineProject, aT as defineWorkspace, aZ as extraInlineDeps } from './reporters-BECoY4-b.js';
|
|
3
|
+
import '@vitest/pretty-format';
|
|
3
4
|
import '@vitest/runner';
|
|
4
5
|
import 'vite-node';
|
|
5
6
|
import '@vitest/snapshot';
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-
|
|
1
|
+
import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-BECoY4-b.js';
|
|
2
2
|
import 'vite';
|
|
3
|
+
import '@vitest/pretty-format';
|
|
3
4
|
import '@vitest/runner';
|
|
4
5
|
import 'vite-node';
|
|
5
6
|
import '@vitest/snapshot';
|
package/dist/environments.d.ts
CHANGED
package/dist/execute.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import vm from 'node:vm';
|
|
2
2
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
3
3
|
import { ViteNodeRunnerOptions } from 'vite-node';
|
|
4
|
-
import { aI as PendingSuiteMock, aJ as MockFactory, e as RuntimeRPC, W as WorkerGlobalState, aK as MockMap } from './reporters-
|
|
4
|
+
import { aI as PendingSuiteMock, aJ as MockFactory, e as RuntimeRPC, W as WorkerGlobalState, aK as MockMap } from './reporters-BECoY4-b.js';
|
|
5
5
|
import 'vite';
|
|
6
|
+
import '@vitest/pretty-format';
|
|
6
7
|
import '@vitest/runner';
|
|
7
8
|
import '@vitest/snapshot';
|
|
8
9
|
import '@vitest/expect';
|
|
@@ -143,7 +144,7 @@ declare class VitestExecutor extends ViteNodeRunner {
|
|
|
143
144
|
get state(): WorkerGlobalState;
|
|
144
145
|
shouldResolveId(id: string, _importee?: string | undefined): boolean;
|
|
145
146
|
originalResolveUrl(id: string, importer?: string): Promise<[url: string, fsPath: string]>;
|
|
146
|
-
resolveUrl(id: string, importer?: string): Promise<[string, string]>;
|
|
147
|
+
resolveUrl(id: string, importer?: string): Promise<[url: string, fsPath: string]>;
|
|
147
148
|
protected runModule(context: Record<string, any>, transformed: string): Promise<void>;
|
|
148
149
|
importExternalModule(path: string): Promise<any>;
|
|
149
150
|
dependencyRequest(id: string, fsPath: string, callstack: string[]): Promise<any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TaskPopulated, File, TaskResultPack } from '@vitest/runner';
|
|
2
2
|
export { CancelReason, Custom, DoneCallback, ExtendedContext, File, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, RuntimeContext, SequenceHooks, SequenceSetupFiles, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskContext, TaskCustomOptions, TaskMeta, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
3
|
-
export { b as bench } from './suite-
|
|
3
|
+
export { b as bench } from './suite-BWgaIsVn.js';
|
|
4
4
|
import { ExpectStatic } from '@vitest/expect';
|
|
5
5
|
export { Assertion, AsymmetricMatchersContaining, ExpectPollOptions, ExpectStatic, JestAssertion } from '@vitest/expect';
|
|
6
|
-
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, h as RuntimeConfig, i as ProvidedContext, R as ResolvedConfig, j as ModuleGraphData, k as Reporter, l as BirpcReturn } from './reporters-
|
|
7
|
-
export { Y as AfterSuiteRunMeta, A as ApiConfig, a1 as ArgumentsType, a0 as Arrayable, _ as Awaitable, B as BaseCoverageOptions, ah as BenchFunction, af as Benchmark, ai as BenchmarkAPI, ag as BenchmarkResult, ae as BenchmarkUserOptions, G as BrowserConfigOptions, z as BrowserScript, s as BuiltinEnvironment, t as CSSModuleScopeStrategy, n as CollectLineNumbers, o as CollectLines, a3 as Constructable, q as Context, f as ContextRPC, N as ContextTestEnvironment, ab as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, aa as CoverageReporter, ac as CoverageV8Options, ad as CustomProviderOptions, D as DepsOptimizationOptions, E as Environment, u as EnvironmentOptions, a5 as EnvironmentReturn, H as HappyDOMOptions, I as InlineConfig, J as JSDOMOptions, a4 as ModuleCache, a2 as MutableArray, $ as Nullable, a8 as OnServerRestartHandler, P as Pool, r as PoolOptions, y as ProjectConfig, m as RawErrsMap, a9 as ReportContext, X as ResolveIdFunction, a as ResolvedCoverageOptions, O as ResolvedTestEnvironment, p as RootAndTarget, L as RunnerRPC, e as RuntimeRPC, S as SerializableSpec, w as TransformModePatterns, T as TscErrorInfo, x as TypecheckConfig, U as UserConfig, a7 as UserConsoleLog, K as UserWorkspaceConfig, Q as Vitest, V as VitestEnvironment, v as VitestRunMode, a6 as VmEnvironmentReturn, g as WorkerContext, W as WorkerGlobalState, Z as WorkerRPC } from './reporters-
|
|
6
|
+
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, h as RuntimeConfig, i as ProvidedContext, R as ResolvedConfig, j as ModuleGraphData, k as Reporter, l as BirpcReturn } from './reporters-BECoY4-b.js';
|
|
7
|
+
export { Y as AfterSuiteRunMeta, A as ApiConfig, a1 as ArgumentsType, a0 as Arrayable, _ as Awaitable, B as BaseCoverageOptions, ah as BenchFunction, af as Benchmark, ai as BenchmarkAPI, ag as BenchmarkResult, ae as BenchmarkUserOptions, G as BrowserConfigOptions, z as BrowserScript, s as BuiltinEnvironment, t as CSSModuleScopeStrategy, n as CollectLineNumbers, o as CollectLines, a3 as Constructable, q as Context, f as ContextRPC, N as ContextTestEnvironment, ab as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, aa as CoverageReporter, ac as CoverageV8Options, ad as CustomProviderOptions, D as DepsOptimizationOptions, E as Environment, u as EnvironmentOptions, a5 as EnvironmentReturn, H as HappyDOMOptions, I as InlineConfig, J as JSDOMOptions, a4 as ModuleCache, a2 as MutableArray, $ as Nullable, a8 as OnServerRestartHandler, P as Pool, r as PoolOptions, y as ProjectConfig, m as RawErrsMap, a9 as ReportContext, X as ResolveIdFunction, a as ResolvedCoverageOptions, O as ResolvedTestEnvironment, p as RootAndTarget, L as RunnerRPC, e as RuntimeRPC, S as SerializableSpec, w as TransformModePatterns, T as TscErrorInfo, x as TypecheckConfig, U as UserConfig, a7 as UserConsoleLog, K as UserWorkspaceConfig, Q as Vitest, V as VitestEnvironment, v as VitestRunMode, a6 as VmEnvironmentReturn, g as WorkerContext, W as WorkerGlobalState, Z as WorkerRPC } from './reporters-BECoY4-b.js';
|
|
8
8
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
9
9
|
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
10
10
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
@@ -16,6 +16,7 @@ export { assert, should } from 'chai';
|
|
|
16
16
|
export { ErrorWithDiff, ParsedStack } from '@vitest/utils';
|
|
17
17
|
export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';
|
|
18
18
|
import '@vitest/runner/utils';
|
|
19
|
+
import '@vitest/pretty-format';
|
|
19
20
|
import 'vite-node';
|
|
20
21
|
import 'node:stream';
|
|
21
22
|
import 'vite-node/client';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { v as VitestRunMode, U as UserConfig, aj as VitestOptions, Q as Vitest, R as ResolvedConfig, i as ProvidedContext, ak as WorkspaceProject, e as RuntimeRPC, A as ApiConfig, al as Logger, am as TestSequencer, an as WorkspaceSpec } from './reporters-
|
|
2
|
-
export { ay as BrowserBuiltinProvider, az as BrowserCommand, aA as BrowserCommandContext, aE as BrowserOrchestrator, at as BrowserProvider, as as BrowserProviderInitializationOptions, av as BrowserProviderModule, ax as BrowserProviderOptions, z as BrowserScript, aB as BrowserServer, aC as BrowserServerState, aD as BrowserServerStateContext, au as CDPSession, aH as HTMLOptions, aG as JUnitOptions, aF as JsonOptions, ao as ProcessPool, aw as ResolvedBrowserOptions, ar as TestSequencerConstructor, aq as VitestPackageInstaller, ap as getFilePoolName } from './reporters-
|
|
1
|
+
import { v as VitestRunMode, U as UserConfig, aj as VitestOptions, Q as Vitest, R as ResolvedConfig, i as ProvidedContext, ak as WorkspaceProject, e as RuntimeRPC, A as ApiConfig, al as Logger, am as TestSequencer, an as WorkspaceSpec } from './reporters-BECoY4-b.js';
|
|
2
|
+
export { ay as BrowserBuiltinProvider, az as BrowserCommand, aA as BrowserCommandContext, aE as BrowserOrchestrator, at as BrowserProvider, as as BrowserProviderInitializationOptions, av as BrowserProviderModule, ax as BrowserProviderOptions, z as BrowserScript, aB as BrowserServer, aC as BrowserServerState, aD as BrowserServerStateContext, au as CDPSession, aH as HTMLOptions, aG as JUnitOptions, aF as JsonOptions, ao as ProcessPool, aw as ResolvedBrowserOptions, ar as TestSequencerConstructor, aq as VitestPackageInstaller, ap as getFilePoolName } from './reporters-BECoY4-b.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1 } from 'vite';
|
|
4
4
|
import * as vite from 'vite';
|
|
5
5
|
export { vite as Vite };
|
|
6
6
|
export { createServer, isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
7
7
|
import { Writable } from 'node:stream';
|
|
8
8
|
import createDebug from 'debug';
|
|
9
|
+
import '@vitest/pretty-format';
|
|
9
10
|
import '@vitest/runner';
|
|
10
11
|
import 'vite-node';
|
|
11
12
|
import '@vitest/snapshot';
|
package/dist/node.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, g as getFilePoolName, r as registerConsoleShortcuts, e as resolveApiServerConfig, f as resolveConfig, d as resolveFsAllow, s as startVitest } from './vendor/cli-api.
|
|
2
|
-
export { p as parseCLI } from './vendor/cac.
|
|
1
|
+
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, g as getFilePoolName, r as registerConsoleShortcuts, e as resolveApiServerConfig, f as resolveConfig, d as resolveFsAllow, s as startVitest } from './vendor/cli-api.FtQZKvQk.js';
|
|
2
|
+
export { p as parseCLI } from './vendor/cac.C2zVnLp0.js';
|
|
3
3
|
import createDebug from 'debug';
|
|
4
4
|
export { distDir, rootDir } from './path.js';
|
|
5
|
-
export { e as BaseSequencer } from './vendor/index.
|
|
5
|
+
export { e as BaseSequencer } from './vendor/index.BCwvoAaf.js';
|
|
6
6
|
export { createServer, isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'pathe';
|
|
@@ -51,17 +51,17 @@ import 'node:fs/promises';
|
|
|
51
51
|
import 'node:module';
|
|
52
52
|
import 'node:assert';
|
|
53
53
|
import 'node:util';
|
|
54
|
-
import '
|
|
54
|
+
import 'tinyrainbow';
|
|
55
55
|
import 'vite-node/utils';
|
|
56
56
|
import 'magic-string';
|
|
57
57
|
import '@vitest/utils/ast';
|
|
58
58
|
import './vendor/index.BJmtb_7W.js';
|
|
59
59
|
import './vendor/global.7bFbnyXl.js';
|
|
60
60
|
import 'node:readline';
|
|
61
|
-
import './vendor/utils.
|
|
61
|
+
import './vendor/utils.DyTe1Nxn.js';
|
|
62
62
|
import './vendor/tasks.DhVtQBtW.js';
|
|
63
63
|
import 'node:perf_hooks';
|
|
64
|
-
import './chunks/runtime-console.
|
|
64
|
+
import './chunks/runtime-console.C2L2zykk.js';
|
|
65
65
|
import 'node:stream';
|
|
66
66
|
import './vendor/date.W2xKR2qe.js';
|
|
67
67
|
import 'execa';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, ConfigEnv, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
|
|
3
|
+
import { PrettyFormatOptions, Plugin } from '@vitest/pretty-format';
|
|
3
4
|
import * as _vitest_runner from '@vitest/runner';
|
|
4
|
-
import { File, Test
|
|
5
|
+
import { File, Test, Suite, TaskResultPack, Task, CancelReason, TaskMeta, Custom, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
5
6
|
import { RawSourceMap, FetchResult, ViteNodeResolveId, ModuleCacheMap, ViteNodeServerOptions } from 'vite-node';
|
|
6
7
|
import { SnapshotSummary, SnapshotResult, SnapshotStateOptions, SnapshotState } from '@vitest/snapshot';
|
|
7
8
|
import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect';
|
|
@@ -17,279 +18,6 @@ import { StackTraceParserOptions } from '@vitest/utils/source-map';
|
|
|
17
18
|
import { Stats } from 'node:fs';
|
|
18
19
|
import * as chai from 'chai';
|
|
19
20
|
|
|
20
|
-
declare const Modifier: unique symbol;
|
|
21
|
-
declare const Hint: unique symbol;
|
|
22
|
-
declare const Kind: unique symbol;
|
|
23
|
-
type Evaluate<T> = T extends infer O ? {
|
|
24
|
-
[K in keyof O]: O[K];
|
|
25
|
-
} : never;
|
|
26
|
-
type TReadonly<T extends TSchema> = T & {
|
|
27
|
-
[Modifier]: 'Readonly';
|
|
28
|
-
};
|
|
29
|
-
type TOptional<T extends TSchema> = T & {
|
|
30
|
-
[Modifier]: 'Optional';
|
|
31
|
-
};
|
|
32
|
-
type TReadonlyOptional<T extends TSchema> = T & {
|
|
33
|
-
[Modifier]: 'ReadonlyOptional';
|
|
34
|
-
};
|
|
35
|
-
interface SchemaOptions {
|
|
36
|
-
$schema?: string;
|
|
37
|
-
/** Id for this schema */
|
|
38
|
-
$id?: string;
|
|
39
|
-
/** Title of this schema */
|
|
40
|
-
title?: string;
|
|
41
|
-
/** Description of this schema */
|
|
42
|
-
description?: string;
|
|
43
|
-
/** Default value for this schema */
|
|
44
|
-
default?: any;
|
|
45
|
-
/** Example values matching this schema */
|
|
46
|
-
examples?: any;
|
|
47
|
-
[prop: string]: any;
|
|
48
|
-
}
|
|
49
|
-
interface TKind {
|
|
50
|
-
[Kind]: string;
|
|
51
|
-
}
|
|
52
|
-
interface TSchema extends SchemaOptions, TKind {
|
|
53
|
-
[Modifier]?: string;
|
|
54
|
-
[Hint]?: string;
|
|
55
|
-
params: unknown[];
|
|
56
|
-
static: unknown;
|
|
57
|
-
}
|
|
58
|
-
interface NumericOptions<N extends number | bigint> extends SchemaOptions {
|
|
59
|
-
exclusiveMaximum?: N;
|
|
60
|
-
exclusiveMinimum?: N;
|
|
61
|
-
maximum?: N;
|
|
62
|
-
minimum?: N;
|
|
63
|
-
multipleOf?: N;
|
|
64
|
-
}
|
|
65
|
-
interface TBoolean extends TSchema {
|
|
66
|
-
[Kind]: 'Boolean';
|
|
67
|
-
static: boolean;
|
|
68
|
-
type: 'boolean';
|
|
69
|
-
}
|
|
70
|
-
interface TNull extends TSchema {
|
|
71
|
-
[Kind]: 'Null';
|
|
72
|
-
static: null;
|
|
73
|
-
type: 'null';
|
|
74
|
-
}
|
|
75
|
-
interface TNumber extends TSchema, NumericOptions<number> {
|
|
76
|
-
[Kind]: 'Number';
|
|
77
|
-
static: number;
|
|
78
|
-
type: 'number';
|
|
79
|
-
}
|
|
80
|
-
type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
|
|
81
|
-
[K in keyof T]: T[K] extends TReadonlyOptional<TSchema> ? K : never;
|
|
82
|
-
}[keyof T];
|
|
83
|
-
type ReadonlyPropertyKeys<T extends TProperties> = {
|
|
84
|
-
[K in keyof T]: T[K] extends TReadonly<TSchema> ? K : never;
|
|
85
|
-
}[keyof T];
|
|
86
|
-
type OptionalPropertyKeys<T extends TProperties> = {
|
|
87
|
-
[K in keyof T]: T[K] extends TOptional<TSchema> ? K : never;
|
|
88
|
-
}[keyof T];
|
|
89
|
-
type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
|
|
90
|
-
type PropertiesReducer<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
|
|
91
|
-
type PropertiesReduce<T extends TProperties, P extends unknown[]> = PropertiesReducer<T, {
|
|
92
|
-
[K in keyof T]: Static<T[K], P>;
|
|
93
|
-
}>;
|
|
94
|
-
type TProperties = Record<keyof any, TSchema>;
|
|
95
|
-
type TAdditionalProperties = undefined | TSchema | boolean;
|
|
96
|
-
interface ObjectOptions extends SchemaOptions {
|
|
97
|
-
additionalProperties?: TAdditionalProperties;
|
|
98
|
-
minProperties?: number;
|
|
99
|
-
maxProperties?: number;
|
|
100
|
-
}
|
|
101
|
-
interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
|
|
102
|
-
[Kind]: 'Object';
|
|
103
|
-
static: PropertiesReduce<T, this['params']>;
|
|
104
|
-
additionalProperties?: TAdditionalProperties;
|
|
105
|
-
type: 'object';
|
|
106
|
-
properties: T;
|
|
107
|
-
required?: string[];
|
|
108
|
-
}
|
|
109
|
-
interface StringOptions<Format extends string> extends SchemaOptions {
|
|
110
|
-
minLength?: number;
|
|
111
|
-
maxLength?: number;
|
|
112
|
-
pattern?: string;
|
|
113
|
-
format?: Format;
|
|
114
|
-
contentEncoding?: '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64';
|
|
115
|
-
contentMediaType?: string;
|
|
116
|
-
}
|
|
117
|
-
interface TString<Format extends string = string> extends TSchema, StringOptions<Format> {
|
|
118
|
-
[Kind]: 'String';
|
|
119
|
-
static: string;
|
|
120
|
-
type: 'string';
|
|
121
|
-
}
|
|
122
|
-
/** Creates a TypeScript static type from a TypeBox type */
|
|
123
|
-
type Static<T extends TSchema, P extends unknown[] = []> = (T & {
|
|
124
|
-
params: P;
|
|
125
|
-
})['static'];
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the MIT license found in the
|
|
131
|
-
* LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
declare const RawSnapshotFormat: TObject<{
|
|
136
|
-
callToJSON: TReadonlyOptional<TBoolean>;
|
|
137
|
-
compareKeys: TReadonlyOptional<TNull>;
|
|
138
|
-
escapeRegex: TReadonlyOptional<TBoolean>;
|
|
139
|
-
escapeString: TReadonlyOptional<TBoolean>;
|
|
140
|
-
highlight: TReadonlyOptional<TBoolean>;
|
|
141
|
-
indent: TReadonlyOptional<TNumber>;
|
|
142
|
-
maxDepth: TReadonlyOptional<TNumber>;
|
|
143
|
-
maxWidth: TReadonlyOptional<TNumber>;
|
|
144
|
-
min: TReadonlyOptional<TBoolean>;
|
|
145
|
-
printBasicPrototype: TReadonlyOptional<TBoolean>;
|
|
146
|
-
printFunctionName: TReadonlyOptional<TBoolean>;
|
|
147
|
-
theme: TReadonlyOptional<
|
|
148
|
-
TObject<{
|
|
149
|
-
comment: TReadonlyOptional<TString<string>>;
|
|
150
|
-
content: TReadonlyOptional<TString<string>>;
|
|
151
|
-
prop: TReadonlyOptional<TString<string>>;
|
|
152
|
-
tag: TReadonlyOptional<TString<string>>;
|
|
153
|
-
value: TReadonlyOptional<TString<string>>;
|
|
154
|
-
}>
|
|
155
|
-
>;
|
|
156
|
-
}>;
|
|
157
|
-
|
|
158
|
-
declare const SnapshotFormat: TObject<{
|
|
159
|
-
callToJSON: TReadonlyOptional<TBoolean>;
|
|
160
|
-
compareKeys: TReadonlyOptional<TNull>;
|
|
161
|
-
escapeRegex: TReadonlyOptional<TBoolean>;
|
|
162
|
-
escapeString: TReadonlyOptional<TBoolean>;
|
|
163
|
-
highlight: TReadonlyOptional<TBoolean>;
|
|
164
|
-
indent: TReadonlyOptional<TNumber>;
|
|
165
|
-
maxDepth: TReadonlyOptional<TNumber>;
|
|
166
|
-
maxWidth: TReadonlyOptional<TNumber>;
|
|
167
|
-
min: TReadonlyOptional<TBoolean>;
|
|
168
|
-
printBasicPrototype: TReadonlyOptional<TBoolean>;
|
|
169
|
-
printFunctionName: TReadonlyOptional<TBoolean>;
|
|
170
|
-
theme: TReadonlyOptional<
|
|
171
|
-
TObject<{
|
|
172
|
-
comment: TReadonlyOptional<TString<string>>;
|
|
173
|
-
content: TReadonlyOptional<TString<string>>;
|
|
174
|
-
prop: TReadonlyOptional<TString<string>>;
|
|
175
|
-
tag: TReadonlyOptional<TString<string>>;
|
|
176
|
-
value: TReadonlyOptional<TString<string>>;
|
|
177
|
-
}>
|
|
178
|
-
>;
|
|
179
|
-
}>;
|
|
180
|
-
|
|
181
|
-
declare type SnapshotFormat = Static<typeof RawSnapshotFormat>;
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
185
|
-
*
|
|
186
|
-
* This source code is licensed under the MIT license found in the
|
|
187
|
-
* LICENSE file in the root directory of this source tree.
|
|
188
|
-
*/
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
declare type Colors = {
|
|
192
|
-
comment: {
|
|
193
|
-
close: string;
|
|
194
|
-
open: string;
|
|
195
|
-
};
|
|
196
|
-
content: {
|
|
197
|
-
close: string;
|
|
198
|
-
open: string;
|
|
199
|
-
};
|
|
200
|
-
prop: {
|
|
201
|
-
close: string;
|
|
202
|
-
open: string;
|
|
203
|
-
};
|
|
204
|
-
tag: {
|
|
205
|
-
close: string;
|
|
206
|
-
open: string;
|
|
207
|
-
};
|
|
208
|
-
value: {
|
|
209
|
-
close: string;
|
|
210
|
-
open: string;
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
declare type CompareKeys =
|
|
215
|
-
| ((a: string, b: string) => number)
|
|
216
|
-
| null
|
|
217
|
-
| undefined;
|
|
218
|
-
|
|
219
|
-
declare type Config = {
|
|
220
|
-
callToJSON: boolean;
|
|
221
|
-
compareKeys: CompareKeys;
|
|
222
|
-
colors: Colors;
|
|
223
|
-
escapeRegex: boolean;
|
|
224
|
-
escapeString: boolean;
|
|
225
|
-
indent: string;
|
|
226
|
-
maxDepth: number;
|
|
227
|
-
maxWidth: number;
|
|
228
|
-
min: boolean;
|
|
229
|
-
plugins: Plugins;
|
|
230
|
-
printBasicPrototype: boolean;
|
|
231
|
-
printFunctionName: boolean;
|
|
232
|
-
spacingInner: string;
|
|
233
|
-
spacingOuter: string;
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
declare type Indent = (arg0: string) => string;
|
|
237
|
-
|
|
238
|
-
declare type NewPlugin = {
|
|
239
|
-
serialize: (
|
|
240
|
-
val: any,
|
|
241
|
-
config: Config,
|
|
242
|
-
indentation: string,
|
|
243
|
-
depth: number,
|
|
244
|
-
refs: Refs,
|
|
245
|
-
printer: Printer,
|
|
246
|
-
) => string;
|
|
247
|
-
test: Test;
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
declare type OldPlugin = {
|
|
251
|
-
print: (
|
|
252
|
-
val: unknown,
|
|
253
|
-
print: Print,
|
|
254
|
-
indent: Indent,
|
|
255
|
-
options: PluginOptions,
|
|
256
|
-
colors: Colors,
|
|
257
|
-
) => string;
|
|
258
|
-
test: Test;
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
declare type Plugin_2 = NewPlugin | OldPlugin;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
declare type PluginOptions = {
|
|
265
|
-
edgeSpacing: string;
|
|
266
|
-
min: boolean;
|
|
267
|
-
spacing: string;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
declare type Plugins = Array<Plugin_2>;
|
|
271
|
-
|
|
272
|
-
declare interface PrettyFormatOptions
|
|
273
|
-
extends Omit<SnapshotFormat, 'compareKeys'> {
|
|
274
|
-
compareKeys?: CompareKeys;
|
|
275
|
-
plugins?: Plugins;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
declare type Print = (arg0: unknown) => string;
|
|
279
|
-
|
|
280
|
-
declare type Printer = (
|
|
281
|
-
val: unknown,
|
|
282
|
-
config: Config,
|
|
283
|
-
indentation: string,
|
|
284
|
-
depth: number,
|
|
285
|
-
refs: Refs,
|
|
286
|
-
hasCalledToJSON?: boolean,
|
|
287
|
-
) => string;
|
|
288
|
-
|
|
289
|
-
declare type Refs = Array<unknown>;
|
|
290
|
-
|
|
291
|
-
declare type Test = (arg0: any) => boolean;
|
|
292
|
-
|
|
293
21
|
/**
|
|
294
22
|
* Names of clock methods that may be faked by install.
|
|
295
23
|
*/
|
|
@@ -548,7 +276,7 @@ interface ParsedFile extends File {
|
|
|
548
276
|
start: number;
|
|
549
277
|
end: number;
|
|
550
278
|
}
|
|
551
|
-
interface ParsedTest extends Test
|
|
279
|
+
interface ParsedTest extends Test {
|
|
552
280
|
start: number;
|
|
553
281
|
end: number;
|
|
554
282
|
}
|
|
@@ -993,6 +721,9 @@ declare class StateManager {
|
|
|
993
721
|
addProcessTimeoutCause(cause: string): void;
|
|
994
722
|
getProcessTimeoutCauses(): string[];
|
|
995
723
|
getPaths(): string[];
|
|
724
|
+
/**
|
|
725
|
+
* Return files that were running or collected.
|
|
726
|
+
*/
|
|
996
727
|
getFiles(keys?: string[]): File[];
|
|
997
728
|
getFilepaths(): string[];
|
|
998
729
|
getFailedFilepaths(): string[];
|
|
@@ -3045,7 +2776,7 @@ declare module '@vitest/expect' {
|
|
|
3045
2776
|
addEqualityTesters: (testers: Array<Tester>) => void;
|
|
3046
2777
|
assertions: (expected: number) => void;
|
|
3047
2778
|
hasAssertions: () => void;
|
|
3048
|
-
addSnapshotSerializer: (plugin:
|
|
2779
|
+
addSnapshotSerializer: (plugin: Plugin) => void;
|
|
3049
2780
|
}
|
|
3050
2781
|
interface Assertion<T> {
|
|
3051
2782
|
matchSnapshot: SnapshotMatcher<T>;
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { b8 as BaseReporter, a$ as BasicReporter, bg as BenchmarkBuiltinReporters, bf as BenchmarkReportsMap, bb as BuiltinReporterOptions, ba as BuiltinReporters, a_ as DefaultReporter, b0 as DotReporter, b7 as GithubActionsReporter, b6 as HangingProcessReporter, b4 as JUnitReporter, bc as JsonAssertionResult, b1 as JsonReporter, bd as JsonTestResult, be as JsonTestResults, k as Reporter, b9 as ReportersMap, b5 as TapFlatReporter, b3 as TapReporter, b2 as VerboseReporter } from './reporters-
|
|
1
|
+
export { b8 as BaseReporter, a$ as BasicReporter, bg as BenchmarkBuiltinReporters, bf as BenchmarkReportsMap, bb as BuiltinReporterOptions, ba as BuiltinReporters, a_ as DefaultReporter, b0 as DotReporter, b7 as GithubActionsReporter, b6 as HangingProcessReporter, b4 as JUnitReporter, bc as JsonAssertionResult, b1 as JsonReporter, bd as JsonTestResult, be as JsonTestResults, k as Reporter, b9 as ReportersMap, b5 as TapFlatReporter, b3 as TapReporter, b2 as VerboseReporter } from './reporters-BECoY4-b.js';
|
|
2
2
|
import 'vite';
|
|
3
|
+
import '@vitest/pretty-format';
|
|
3
4
|
import '@vitest/runner';
|
|
4
5
|
import 'vite-node';
|
|
5
6
|
import '@vitest/snapshot';
|
package/dist/reporters.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { B as BasicReporter, d as BenchmarkReportsMap, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, c as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/index.
|
|
1
|
+
export { B as BasicReporter, d as BenchmarkReportsMap, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, c as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/index.BCwvoAaf.js';
|
|
2
2
|
import 'node:fs';
|
|
3
|
-
import '
|
|
3
|
+
import 'tinyrainbow';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import './vendor/tasks.DhVtQBtW.js';
|
|
6
6
|
import '@vitest/runner/utils';
|
|
7
7
|
import '@vitest/utils';
|
|
8
8
|
import './vendor/env.2ltrQNq0.js';
|
|
9
9
|
import 'std-env';
|
|
10
|
-
import './vendor/utils.
|
|
10
|
+
import './vendor/utils.DyTe1Nxn.js';
|
|
11
11
|
import './vendor/base.CTYV4Gnz.js';
|
|
12
12
|
import 'node:perf_hooks';
|
|
13
13
|
import '@vitest/utils/source-map';
|
|
14
14
|
import './vendor/index.BJmtb_7W.js';
|
|
15
15
|
import './vendor/global.7bFbnyXl.js';
|
|
16
|
-
import './chunks/runtime-console.
|
|
16
|
+
import './chunks/runtime-console.C2L2zykk.js';
|
|
17
17
|
import 'node:stream';
|
|
18
18
|
import 'node:console';
|
|
19
19
|
import 'node:path';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { R as ResolvedConfig, P as Pool } from './reporters-
|
|
1
|
+
import { R as ResolvedConfig, P as Pool } from './reporters-BECoY4-b.js';
|
|
2
2
|
import { VitestRunner, VitestRunnerImportSource, File, Suite, Task, CancelReason, Test, Custom, TaskContext, ExtendedContext } from '@vitest/runner';
|
|
3
3
|
import * as tinybench from 'tinybench';
|
|
4
4
|
import 'vite';
|
|
5
|
+
import '@vitest/pretty-format';
|
|
5
6
|
import 'vite-node';
|
|
6
7
|
import '@vitest/snapshot';
|
|
7
8
|
import '@vitest/expect';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Custom } from '@vitest/runner';
|
|
2
2
|
import '@vitest/runner/utils';
|
|
3
|
-
import { ah as BenchFunction, ai as BenchmarkAPI } from './reporters-
|
|
3
|
+
import { ah as BenchFunction, ai as BenchmarkAPI } from './reporters-BECoY4-b.js';
|
|
4
4
|
import { Options } from 'tinybench';
|
|
5
5
|
|
|
6
6
|
declare function getBenchOptions(key: Custom): Options;
|
package/dist/suite.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
2
2
|
export { createChainable } from '@vitest/runner/utils';
|
|
3
|
-
export { g as getBenchFn, a as getBenchOptions } from './suite-
|
|
4
|
-
import './reporters-
|
|
3
|
+
export { g as getBenchFn, a as getBenchOptions } from './suite-BWgaIsVn.js';
|
|
4
|
+
import './reporters-BECoY4-b.js';
|
|
5
5
|
import 'vite';
|
|
6
|
+
import '@vitest/pretty-format';
|
|
6
7
|
import 'vite-node';
|
|
7
8
|
import '@vitest/snapshot';
|
|
8
9
|
import '@vitest/expect';
|
|
@@ -26,7 +26,7 @@ async function runBaseTests(method, state) {
|
|
|
26
26
|
ctx.files.forEach((i) => state.moduleCache.delete(i));
|
|
27
27
|
const [executor, { run }] = await Promise.all([
|
|
28
28
|
startViteNode({ state, requestStubs: getDefaultRequestStubs() }),
|
|
29
|
-
import('../chunks/runtime-runBaseTests.
|
|
29
|
+
import('../chunks/runtime-runBaseTests.DJ9UidQ0.js')
|
|
30
30
|
]);
|
|
31
31
|
await run(
|
|
32
32
|
method,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalize } from 'pathe';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import c from '
|
|
3
|
+
import c from 'tinyrainbow';
|
|
4
4
|
import { t as toArray } from './base.CTYV4Gnz.js';
|
|
5
5
|
import { d as defaultPort, a as defaultBrowserPort } from './constants.CsnA4eRy.js';
|
|
6
6
|
|
|
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
|
|
|
618
618
|
|
|
619
619
|
const cac = (name = "") => new CAC(name);
|
|
620
620
|
|
|
621
|
-
var version = "2.0.
|
|
621
|
+
var version = "2.0.2";
|
|
622
622
|
|
|
623
623
|
const apiConfig = (port) => ({
|
|
624
624
|
port: {
|
|
@@ -1009,11 +1009,11 @@ const cliOptionsConfig = {
|
|
|
1009
1009
|
description: "Should all test files run in parallel. Use `--no-file-parallelism` to disable (default: `true`)"
|
|
1010
1010
|
},
|
|
1011
1011
|
maxWorkers: {
|
|
1012
|
-
description: "Maximum number of workers to run tests in",
|
|
1012
|
+
description: "Maximum number or percentage of workers to run tests in",
|
|
1013
1013
|
argument: "<workers>"
|
|
1014
1014
|
},
|
|
1015
1015
|
minWorkers: {
|
|
1016
|
-
description: "Minimum number of workers to run tests in",
|
|
1016
|
+
description: "Minimum number or percentage of workers to run tests in",
|
|
1017
1017
|
argument: "<workers>"
|
|
1018
1018
|
},
|
|
1019
1019
|
environment: {
|
|
@@ -1498,13 +1498,13 @@ async function start(mode, cliFilters, options) {
|
|
|
1498
1498
|
} catch {
|
|
1499
1499
|
}
|
|
1500
1500
|
try {
|
|
1501
|
-
const { startVitest } = await import('./cli-api.
|
|
1501
|
+
const { startVitest } = await import('./cli-api.FtQZKvQk.js').then(function (n) { return n.h; });
|
|
1502
1502
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options));
|
|
1503
1503
|
if (!(ctx == null ? void 0 : ctx.shouldKeepServer())) {
|
|
1504
1504
|
await (ctx == null ? void 0 : ctx.exit());
|
|
1505
1505
|
}
|
|
1506
1506
|
} catch (e) {
|
|
1507
|
-
const { divider } = await import('./utils.
|
|
1507
|
+
const { divider } = await import('./utils.DyTe1Nxn.js').then(function (n) { return n.u; });
|
|
1508
1508
|
console.error(`
|
|
1509
1509
|
${c.red(divider(c.bold(c.inverse(" Startup Error "))))}`);
|
|
1510
1510
|
console.error(e);
|
|
@@ -1520,7 +1520,7 @@ async function init(project) {
|
|
|
1520
1520
|
console.error(new Error('Only the "browser" project is supported. Use "vitest init browser" to create a new project.'));
|
|
1521
1521
|
process.exit(1);
|
|
1522
1522
|
}
|
|
1523
|
-
const { create } = await import('../chunks/browser-creator.
|
|
1523
|
+
const { create } = await import('../chunks/browser-creator.CyaOd8pl.js');
|
|
1524
1524
|
await create();
|
|
1525
1525
|
}
|
|
1526
1526
|
async function collect(mode, cliFilters, options) {
|
|
@@ -1529,7 +1529,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1529
1529
|
} catch {
|
|
1530
1530
|
}
|
|
1531
1531
|
try {
|
|
1532
|
-
const { prepareVitest, processCollected } = await import('./cli-api.
|
|
1532
|
+
const { prepareVitest, processCollected } = await import('./cli-api.FtQZKvQk.js').then(function (n) { return n.h; });
|
|
1533
1533
|
const ctx = await prepareVitest(mode, {
|
|
1534
1534
|
...normalizeCliOptions(options),
|
|
1535
1535
|
watch: false,
|
|
@@ -1546,7 +1546,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1546
1546
|
processCollected(ctx, tests, options);
|
|
1547
1547
|
await ctx.close();
|
|
1548
1548
|
} catch (e) {
|
|
1549
|
-
const { divider } = await import('./utils.
|
|
1549
|
+
const { divider } = await import('./utils.DyTe1Nxn.js').then(function (n) { return n.u; });
|
|
1550
1550
|
console.error(`
|
|
1551
1551
|
${c.red(divider(c.bold(c.inverse(" Collect Error "))))}`);
|
|
1552
1552
|
console.error(e);
|
|
@@ -17,14 +17,14 @@ import require$$0$3 from 'fs';
|
|
|
17
17
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
18
18
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
19
19
|
import { ViteNodeServer } from 'vite-node/server';
|
|
20
|
-
import { v as version$1 } from './cac.
|
|
20
|
+
import { v as version$1 } from './cac.C2zVnLp0.js';
|
|
21
21
|
import { hasFailed, createFileTask, getTasks, getTests, getNames } from '@vitest/runner/utils';
|
|
22
22
|
import { n as noop$1, b as isPrimitive, c as groupBy, A as AggregateErrorPonyfill, a as slash$1, t as toArray, d as deepMerge, e as nanoid, w as wildcardPatternToRegExp, f as stdout } from './base.CTYV4Gnz.js';
|
|
23
23
|
import { createDefer, toArray as toArray$1, notNullish } from '@vitest/utils';
|
|
24
24
|
import { b as isWindows } from './env.2ltrQNq0.js';
|
|
25
25
|
import { rootDir, distDir } from '../path.js';
|
|
26
26
|
import { c as createBirpc } from './index.BpSiYbpB.js';
|
|
27
|
-
import { s as stringify, p as parse$3, w as wrapSerializableConfig, f as Typechecker, R as ReportersMap, d as BenchmarkReportsMap, g as RandomSequencer, e as BaseSequencer, h as findNodeAround, i as generateCodeFrame, j as highlightCode, L as Logger, k as BlobReporter, r as readBlobs } from './index.
|
|
27
|
+
import { s as stringify, p as parse$3, w as wrapSerializableConfig, f as Typechecker, R as ReportersMap, d as BenchmarkReportsMap, g as RandomSequencer, e as BaseSequencer, h as findNodeAround, i as generateCodeFrame, j as highlightCode, L as Logger, k as BlobReporter, r as readBlobs } from './index.BCwvoAaf.js';
|
|
28
28
|
import require$$0$5 from 'zlib';
|
|
29
29
|
import require$$0$6 from 'buffer';
|
|
30
30
|
import require$$1 from 'crypto';
|
|
@@ -47,14 +47,14 @@ import { builtinModules, createRequire } from 'node:module';
|
|
|
47
47
|
import url, { fileURLToPath as fileURLToPath$1, pathToFileURL as pathToFileURL$1, URL as URL$2 } from 'node:url';
|
|
48
48
|
import assert from 'node:assert';
|
|
49
49
|
import { format as format$2, inspect } from 'node:util';
|
|
50
|
-
import c from '
|
|
50
|
+
import c from 'tinyrainbow';
|
|
51
51
|
import { isCI, provider as provider$1 } from 'std-env';
|
|
52
52
|
import { normalizeRequestId, cleanUrl } from 'vite-node/utils';
|
|
53
53
|
import MagicString from 'magic-string';
|
|
54
54
|
import { esmWalker } from '@vitest/utils/ast';
|
|
55
55
|
import { a as removeUndefinedValues } from './index.BJmtb_7W.js';
|
|
56
56
|
import readline from 'node:readline';
|
|
57
|
-
import { s as stripAnsi } from './utils.
|
|
57
|
+
import { s as stripAnsi } from './utils.DyTe1Nxn.js';
|
|
58
58
|
|
|
59
59
|
async function getModuleGraph(ctx, projectName, id, browser = false) {
|
|
60
60
|
const graph = {};
|
|
@@ -9332,11 +9332,14 @@ class StateManager {
|
|
|
9332
9332
|
getPaths() {
|
|
9333
9333
|
return Array.from(this.pathsSet);
|
|
9334
9334
|
}
|
|
9335
|
+
/**
|
|
9336
|
+
* Return files that were running or collected.
|
|
9337
|
+
*/
|
|
9335
9338
|
getFiles(keys) {
|
|
9336
9339
|
if (keys) {
|
|
9337
|
-
return keys.map((key) => this.filesMap.get(key)).
|
|
9340
|
+
return keys.map((key) => this.filesMap.get(key)).flat().filter((file) => file && !file.local);
|
|
9338
9341
|
}
|
|
9339
|
-
return Array.from(this.filesMap.values()).flat();
|
|
9342
|
+
return Array.from(this.filesMap.values()).flat().filter((file) => !file.local);
|
|
9340
9343
|
}
|
|
9341
9344
|
getFilepaths() {
|
|
9342
9345
|
return Array.from(this.filesMap.keys());
|
|
@@ -9379,6 +9382,7 @@ class StateManager {
|
|
|
9379
9382
|
project.config.root,
|
|
9380
9383
|
project.config.name
|
|
9381
9384
|
);
|
|
9385
|
+
fileTask.local = true;
|
|
9382
9386
|
this.idMap.set(fileTask.id, fileTask);
|
|
9383
9387
|
if (!files) {
|
|
9384
9388
|
this.filesMap.set(path, [fileTask]);
|
|
@@ -14124,7 +14128,7 @@ class WorkspaceProject {
|
|
|
14124
14128
|
...this.config.env
|
|
14125
14129
|
},
|
|
14126
14130
|
browser: {
|
|
14127
|
-
...this.
|
|
14131
|
+
...this.config.browser,
|
|
14128
14132
|
orchestratorScripts: [],
|
|
14129
14133
|
testerScripts: [],
|
|
14130
14134
|
commands: {}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import fs, { existsSync, promises, readFileSync } from 'node:fs';
|
|
2
|
-
import c from '
|
|
2
|
+
import c from 'tinyrainbow';
|
|
3
3
|
import * as pathe from 'pathe';
|
|
4
4
|
import { basename, dirname, resolve, join, relative, extname, normalize } from 'pathe';
|
|
5
5
|
import { g as getTestName, h as hasFailedSnapshot, a as getFullName } from './tasks.DhVtQBtW.js';
|
|
6
6
|
import { getSafeTimers, notNullish, highlight, shuffle, inspect, positionToOffset, lineSplitRE } from '@vitest/utils';
|
|
7
7
|
import { i as isNode, a as isDeno } from './env.2ltrQNq0.js';
|
|
8
|
-
import { g as getStateSymbol, f as formatProjectName, t as taskFail, F as F_RIGHT, a as F_POINTER, r as renderSnapshotSummary, b as getStateString, c as formatTimeString, d as countTestErrors, e as divider, s as stripAnsi, h as getCols, i as getHookStateSymbol } from './utils.
|
|
8
|
+
import { g as getStateSymbol, f as formatProjectName, t as taskFail, F as F_RIGHT, a as F_POINTER, r as renderSnapshotSummary, b as getStateString, c as formatTimeString, d as countTestErrors, e as divider, s as stripAnsi, h as getCols, i as getHookStateSymbol } from './utils.DyTe1Nxn.js';
|
|
9
9
|
import { generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, getTasks, getTests, hasFailed, getSuites } from '@vitest/runner/utils';
|
|
10
10
|
import { performance } from 'node:perf_hooks';
|
|
11
11
|
import { TraceMap, generatedPositionFor, parseStacktrace, parseErrorStacktrace } from '@vitest/utils/source-map';
|
|
12
12
|
import { r as relativePath } from './index.BJmtb_7W.js';
|
|
13
|
-
import { UNKNOWN_TEST_ID } from '../chunks/runtime-console.
|
|
13
|
+
import { UNKNOWN_TEST_ID } from '../chunks/runtime-console.C2L2zykk.js';
|
|
14
14
|
import { t as toArray, b as isPrimitive } from './base.CTYV4Gnz.js';
|
|
15
15
|
import { isCI } from 'std-env';
|
|
16
16
|
import nodeos__default, { hostname } from 'node:os';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import vm, { isContext } from 'node:vm';
|
|
2
2
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
3
3
|
import { dirname, basename, extname, normalize, join, resolve } from 'pathe';
|
|
4
|
-
import { createCustomConsole } from '../chunks/runtime-console.
|
|
4
|
+
import { createCustomConsole } from '../chunks/runtime-console.C2L2zykk.js';
|
|
5
5
|
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.Dx503nGn.js';
|
|
6
6
|
import { distDir } from '../path.js';
|
|
7
7
|
import { dirname as dirname$1 } from 'node:path';
|
package/dist/workers/forks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
2
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../vendor/utils.DkxLWvS1.js';
|
|
3
|
-
import { r as runBaseTests } from '../vendor/base.
|
|
3
|
+
import { r as runBaseTests } from '../vendor/base.pB8aBRcE.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
import 'vite-node/client';
|
|
6
6
|
import '../vendor/global.7bFbnyXl.js';
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { isatty } from 'node:tty';
|
|
2
1
|
import { createRequire } from 'node:module';
|
|
3
2
|
import util from 'node:util';
|
|
4
3
|
import timers from 'node:timers';
|
|
5
4
|
import { performance } from 'node:perf_hooks';
|
|
6
5
|
import { startTests, collectTests } from '@vitest/runner';
|
|
7
|
-
import { setupColors, createColors } from '@vitest/utils';
|
|
8
6
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
9
7
|
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../vendor/index.CROIsoiT.js';
|
|
10
8
|
import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.BhYSDdTT.js';
|
|
@@ -17,6 +15,7 @@ import 'pathe';
|
|
|
17
15
|
import '../path.js';
|
|
18
16
|
import 'node:url';
|
|
19
17
|
import '../vendor/rpc.BGx7q_k2.js';
|
|
18
|
+
import '@vitest/utils';
|
|
20
19
|
import '../vendor/index.BpSiYbpB.js';
|
|
21
20
|
import '../vendor/benchmark.B6pblCp2.js';
|
|
22
21
|
import '@vitest/runner/utils';
|
|
@@ -42,7 +41,6 @@ async function run(method, files, config, executor) {
|
|
|
42
41
|
value: VitestIndex,
|
|
43
42
|
enumerable: false
|
|
44
43
|
});
|
|
45
|
-
setupColors(createColors(isatty(1)));
|
|
46
44
|
if (workerState.environment.transformMode === "web") {
|
|
47
45
|
const _require = createRequire(import.meta.url);
|
|
48
46
|
_require.extensions[".css"] = () => ({});
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as runBaseTests } from '../vendor/base.
|
|
1
|
+
import { r as runBaseTests } from '../vendor/base.pB8aBRcE.js';
|
|
2
2
|
import { a as createThreadsRpcOptions } from '../vendor/utils.DkxLWvS1.js';
|
|
3
3
|
import 'vite-node/client';
|
|
4
4
|
import '../vendor/global.7bFbnyXl.js';
|
package/dist/workers/vmForks.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
2
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../vendor/utils.DkxLWvS1.js';
|
|
3
|
-
import { r as runVmTests } from '../vendor/vm.
|
|
3
|
+
import { r as runVmTests } from '../vendor/vm.D1T5Rxan.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
import 'node:vm';
|
|
6
6
|
import 'node:url';
|
|
7
7
|
import 'pathe';
|
|
8
|
-
import '../chunks/runtime-console.
|
|
8
|
+
import '../chunks/runtime-console.C2L2zykk.js';
|
|
9
9
|
import 'node:stream';
|
|
10
10
|
import 'node:console';
|
|
11
11
|
import 'node:path';
|
|
12
|
+
import 'tinyrainbow';
|
|
12
13
|
import '../vendor/date.W2xKR2qe.js';
|
|
13
14
|
import '@vitest/runner/utils';
|
|
14
15
|
import '../vendor/global.7bFbnyXl.js';
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { a as createThreadsRpcOptions } from '../vendor/utils.DkxLWvS1.js';
|
|
2
|
-
import { r as runVmTests } from '../vendor/vm.
|
|
2
|
+
import { r as runVmTests } from '../vendor/vm.D1T5Rxan.js';
|
|
3
3
|
import '@vitest/utils';
|
|
4
4
|
import 'node:vm';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'pathe';
|
|
7
|
-
import '../chunks/runtime-console.
|
|
7
|
+
import '../chunks/runtime-console.C2L2zykk.js';
|
|
8
8
|
import 'node:stream';
|
|
9
9
|
import 'node:console';
|
|
10
10
|
import 'node:path';
|
|
11
|
+
import 'tinyrainbow';
|
|
11
12
|
import '../vendor/date.W2xKR2qe.js';
|
|
12
13
|
import '@vitest/runner/utils';
|
|
13
14
|
import '../vendor/global.7bFbnyXl.js';
|
package/dist/workers.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as v8 from 'v8';
|
|
2
|
-
import { d as BirpcOptions, e as RuntimeRPC, f as ContextRPC, W as WorkerGlobalState, g as WorkerContext, R as ResolvedConfig } from './reporters-
|
|
2
|
+
import { d as BirpcOptions, e as RuntimeRPC, f as ContextRPC, W as WorkerGlobalState, g as WorkerContext, R as ResolvedConfig } from './reporters-BECoY4-b.js';
|
|
3
3
|
import { Awaitable } from '@vitest/utils';
|
|
4
4
|
import 'vite';
|
|
5
|
+
import '@vitest/pretty-format';
|
|
5
6
|
import '@vitest/runner';
|
|
6
7
|
import 'vite-node';
|
|
7
8
|
import '@vitest/snapshot';
|
package/dist/workers.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './vendor/utils.DkxLWvS1.js';
|
|
2
2
|
export { p as provideWorkerState } from './vendor/global.7bFbnyXl.js';
|
|
3
3
|
export { collect as collectVitestWorkerTests, run as runVitestWorker } from './worker.js';
|
|
4
|
-
export { r as runVmTests } from './vendor/vm.
|
|
5
|
-
export { r as runBaseTests } from './vendor/base.
|
|
4
|
+
export { r as runVmTests } from './vendor/vm.D1T5Rxan.js';
|
|
5
|
+
export { r as runBaseTests } from './vendor/base.pB8aBRcE.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'tinypool';
|
|
@@ -17,9 +17,10 @@ import 'node:module';
|
|
|
17
17
|
import './vendor/rpc.BGx7q_k2.js';
|
|
18
18
|
import './vendor/index.BpSiYbpB.js';
|
|
19
19
|
import 'node:vm';
|
|
20
|
-
import './chunks/runtime-console.
|
|
20
|
+
import './chunks/runtime-console.C2L2zykk.js';
|
|
21
21
|
import 'node:stream';
|
|
22
22
|
import 'node:path';
|
|
23
|
+
import 'tinyrainbow';
|
|
23
24
|
import './vendor/date.W2xKR2qe.js';
|
|
24
25
|
import '@vitest/runner/utils';
|
|
25
26
|
import './vendor/env.2ltrQNq0.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
"@types/node": "^18.0.0 || >=20.0.0",
|
|
120
120
|
"happy-dom": "*",
|
|
121
121
|
"jsdom": "*",
|
|
122
|
-
"@vitest/
|
|
123
|
-
"@vitest/
|
|
122
|
+
"@vitest/ui": "2.0.2",
|
|
123
|
+
"@vitest/browser": "2.0.2"
|
|
124
124
|
},
|
|
125
125
|
"peerDependenciesMeta": {
|
|
126
126
|
"@edge-runtime/vm": {
|
|
@@ -149,18 +149,19 @@
|
|
|
149
149
|
"execa": "^8.0.1",
|
|
150
150
|
"magic-string": "^0.30.10",
|
|
151
151
|
"pathe": "^1.1.2",
|
|
152
|
-
"picocolors": "^1.0.1",
|
|
153
152
|
"std-env": "^3.7.0",
|
|
154
153
|
"tinybench": "^2.8.0",
|
|
155
154
|
"tinypool": "^1.0.0",
|
|
155
|
+
"tinyrainbow": "^1.2.0",
|
|
156
156
|
"vite": "^5.0.0",
|
|
157
157
|
"why-is-node-running": "^2.2.2",
|
|
158
|
-
"@vitest/expect": "2.0.
|
|
159
|
-
"@vitest/
|
|
160
|
-
"@vitest/
|
|
161
|
-
"@vitest/
|
|
162
|
-
"@vitest/
|
|
163
|
-
"
|
|
158
|
+
"@vitest/expect": "2.0.2",
|
|
159
|
+
"@vitest/pretty-format": "^2.0.2",
|
|
160
|
+
"@vitest/runner": "2.0.2",
|
|
161
|
+
"@vitest/spy": "2.0.2",
|
|
162
|
+
"@vitest/snapshot": "2.0.2",
|
|
163
|
+
"@vitest/utils": "2.0.2",
|
|
164
|
+
"vite-node": "2.0.2"
|
|
164
165
|
},
|
|
165
166
|
"devDependencies": {
|
|
166
167
|
"@antfu/install-pkg": "0.3.1",
|