vitest 2.0.0-beta.7 → 2.0.0-beta.9
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 +3 -3
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/coverage.d.ts +1 -1
- package/dist/environments.d.ts +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/{index-DJww03qd.d.ts → index-B0dCycbN.d.ts} +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/node.d.ts +6 -3
- package/dist/node.js +3 -3
- package/dist/{reporters-BUiJebWB.d.ts → reporters-DaDey3o0.d.ts} +4 -3
- package/dist/reporters.d.ts +1 -1
- package/dist/runners.d.ts +1 -1
- package/dist/{suite-BMKo7M1F.d.ts → suite-BHSUxUib.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/vendor/{cac.m8B4jDZA.js → cac.DCg3FnEs.js} +4 -4
- package/dist/vendor/{cli-api.BRiY1IY3.js → cli-api.LMvYagQ5.js} +30 -32
- package/dist/workers.d.ts +1 -1
- package/package.json +10 -10
package/dist/browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { 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-DaDey3o0.js';
|
|
3
3
|
import { VitestExecutor } from './execute.js';
|
|
4
|
-
export { i as Vitest } from './index-
|
|
4
|
+
export { i as Vitest } from './index-B0dCycbN.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import 'vite-node';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -17,7 +17,7 @@ import 'node:worker_threads';
|
|
|
17
17
|
import 'node:fs';
|
|
18
18
|
import 'chai';
|
|
19
19
|
import 'node:vm';
|
|
20
|
-
import './suite-
|
|
20
|
+
import './suite-BHSUxUib.js';
|
|
21
21
|
import '@vitest/spy';
|
|
22
22
|
import '@vitest/utils/diff';
|
|
23
23
|
|
package/dist/cli.js
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ConfigEnv, Plugin, UserConfig, mergeConfig } from 'vite';
|
|
2
|
-
export {
|
|
2
|
+
export { aK as UserConfigExport, aJ as UserConfigFn, aH as UserConfigFnObject, aI as UserConfigFnPromise, aM as UserProjectConfigExport, aL as UserProjectConfigFn, au as UserWorkspaceConfig, aQ as configDefaults, aT as coverageConfigDefaults, aS as defaultExclude, aR as defaultInclude, aN as defineConfig, aO as defineProject, aP as defineWorkspace, aU as extraInlineDeps } from './reporters-DaDey3o0.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
|
5
5
|
import '@vitest/snapshot';
|
package/dist/coverage.d.ts
CHANGED
package/dist/environments.d.ts
CHANGED
package/dist/execute.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import vm from 'node:vm';
|
|
2
2
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
3
3
|
import { ViteNodeRunnerOptions } from 'vite-node';
|
|
4
|
-
import {
|
|
4
|
+
import { aE as PendingSuiteMock, aF as MockFactory, e as RuntimeRPC, W as WorkerGlobalState, aG as MockMap } from './reporters-DaDey3o0.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TaskPopulated, Custom, DoneCallback, ExtendedContext, File, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, RuntimeContext, SequenceHooks, SequenceSetupFiles, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task as Task$1, TaskBase, TaskContext, TaskCustomOptions, TaskMeta, TaskResult as TaskResult$1, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
2
|
-
import { b as bench } from './suite-
|
|
2
|
+
import { b as bench } from './suite-BHSUxUib.js';
|
|
3
3
|
import { ExpectStatic, Assertion, AsymmetricMatchersContaining, JestAssertion } from '@vitest/expect';
|
|
4
|
-
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper,
|
|
4
|
+
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, v as RuntimeConfig, P as ProvidedContext, A as AfterSuiteRunMeta, w as ApiConfig, x as ArgumentsType, y as Arrayable, z as Awaitable, B as BaseCoverageOptions, D as BenchFunction, G as Benchmark, I as BenchmarkAPI, K as BenchmarkResult, L as BenchmarkUserOptions, N as BrowserConfigOptions, s as BrowserScript, O as BuiltinEnvironment, Q as CSSModuleScopeStrategy, S as CollectLineNumbers, X as CollectLines, Y as Constructable, Z as Context, f as ContextRPC, _ as ContextTestEnvironment, $ as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, a0 as CoverageReporter, a1 as CoverageV8Options, a2 as CustomProviderOptions, a3 as DepsOptimizationOptions, E as Environment, a4 as EnvironmentOptions, a5 as EnvironmentReturn, a6 as HappyDOMOptions, a7 as InlineConfig, a8 as JSDOMOptions, a9 as ModuleCache, aa as ModuleGraphData, ab as MutableArray, ac as Nullable, ad as OnServerRestartHandler, ae as Pool, af as PoolOptions, ag as ProjectConfig, ah as RawErrsMap, ai as ReportContext, aj as Reporter, ak as ResolveIdFunction, R as ResolvedConfig, a as ResolvedCoverageOptions, al as ResolvedTestEnvironment, am as RootAndTarget, an as RunnerRPC, e as RuntimeRPC, ao as SerializableSpec, ap as TransformModePatterns, aq as TransformResultWithSource, ar as TscErrorInfo, as as TypecheckConfig, U as UserConfig, at as UserConsoleLog, au as UserWorkspaceConfig, i as Vitest, av as VitestEnvironment, V as VitestRunMode, aw as VmEnvironmentReturn, ax as WebSocketBrowserEvents, ay as WebSocketBrowserHandlers, az as WebSocketBrowserRPC, aA as WebSocketEvents, aB as WebSocketHandlers, aC as WebSocketRPC, g as WorkerContext, W as WorkerGlobalState, aD as WorkerRPC } from './reporters-DaDey3o0.js';
|
|
5
5
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance, Mock, MockContext, Mocked, MockedClass, MockedFunction, MockedObject, SpyInstance } from '@vitest/spy';
|
|
6
6
|
import { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
7
7
|
import { DiffOptions } from '@vitest/utils/diff';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { 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';
|
|
2
|
-
export { b as bench } from './suite-
|
|
3
|
-
export { A as AssertType, B as BrowserUI, E as ExpectTypeOf, V as VitestUtils, j as assertType, c as createExpect, g as expect, h as expectTypeOf, e as getRunningMode, b as inject, a as isFirstRun, f as isWatchMode, r as runOnce, d as vi, v as vitest } from './index-
|
|
4
|
-
export { A as AfterSuiteRunMeta,
|
|
2
|
+
export { b as bench } from './suite-BHSUxUib.js';
|
|
3
|
+
export { A as AssertType, B as BrowserUI, E as ExpectTypeOf, V as VitestUtils, j as assertType, c as createExpect, g as expect, h as expectTypeOf, e as getRunningMode, b as inject, a as isFirstRun, f as isWatchMode, r as runOnce, d as vi, v as vitest } from './index-B0dCycbN.js';
|
|
4
|
+
export { A as AfterSuiteRunMeta, w as ApiConfig, x as ArgumentsType, y as Arrayable, z as Awaitable, B as BaseCoverageOptions, D as BenchFunction, G as Benchmark, I as BenchmarkAPI, K as BenchmarkResult, L as BenchmarkUserOptions, N as BrowserConfigOptions, s as BrowserScript, O as BuiltinEnvironment, Q as CSSModuleScopeStrategy, S as CollectLineNumbers, X as CollectLines, Y as Constructable, Z as Context, f as ContextRPC, _ as ContextTestEnvironment, $ as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, a0 as CoverageReporter, a1 as CoverageV8Options, a2 as CustomProviderOptions, a3 as DepsOptimizationOptions, E as Environment, a4 as EnvironmentOptions, a5 as EnvironmentReturn, a6 as HappyDOMOptions, a7 as InlineConfig, a8 as JSDOMOptions, a9 as ModuleCache, aa as ModuleGraphData, ab as MutableArray, ac as Nullable, ad as OnServerRestartHandler, ae as Pool, af as PoolOptions, ag as ProjectConfig, P as ProvidedContext, ah as RawErrsMap, ai as ReportContext, aj as Reporter, ak as ResolveIdFunction, R as ResolvedConfig, a as ResolvedCoverageOptions, al as ResolvedTestEnvironment, am as RootAndTarget, an as RunnerRPC, v as RuntimeConfig, e as RuntimeRPC, ao as SerializableSpec, ap as TransformModePatterns, aq as TransformResultWithSource, ar as TscErrorInfo, as as TypecheckConfig, U as UserConfig, at as UserConsoleLog, au as UserWorkspaceConfig, i as Vitest, av as VitestEnvironment, V as VitestRunMode, aw as VmEnvironmentReturn, ax as WebSocketBrowserEvents, ay as WebSocketBrowserHandlers, az as WebSocketBrowserRPC, aA as WebSocketEvents, aB as WebSocketHandlers, aC as WebSocketRPC, g as WorkerContext, W as WorkerGlobalState, aD as WorkerRPC } from './reporters-DaDey3o0.js';
|
|
5
5
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
6
6
|
export { DiffOptions } from '@vitest/utils/diff';
|
|
7
7
|
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject, SpyInstance } from '@vitest/spy';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VitestRunMode, U as UserConfig, h as VitestOptions, i as Vitest, R as ResolvedConfig, P as ProvidedContext, j as WorkspaceProject, e as RuntimeRPC, T as TestSequencer, k as WorkspaceSpec } from './reporters-
|
|
2
|
-
export {
|
|
1
|
+
import { V as VitestRunMode, U as UserConfig, h as VitestOptions, i as Vitest, R as ResolvedConfig, P as ProvidedContext, j as WorkspaceProject, e as RuntimeRPC, T as TestSequencer, k as WorkspaceSpec } from './reporters-DaDey3o0.js';
|
|
2
|
+
export { t as BrowserCommand, q as BrowserProvider, p as BrowserProviderInitializationOptions, r as BrowserProviderOptions, s as BrowserScript, H as HTMLOptions, u as JUnitOptions, J as JsonOptions, l as ProcessPool, o as TestSequencerConstructor, n as VitestPackageInstaller, m as getFilePoolName } from './reporters-DaDey3o0.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin } from 'vite';
|
|
4
4
|
export { isFileServingAllowed } from 'vite';
|
|
5
5
|
import { Writable } from 'node:stream';
|
|
@@ -55,6 +55,9 @@ interface GlobalSetupContext {
|
|
|
55
55
|
|
|
56
56
|
declare function createMethodsRPC(project: WorkspaceProject): RuntimeRPC;
|
|
57
57
|
|
|
58
|
+
declare const rootDir: string;
|
|
59
|
+
declare const distDir: string;
|
|
60
|
+
|
|
58
61
|
declare class BaseSequencer implements TestSequencer {
|
|
59
62
|
protected ctx: Vitest;
|
|
60
63
|
constructor(ctx: Vitest);
|
|
@@ -62,4 +65,4 @@ declare class BaseSequencer implements TestSequencer {
|
|
|
62
65
|
sort(files: WorkspaceSpec[]): Promise<WorkspaceSpec[]>;
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
export { BaseSequencer, type GlobalSetupContext, TestSequencer, Vitest, VitestPlugin, WorkspaceProject, WorkspaceSpec, createMethodsRPC, createVitest, parseCLI, registerConsoleShortcuts, startVitest };
|
|
68
|
+
export { BaseSequencer, type GlobalSetupContext, TestSequencer, Vitest, VitestPlugin, WorkspaceProject, WorkspaceSpec, createMethodsRPC, createVitest, distDir, parseCLI, registerConsoleShortcuts, rootDir, startVitest };
|
package/dist/node.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor/cli-api.
|
|
2
|
-
export { p as parseCLI } from './vendor/cac.
|
|
1
|
+
export { b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, g as getFilePoolName, r as registerConsoleShortcuts, s as startVitest } from './vendor/cli-api.LMvYagQ5.js';
|
|
2
|
+
export { p as parseCLI } from './vendor/cac.DCg3FnEs.js';
|
|
3
|
+
export { distDir, rootDir } from './path.js';
|
|
3
4
|
export { B as BaseSequencer } from './vendor/index.TBU3GqRP.js';
|
|
4
5
|
export { isFileServingAllowed } from 'vite';
|
|
5
6
|
import 'pathe';
|
|
@@ -29,7 +30,6 @@ import './vendor/base._gnK9Slw.js';
|
|
|
29
30
|
import '@vitest/utils';
|
|
30
31
|
import './vendor/env.bmJgw1qP.js';
|
|
31
32
|
import 'std-env';
|
|
32
|
-
import './path.js';
|
|
33
33
|
import './vendor/index.BpSiYbpB.js';
|
|
34
34
|
import 'zlib';
|
|
35
35
|
import 'buffer';
|
|
@@ -728,7 +728,7 @@ interface BrowserConfigOptions {
|
|
|
728
728
|
/**
|
|
729
729
|
* Scripts injected into the main window.
|
|
730
730
|
*/
|
|
731
|
-
|
|
731
|
+
orchestratorScripts?: BrowserScript[];
|
|
732
732
|
/**
|
|
733
733
|
* Commands that will be executed on the server
|
|
734
734
|
* via the browser `import("@vitest/browser/context").commands` API.
|
|
@@ -886,7 +886,7 @@ interface WebSocketHandlers {
|
|
|
886
886
|
getPaths: () => string[];
|
|
887
887
|
getConfig: () => ResolvedConfig;
|
|
888
888
|
getModuleGraph: (projectName: string, id: string, browser?: boolean) => Promise<ModuleGraphData>;
|
|
889
|
-
getTransformResult: (id: string) => Promise<TransformResultWithSource | undefined>;
|
|
889
|
+
getTransformResult: (projectName: string, id: string, browser?: boolean) => Promise<TransformResultWithSource | undefined>;
|
|
890
890
|
readTestFile: (id: string) => Promise<string | null>;
|
|
891
891
|
saveTestFile: (id: string, content: string) => Promise<void>;
|
|
892
892
|
rerun: (files: string[]) => Promise<void>;
|
|
@@ -1004,6 +1004,7 @@ interface ProcessPool {
|
|
|
1004
1004
|
runTests: RunWithFiles;
|
|
1005
1005
|
close?: () => Awaitable$1<void>;
|
|
1006
1006
|
}
|
|
1007
|
+
declare function getFilePoolName(project: WorkspaceProject, file: string): Pool;
|
|
1007
1008
|
|
|
1008
1009
|
type Awaitable<T> = T | PromiseLike<T>;
|
|
1009
1010
|
type Nullable<T> = T | null | undefined;
|
|
@@ -3095,4 +3096,4 @@ type Context = RootAndTarget & {
|
|
|
3095
3096
|
lastActivePath?: string;
|
|
3096
3097
|
};
|
|
3097
3098
|
|
|
3098
|
-
export { type
|
|
3099
|
+
export { type CoverageIstanbulOptions as $, type AfterSuiteRunMeta as A, type BaseCoverageOptions as B, type CoverageOptions as C, type BenchFunction as D, type Environment as E, type FakeTimerInstallOpts as F, type Benchmark as G, type HTMLOptions as H, type BenchmarkAPI as I, type JsonOptions$1 as J, type BenchmarkResult as K, type BenchmarkUserOptions as L, type MockFactoryWithHelper as M, type BrowserConfigOptions as N, type BuiltinEnvironment as O, type ProvidedContext as P, type CSSModuleScopeStrategy as Q, type ResolvedConfig as R, type CollectLineNumbers as S, type TestSequencer as T, type UserConfig as U, type VitestRunMode as V, type WorkerGlobalState as W, type CollectLines as X, type Constructable as Y, type Context as Z, type ContextTestEnvironment as _, type ResolvedCoverageOptions as a, JUnitReporter as a$, type CoverageReporter as a0, type CoverageV8Options as a1, type CustomProviderOptions as a2, type DepsOptimizationOptions as a3, type EnvironmentOptions as a4, type EnvironmentReturn as a5, type HappyDOMOptions as a6, type InlineConfig as a7, type JSDOMOptions as a8, type ModuleCache as a9, type WebSocketEvents as aA, type WebSocketHandlers as aB, type WebSocketRPC as aC, type WorkerRPC as aD, type PendingSuiteMock as aE, type MockFactory as aF, type MockMap as aG, type UserConfigFnObject as aH, type UserConfigFnPromise as aI, type UserConfigFn as aJ, type UserConfigExport as aK, type UserProjectConfigFn as aL, type UserProjectConfigExport as aM, defineConfig as aN, defineProject as aO, defineWorkspace as aP, configDefaults as aQ, defaultInclude as aR, defaultExclude as aS, coverageConfigDefaults as aT, extraInlineDeps as aU, DefaultReporter as aV, BasicReporter as aW, DotReporter as aX, JsonReporter as aY, VerboseReporter as aZ, TapReporter as a_, type ModuleGraphData as aa, type MutableArray as ab, type Nullable as ac, type OnServerRestartHandler as ad, type Pool as ae, type PoolOptions as af, type ProjectConfig as ag, type RawErrsMap as ah, type ReportContext as ai, type Reporter as aj, type ResolveIdFunction as ak, type ResolvedTestEnvironment as al, type RootAndTarget as am, type RunnerRPC as an, type SerializableSpec as ao, type TransformModePatterns as ap, type TransformResultWithSource as aq, type TscErrorInfo as ar, type TypecheckConfig as as, type UserConsoleLog as at, type UserWorkspaceConfig as au, type VitestEnvironment as av, type VmEnvironmentReturn as aw, type WebSocketBrowserEvents as ax, type WebSocketBrowserHandlers as ay, type WebSocketBrowserRPC as az, type CoverageProvider as b, TapFlatReporter as b0, HangingProcessReporter as b1, GithubActionsReporter as b2, BaseReporter as b3, ReportersMap as b4, type BuiltinReporters as b5, type BuiltinReporterOptions as b6, type JsonAssertionResult as b7, type JsonTestResult as b8, type JsonTestResults as b9, BenchmarkReportsMap as ba, type BenchmarkBuiltinReporters as bb, type CoverageProviderModule as c, type BirpcOptions as d, type RuntimeRPC as e, type ContextRPC as f, type WorkerContext as g, type VitestOptions as h, Vitest as i, WorkspaceProject as j, type WorkspaceSpec as k, type ProcessPool as l, getFilePoolName as m, VitestPackageInstaller as n, type TestSequencerConstructor as o, type BrowserProviderInitializationOptions as p, type BrowserProvider as q, type BrowserProviderOptions as r, type BrowserScript as s, type BrowserCommand as t, type JUnitOptions as u, type RuntimeConfig as v, type ApiConfig as w, type ArgumentsType as x, type Arrayable as y, type Awaitable as z };
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { b3 as BaseReporter, aW as BasicReporter, bb as BenchmarkBuiltinReporters, ba as BenchmarkReportsMap, b6 as BuiltinReporterOptions, b5 as BuiltinReporters, aV as DefaultReporter, aX as DotReporter, b2 as GithubActionsReporter, b1 as HangingProcessReporter, a$ as JUnitReporter, b7 as JsonAssertionResult, aY as JsonReporter, b8 as JsonTestResult, b9 as JsonTestResults, aj as Reporter, b4 as ReportersMap, b0 as TapFlatReporter, a_ as TapReporter, aZ as VerboseReporter } from './reporters-DaDey3o0.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VitestRunner, VitestRunnerImportSource, File, Suite, Task, CancelReason, Test, Custom, TaskContext, ExtendedContext } from '@vitest/runner';
|
|
2
|
-
import { R as ResolvedConfig } from './reporters-
|
|
2
|
+
import { R as ResolvedConfig } from './reporters-DaDey3o0.js';
|
|
3
3
|
import * as tinybench from 'tinybench';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vite-node';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Custom } from '@vitest/runner';
|
|
2
2
|
import '@vitest/runner/utils';
|
|
3
|
-
import {
|
|
3
|
+
import { D as BenchFunction, I as BenchmarkAPI } from './reporters-DaDey3o0.js';
|
|
4
4
|
import { Options } from 'tinybench';
|
|
5
5
|
|
|
6
6
|
declare function getBenchOptions(key: Custom): Options;
|
package/dist/suite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-BHSUxUib.js';
|
|
4
|
+
import './reporters-DaDey3o0.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import 'vite-node';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -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.0-beta.
|
|
621
|
+
var version = "2.0.0-beta.9";
|
|
622
622
|
|
|
623
623
|
const apiConfig = (port) => ({
|
|
624
624
|
port: {
|
|
@@ -942,7 +942,7 @@ const cliOptionsConfig = {
|
|
|
942
942
|
ui: {
|
|
943
943
|
description: "Show Vitest UI when running tests (default: `!process.env.CI`)"
|
|
944
944
|
},
|
|
945
|
-
|
|
945
|
+
orchestratorScripts: null,
|
|
946
946
|
testerScripts: null,
|
|
947
947
|
commands: null,
|
|
948
948
|
viewport: null
|
|
@@ -1043,7 +1043,7 @@ const cliOptionsConfig = {
|
|
|
1043
1043
|
description: "Run files in a random order. Long running tests will not start earlier if you enable this option. (default: `false`)"
|
|
1044
1044
|
},
|
|
1045
1045
|
tests: {
|
|
1046
|
-
description: "Run tests in a random
|
|
1046
|
+
description: "Run tests in a random order (default: `false`)"
|
|
1047
1047
|
}
|
|
1048
1048
|
}
|
|
1049
1049
|
},
|
|
@@ -1448,7 +1448,7 @@ async function start(mode, cliFilters, options) {
|
|
|
1448
1448
|
} catch {
|
|
1449
1449
|
}
|
|
1450
1450
|
try {
|
|
1451
|
-
const { startVitest } = await import('./cli-api.
|
|
1451
|
+
const { startVitest } = await import('./cli-api.LMvYagQ5.js').then(function (n) { return n.d; });
|
|
1452
1452
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options));
|
|
1453
1453
|
if (!(ctx == null ? void 0 : ctx.shouldKeepServer()))
|
|
1454
1454
|
await (ctx == null ? void 0 : ctx.exit());
|
|
@@ -19,7 +19,7 @@ import c from 'picocolors';
|
|
|
19
19
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
20
20
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
21
21
|
import { ViteNodeServer } from 'vite-node/server';
|
|
22
|
-
import { v as version$1 } from './cac.
|
|
22
|
+
import { v as version$1 } from './cac.DCg3FnEs.js';
|
|
23
23
|
import { hasFailed, createFileTask, getTasks, getTests } from '@vitest/runner/utils';
|
|
24
24
|
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._gnK9Slw.js';
|
|
25
25
|
import { createDefer, toArray as toArray$1, notNullish } from '@vitest/utils';
|
|
@@ -7645,8 +7645,9 @@ function setup(ctx, _server) {
|
|
|
7645
7645
|
getConfig() {
|
|
7646
7646
|
return ctx.config;
|
|
7647
7647
|
},
|
|
7648
|
-
async getTransformResult(id) {
|
|
7649
|
-
const
|
|
7648
|
+
async getTransformResult(projectName, id, browser = false) {
|
|
7649
|
+
const project = ctx.getProjectByName(projectName);
|
|
7650
|
+
const result = browser ? await project.browser.transformRequest(id) : await project.vitenode.transformRequest(id);
|
|
7650
7651
|
if (result) {
|
|
7651
7652
|
try {
|
|
7652
7653
|
result.source = result.source || await promises$1.readFile(id, "utf-8");
|
|
@@ -8677,6 +8678,26 @@ function getMemoryLimit(config) {
|
|
|
8677
8678
|
}
|
|
8678
8679
|
|
|
8679
8680
|
const builtinPools = ["forks", "threads", "browser", "vmThreads", "vmForks", "typescript"];
|
|
8681
|
+
function getDefaultPoolName(project, file) {
|
|
8682
|
+
if (project.config.typecheck.enabled) {
|
|
8683
|
+
for (const glob of project.config.typecheck.include) {
|
|
8684
|
+
if (mm.isMatch(file, glob, { cwd: project.config.root }))
|
|
8685
|
+
return "typescript";
|
|
8686
|
+
}
|
|
8687
|
+
}
|
|
8688
|
+
if (project.config.browser.enabled)
|
|
8689
|
+
return "browser";
|
|
8690
|
+
return project.config.pool;
|
|
8691
|
+
}
|
|
8692
|
+
function getFilePoolName(project, file) {
|
|
8693
|
+
for (const [glob, pool] of project.config.poolMatchGlobs) {
|
|
8694
|
+
if (pool === "browser")
|
|
8695
|
+
throw new Error('Since Vitest 0.31.0 "browser" pool is not supported in "poolMatchGlobs". You can create a workspace to run some of your tests in browser in parallel. Read more: https://vitest.dev/guide/workspace');
|
|
8696
|
+
if (mm.isMatch(file, glob, { cwd: project.config.root }))
|
|
8697
|
+
return pool;
|
|
8698
|
+
}
|
|
8699
|
+
return getDefaultPoolName(project, file);
|
|
8700
|
+
}
|
|
8680
8701
|
function createPool(ctx) {
|
|
8681
8702
|
const pools = {
|
|
8682
8703
|
forks: null,
|
|
@@ -8686,26 +8707,6 @@ function createPool(ctx) {
|
|
|
8686
8707
|
vmForks: null,
|
|
8687
8708
|
typescript: null
|
|
8688
8709
|
};
|
|
8689
|
-
function getDefaultPoolName(project, file) {
|
|
8690
|
-
if (project.config.typecheck.enabled) {
|
|
8691
|
-
for (const glob of project.config.typecheck.include) {
|
|
8692
|
-
if (mm.isMatch(file, glob, { cwd: project.config.root }))
|
|
8693
|
-
return "typescript";
|
|
8694
|
-
}
|
|
8695
|
-
}
|
|
8696
|
-
if (project.config.browser.enabled)
|
|
8697
|
-
return "browser";
|
|
8698
|
-
return project.config.pool;
|
|
8699
|
-
}
|
|
8700
|
-
function getPoolName([project, file]) {
|
|
8701
|
-
for (const [glob, pool] of project.config.poolMatchGlobs) {
|
|
8702
|
-
if (pool === "browser")
|
|
8703
|
-
throw new Error('Since Vitest 0.31.0 "browser" pool is not supported in "poolMatchGlobs". You can create a workspace to run some of your tests in browser in parallel. Read more: https://vitest.dev/guide/workspace');
|
|
8704
|
-
if (mm.isMatch(file, glob, { cwd: project.config.root }))
|
|
8705
|
-
return pool;
|
|
8706
|
-
}
|
|
8707
|
-
return getDefaultPoolName(project, file);
|
|
8708
|
-
}
|
|
8709
8710
|
const potentialConditions = /* @__PURE__ */ new Set(["production", "development", ...ctx.server.config.resolve.conditions]);
|
|
8710
8711
|
const conditions = [...potentialConditions].filter((condition) => {
|
|
8711
8712
|
if (condition === "production")
|
|
@@ -8768,7 +8769,7 @@ function createPool(ctx) {
|
|
|
8768
8769
|
typescript: () => createTypecheckPool(ctx)
|
|
8769
8770
|
};
|
|
8770
8771
|
for (const spec of files) {
|
|
8771
|
-
const pool =
|
|
8772
|
+
const pool = getFilePoolName(spec[0], spec[1]);
|
|
8772
8773
|
filesByPool[pool] ?? (filesByPool[pool] = []);
|
|
8773
8774
|
filesByPool[pool].push(spec);
|
|
8774
8775
|
}
|
|
@@ -11697,7 +11698,7 @@ function resolveConfig(mode, options, viteConfig, logger) {
|
|
|
11697
11698
|
(_N = resolved.browser.viewport).width ?? (_N.width = 414);
|
|
11698
11699
|
(_O = resolved.browser.viewport).height ?? (_O.height = 896);
|
|
11699
11700
|
if (resolved.browser.enabled && provider$1 === "stackblitz")
|
|
11700
|
-
resolved.browser.provider = "
|
|
11701
|
+
resolved.browser.provider = "preview";
|
|
11701
11702
|
resolved.browser.api = resolveApiServerConfig(resolved.browser) || {
|
|
11702
11703
|
port: defaultBrowserPort
|
|
11703
11704
|
};
|
|
@@ -12274,7 +12275,8 @@ async function createBrowserServer(project, configFile) {
|
|
|
12274
12275
|
// watch is handled by Vitest
|
|
12275
12276
|
server: {
|
|
12276
12277
|
hmr: false,
|
|
12277
|
-
watch: null
|
|
12278
|
+
watch: null,
|
|
12279
|
+
preTransformRequests: false
|
|
12278
12280
|
},
|
|
12279
12281
|
plugins: [
|
|
12280
12282
|
...((_a = project.options) == null ? void 0 : _a.plugins) || [],
|
|
@@ -12305,10 +12307,6 @@ async function createBrowserServer(project, configFile) {
|
|
|
12305
12307
|
return {
|
|
12306
12308
|
resolve: {
|
|
12307
12309
|
alias: (_c = config.test) == null ? void 0 : _c.alias
|
|
12308
|
-
},
|
|
12309
|
-
server: {
|
|
12310
|
-
watch: null,
|
|
12311
|
-
preTransformRequests: false
|
|
12312
12310
|
}
|
|
12313
12311
|
};
|
|
12314
12312
|
}
|
|
@@ -13503,7 +13501,7 @@ class WorkspaceProject {
|
|
|
13503
13501
|
},
|
|
13504
13502
|
browser: {
|
|
13505
13503
|
...this.ctx.config.browser,
|
|
13506
|
-
|
|
13504
|
+
orchestratorScripts: [],
|
|
13507
13505
|
testerScripts: [],
|
|
13508
13506
|
commands: {}
|
|
13509
13507
|
},
|
|
@@ -21199,4 +21197,4 @@ var cliApi = /*#__PURE__*/Object.freeze({
|
|
|
21199
21197
|
startVitest: startVitest
|
|
21200
21198
|
});
|
|
21201
21199
|
|
|
21202
|
-
export { VitestPlugin as V, createMethodsRPC as a, VitestPackageInstaller as b, createVitest as c, cliApi as d, registerConsoleShortcuts as r, startVitest as s };
|
|
21200
|
+
export { VitestPlugin as V, createMethodsRPC as a, VitestPackageInstaller as b, createVitest as c, cliApi as d, getFilePoolName as g, registerConsoleShortcuts as r, startVitest as s };
|
package/dist/workers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-DaDey3o0.js';
|
|
3
3
|
import { Awaitable } from '@vitest/utils';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import '@vitest/runner';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.9",
|
|
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/browser": "2.0.0-beta.
|
|
123
|
-
"@vitest/ui": "2.0.0-beta.
|
|
122
|
+
"@vitest/browser": "2.0.0-beta.9",
|
|
123
|
+
"@vitest/ui": "2.0.0-beta.9"
|
|
124
124
|
},
|
|
125
125
|
"peerDependenciesMeta": {
|
|
126
126
|
"@edge-runtime/vm": {
|
|
@@ -151,15 +151,15 @@
|
|
|
151
151
|
"picocolors": "^1.0.0",
|
|
152
152
|
"std-env": "^3.7.0",
|
|
153
153
|
"tinybench": "^2.8.0",
|
|
154
|
-
"tinypool": "^0.
|
|
154
|
+
"tinypool": "^1.0.0",
|
|
155
155
|
"vite": "^5.0.0",
|
|
156
156
|
"why-is-node-running": "^2.2.2",
|
|
157
|
-
"@vitest/expect": "2.0.0-beta.
|
|
158
|
-
"@vitest/snapshot": "2.0.0-beta.
|
|
159
|
-
"@vitest/runner": "2.0.0-beta.
|
|
160
|
-
"@vitest/spy": "2.0.0-beta.
|
|
161
|
-
"@vitest/utils": "2.0.0-beta.
|
|
162
|
-
"vite-node": "2.0.0-beta.
|
|
157
|
+
"@vitest/expect": "2.0.0-beta.9",
|
|
158
|
+
"@vitest/snapshot": "2.0.0-beta.9",
|
|
159
|
+
"@vitest/runner": "2.0.0-beta.9",
|
|
160
|
+
"@vitest/spy": "2.0.0-beta.9",
|
|
161
|
+
"@vitest/utils": "2.0.0-beta.9",
|
|
162
|
+
"vite-node": "2.0.0-beta.9"
|
|
163
163
|
},
|
|
164
164
|
"devDependencies": {
|
|
165
165
|
"@ampproject/remapping": "^2.3.0",
|