vitest 2.0.0-beta.10 → 2.0.0-beta.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 +1 -1
- package/dist/browser.js +3 -3
- package/dist/chunks/{integrations-globals.C6Ah-pUW.js → integrations-globals.CC2ed6Py.js} +9 -9
- package/dist/chunks/{node-git.CCI8evVZ.js → node-git.ZtkbKc8u.js} +14 -15
- package/dist/chunks/{runtime-console.DiVMr5d4.js → runtime-console.Ckl0vEQr.js} +25 -10
- package/dist/chunks/{runtime-runBaseTests.Cukyr5-I.js → runtime-runBaseTests.BXW_BJeO.js} +40 -32
- package/dist/cli.js +3 -3
- package/dist/config.cjs +42 -19
- package/dist/config.d.ts +1 -1
- package/dist/config.js +42 -20
- package/dist/coverage.d.ts +4 -4
- package/dist/coverage.js +98 -36
- package/dist/environments.d.ts +1 -1
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/execute.js +2 -2
- package/dist/index.d.ts +34 -8
- package/dist/index.js +9 -9
- package/dist/node.d.ts +19 -6
- package/dist/node.js +24 -16
- package/dist/path.js +4 -1
- package/dist/{reporters-CYVC6LOl.d.ts → reporters-fiIq_dT9.d.ts} +118 -179
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +7 -7
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +98 -60
- package/dist/{suite-Dpu9EC_k.d.ts → suite-D4aoU9rI.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/suite.js +2 -2
- package/dist/utils.d.ts +1 -5
- package/dist/utils.js +1 -6
- package/dist/vendor/{base.Dln9yllP.js → base.C2DbLEfT.js} +4 -3
- package/dist/vendor/{base._gnK9Slw.js → base.CTYV4Gnz.js} +24 -17
- package/dist/vendor/{benchmark.BNLebNi5.js → benchmark.CMp8QfyL.js} +13 -14
- package/dist/vendor/{cac.CtYFkoSJ.js → cac.BcJW7n2j.js} +71 -37
- package/dist/vendor/{cli-api.CUtJc4r3.js → cli-api.C8t8m4__.js} +4012 -4828
- package/dist/vendor/{constants.TCjCaw2D.js → constants.BWsVtsAj.js} +5 -22
- package/dist/vendor/{coverage.ChSqD-qS.js → coverage.BhYSDdTT.js} +27 -11
- package/dist/vendor/{date.BKM1wewY.js → date.W2xKR2qe.js} +5 -3
- package/dist/vendor/{execute.BHj6OMh4.js → execute.T3gg2ZK6.js} +174 -60
- package/dist/vendor/{index.B5SKBLvV.js → index.-dbR4KUi.js} +17 -9
- package/dist/vendor/{index.BOMEjpjj.js → index.BC5zhX9y.js} +960 -469
- package/dist/vendor/{index.CThipSqB.js → index.BMmMjLIQ.js} +2540 -2540
- package/dist/vendor/{index._7XLd8Kd.js → index.C9Thslzw.js} +2 -1
- package/dist/vendor/{index.D3hs2WiI.js → index.CQJ2m700.js} +3 -3
- package/dist/vendor/{index.kpsSqFiz.js → index.D4nqnQWz.js} +69 -73
- package/dist/vendor/{rpc.DRDE9Pu1.js → rpc.BGx7q_k2.js} +30 -19
- package/dist/vendor/{run-once.DLomgGUH.js → run-once.Db8Hgq9X.js} +2 -1
- package/dist/vendor/{setup-common.DAu7t7mY.js → setup-common.uqZOEWuR.js} +30 -15
- package/dist/vendor/{tasks.WC7M-K-v.js → tasks.DhVtQBtW.js} +3 -1
- package/dist/vendor/{utils.YuQ3LT2a.js → utils.DSO2UK15.js} +40 -25
- package/dist/vendor/{utils.CUjzkRH7.js → utils.DkxLWvS1.js} +12 -5
- package/dist/vendor/{vi.hATFzZbX.js → vi.BPjl8cAZ.js} +266 -137
- package/dist/vendor/{vm.Ow-X2mkS.js → vm.CycSoHnJ.js} +151 -86
- package/dist/worker.js +31 -15
- package/dist/workers/forks.js +4 -4
- package/dist/workers/runVmTests.js +14 -13
- package/dist/workers/threads.js +4 -4
- package/dist/workers/vmForks.js +6 -6
- package/dist/workers/vmThreads.js +6 -6
- package/dist/workers.d.ts +2 -2
- package/dist/workers.js +9 -9
- package/package.json +11 -11
- package/suppress-warnings.cjs +1 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import { TransformResult as TransformResult$1,
|
|
2
|
+
import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, ConfigEnv, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
|
|
3
3
|
import * as _vitest_runner from '@vitest/runner';
|
|
4
4
|
import { File, Test as Test$1, Suite, TaskResultPack, CancelReason, Task, TaskMeta, Custom, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
5
|
-
import { RawSourceMap,
|
|
6
|
-
import {
|
|
5
|
+
import { RawSourceMap, FetchResult, ViteNodeResolveId, ModuleCacheMap, ViteNodeServerOptions } from 'vite-node';
|
|
6
|
+
import { SnapshotSummary, SnapshotResult, SnapshotStateOptions, SnapshotState } from '@vitest/snapshot';
|
|
7
7
|
import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect';
|
|
8
8
|
import { ChainableFunction } from '@vitest/runner/utils';
|
|
9
9
|
import { ParsedStack, Awaitable as Awaitable$1, Arrayable as Arrayable$1 } from '@vitest/utils';
|
|
@@ -616,6 +616,7 @@ interface ErrorOptions {
|
|
|
616
616
|
type?: string;
|
|
617
617
|
fullStack?: boolean;
|
|
618
618
|
project?: WorkspaceProject;
|
|
619
|
+
verbose?: boolean;
|
|
619
620
|
}
|
|
620
621
|
declare class Logger {
|
|
621
622
|
ctx: Vitest;
|
|
@@ -659,6 +660,9 @@ interface BrowserProvider {
|
|
|
659
660
|
close: () => Awaitable$1<void>;
|
|
660
661
|
initialize(ctx: WorkspaceProject, options: BrowserProviderInitializationOptions): Awaitable$1<void>;
|
|
661
662
|
}
|
|
663
|
+
interface BrowserProviderModule {
|
|
664
|
+
new (): BrowserProvider;
|
|
665
|
+
}
|
|
662
666
|
interface BrowserProviderOptions {
|
|
663
667
|
}
|
|
664
668
|
interface BrowserConfigOptions {
|
|
@@ -763,6 +767,27 @@ interface BrowserCommandContext {
|
|
|
763
767
|
project: WorkspaceProject;
|
|
764
768
|
contextId: string;
|
|
765
769
|
}
|
|
770
|
+
interface BrowserServerStateContext {
|
|
771
|
+
files: string[];
|
|
772
|
+
resolve: () => void;
|
|
773
|
+
reject: (v: unknown) => void;
|
|
774
|
+
}
|
|
775
|
+
interface BrowserOrchestrator {
|
|
776
|
+
createTesters: (files: string[]) => Promise<void>;
|
|
777
|
+
onCancel: (reason: CancelReason) => Promise<void>;
|
|
778
|
+
}
|
|
779
|
+
interface BrowserServerState {
|
|
780
|
+
orchestrators: Map<string, BrowserOrchestrator>;
|
|
781
|
+
getContext: (contextId: string) => BrowserServerStateContext | undefined;
|
|
782
|
+
createAsyncContext: (contextId: string, files: string[]) => Promise<void>;
|
|
783
|
+
}
|
|
784
|
+
interface BrowserServer {
|
|
785
|
+
vite: ViteDevServer;
|
|
786
|
+
state: BrowserServerState;
|
|
787
|
+
provider: BrowserProvider;
|
|
788
|
+
close: () => Promise<void>;
|
|
789
|
+
initBrowserProvider: () => Promise<void>;
|
|
790
|
+
}
|
|
766
791
|
interface BrowserCommand<Payload extends unknown[]> {
|
|
767
792
|
(context: BrowserCommandContext, ...payload: Payload): Awaitable$1<any>;
|
|
768
793
|
}
|
|
@@ -807,151 +832,6 @@ interface ResolvedBrowserOptions extends BrowserConfigOptions {
|
|
|
807
832
|
};
|
|
808
833
|
}
|
|
809
834
|
|
|
810
|
-
declare class VitestBrowserServerMocker {
|
|
811
|
-
#private;
|
|
812
|
-
mocks: Map<string, {
|
|
813
|
-
sessionId: string;
|
|
814
|
-
mock: string | null | undefined;
|
|
815
|
-
}>;
|
|
816
|
-
constructor(project: WorkspaceProject);
|
|
817
|
-
resolveMock(rawId: string, importer: string, hasFactory: boolean): Promise<{
|
|
818
|
-
type: "factory";
|
|
819
|
-
resolvedId: string;
|
|
820
|
-
mockPath?: undefined;
|
|
821
|
-
} | {
|
|
822
|
-
type: "redirect" | "automock";
|
|
823
|
-
mockPath: string | null;
|
|
824
|
-
resolvedId: string;
|
|
825
|
-
}>;
|
|
826
|
-
private resolveId;
|
|
827
|
-
resolveMockPath(mockPath: string, external: string | null): string | null;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
type ArgumentsType$1<T> = T extends (...args: infer A) => any ? A : never;
|
|
831
|
-
type ReturnType$1<T> = T extends (...args: any) => infer R ? R : never;
|
|
832
|
-
type PromisifyFn<T> = ReturnType$1<T> extends Promise<any> ? T : (...args: ArgumentsType$1<T>) => Promise<Awaited<ReturnType$1<T>>>;
|
|
833
|
-
type BirpcResolver = (name: string, resolved: (...args: unknown[]) => unknown) => ((...args: unknown[]) => unknown) | undefined;
|
|
834
|
-
interface ChannelOptions {
|
|
835
|
-
/**
|
|
836
|
-
* Function to post raw message
|
|
837
|
-
*/
|
|
838
|
-
post: (data: any, ...extras: any[]) => any | Promise<any>;
|
|
839
|
-
/**
|
|
840
|
-
* Listener to receive raw message
|
|
841
|
-
*/
|
|
842
|
-
on: (fn: (data: any, ...extras: any[]) => void) => any | Promise<any>;
|
|
843
|
-
/**
|
|
844
|
-
* Custom function to serialize data
|
|
845
|
-
*
|
|
846
|
-
* by default it passes the data as-is
|
|
847
|
-
*/
|
|
848
|
-
serialize?: (data: any) => any;
|
|
849
|
-
/**
|
|
850
|
-
* Custom function to deserialize data
|
|
851
|
-
*
|
|
852
|
-
* by default it passes the data as-is
|
|
853
|
-
*/
|
|
854
|
-
deserialize?: (data: any) => any;
|
|
855
|
-
}
|
|
856
|
-
interface EventOptions<Remote> {
|
|
857
|
-
/**
|
|
858
|
-
* Names of remote functions that do not need response.
|
|
859
|
-
*/
|
|
860
|
-
eventNames?: (keyof Remote)[];
|
|
861
|
-
/**
|
|
862
|
-
* Maximum timeout for waiting for response, in milliseconds.
|
|
863
|
-
*
|
|
864
|
-
* @default 60_000
|
|
865
|
-
*/
|
|
866
|
-
timeout?: number;
|
|
867
|
-
/**
|
|
868
|
-
* Custom resolver to resolve function to be called
|
|
869
|
-
*
|
|
870
|
-
* For advanced use cases only
|
|
871
|
-
*/
|
|
872
|
-
resolver?: BirpcResolver;
|
|
873
|
-
/**
|
|
874
|
-
* Custom error handler
|
|
875
|
-
*/
|
|
876
|
-
onError?: (error: Error, functionName: string, args: any[]) => boolean | void;
|
|
877
|
-
/**
|
|
878
|
-
* Custom error handler for timeouts
|
|
879
|
-
*/
|
|
880
|
-
onTimeoutError?: (functionName: string, args: any[]) => boolean | void;
|
|
881
|
-
}
|
|
882
|
-
type BirpcOptions<Remote> = EventOptions<Remote> & ChannelOptions;
|
|
883
|
-
type BirpcFn<T> = PromisifyFn<T> & {
|
|
884
|
-
/**
|
|
885
|
-
* Send event without asking for response
|
|
886
|
-
*/
|
|
887
|
-
asEvent: (...args: ArgumentsType$1<T>) => void;
|
|
888
|
-
};
|
|
889
|
-
type BirpcReturn<RemoteFunctions, LocalFunctions = Record<string, never>> = {
|
|
890
|
-
[K in keyof RemoteFunctions]: BirpcFn<RemoteFunctions[K]>;
|
|
891
|
-
} & {
|
|
892
|
-
$functions: LocalFunctions;
|
|
893
|
-
};
|
|
894
|
-
|
|
895
|
-
interface TransformResultWithSource extends TransformResult$1 {
|
|
896
|
-
source?: string;
|
|
897
|
-
}
|
|
898
|
-
interface WebSocketHandlers {
|
|
899
|
-
onCollected: (files?: File[]) => Promise<void>;
|
|
900
|
-
onTaskUpdate: (packs: TaskResultPack[]) => void;
|
|
901
|
-
getFiles: () => File[];
|
|
902
|
-
getTestFiles: () => Promise<[{
|
|
903
|
-
name: string;
|
|
904
|
-
root: string;
|
|
905
|
-
}, file: string][]>;
|
|
906
|
-
getPaths: () => string[];
|
|
907
|
-
getConfig: () => ResolvedConfig;
|
|
908
|
-
getModuleGraph: (projectName: string, id: string, browser?: boolean) => Promise<ModuleGraphData>;
|
|
909
|
-
getTransformResult: (projectName: string, id: string, browser?: boolean) => Promise<TransformResultWithSource | undefined>;
|
|
910
|
-
readTestFile: (id: string) => Promise<string | null>;
|
|
911
|
-
saveTestFile: (id: string, content: string) => Promise<void>;
|
|
912
|
-
rerun: (files: string[]) => Promise<void>;
|
|
913
|
-
updateSnapshot: (file?: File) => Promise<void>;
|
|
914
|
-
getUnhandledErrors: () => unknown[];
|
|
915
|
-
}
|
|
916
|
-
interface WebSocketBrowserHandlers {
|
|
917
|
-
resolveSnapshotPath: (testPath: string) => string;
|
|
918
|
-
resolveSnapshotRawPath: (testPath: string, rawPath: string) => string;
|
|
919
|
-
onUnhandledError: (error: unknown, type: string) => Promise<void>;
|
|
920
|
-
onCollected: (files?: File[]) => Promise<void>;
|
|
921
|
-
onTaskUpdate: (packs: TaskResultPack[]) => void;
|
|
922
|
-
onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void;
|
|
923
|
-
onCancel: (reason: CancelReason) => void;
|
|
924
|
-
getCountOfFailedTests: () => number;
|
|
925
|
-
readSnapshotFile: (id: string) => Promise<string | null>;
|
|
926
|
-
saveSnapshotFile: (id: string, content: string) => Promise<void>;
|
|
927
|
-
removeSnapshotFile: (id: string) => Promise<void>;
|
|
928
|
-
sendLog: (log: UserConsoleLog) => void;
|
|
929
|
-
finishBrowserTests: (contextId: string) => void;
|
|
930
|
-
snapshotSaved: (snapshot: SnapshotResult) => void;
|
|
931
|
-
debug: (...args: string[]) => void;
|
|
932
|
-
resolveId: (id: string, importer?: string) => Promise<ViteNodeResolveId | null>;
|
|
933
|
-
triggerCommand: <T>(contextId: string, command: string, testPath: string | undefined, payload: unknown[]) => Promise<T>;
|
|
934
|
-
resolveMock: (id: string, importer: string, hasFactory: boolean) => Promise<{
|
|
935
|
-
type: 'factory' | 'redirect' | 'automock';
|
|
936
|
-
mockPath?: string | null;
|
|
937
|
-
resolvedId: string;
|
|
938
|
-
}>;
|
|
939
|
-
automock: (id: string) => Promise<string>;
|
|
940
|
-
invalidate: (ids: string[]) => void;
|
|
941
|
-
getBrowserFileSourceMap: (id: string) => Promise<TransformResult$1['map'] | undefined>;
|
|
942
|
-
getProvidedContext: () => ProvidedContext;
|
|
943
|
-
}
|
|
944
|
-
interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onFinished' | 'onTaskUpdate' | 'onUserConsoleLog' | 'onPathsCollected' | 'onSpecsCollected'> {
|
|
945
|
-
onFinishedReportCoverage: () => void;
|
|
946
|
-
}
|
|
947
|
-
interface WebSocketBrowserEvents {
|
|
948
|
-
onCancel: (reason: CancelReason) => void;
|
|
949
|
-
startMocking: (id: string) => Promise<string[]>;
|
|
950
|
-
createTesters: (files: string[]) => Promise<void>;
|
|
951
|
-
}
|
|
952
|
-
type WebSocketRPC = BirpcReturn<WebSocketEvents, WebSocketHandlers>;
|
|
953
|
-
type WebSocketBrowserRPC = BirpcReturn<WebSocketBrowserEvents, WebSocketBrowserHandlers>;
|
|
954
|
-
|
|
955
835
|
interface InitializeProjectOptions extends UserWorkspaceConfig {
|
|
956
836
|
workspaceConfigPath: string;
|
|
957
837
|
extends?: string;
|
|
@@ -965,20 +845,9 @@ declare class WorkspaceProject {
|
|
|
965
845
|
server: ViteDevServer;
|
|
966
846
|
vitenode: ViteNodeServer;
|
|
967
847
|
runner: ViteNodeRunner;
|
|
968
|
-
browser?:
|
|
848
|
+
browser?: BrowserServer;
|
|
969
849
|
typechecker?: Typechecker;
|
|
970
850
|
closingPromise: Promise<unknown> | undefined;
|
|
971
|
-
browserProvider: BrowserProvider | undefined;
|
|
972
|
-
browserMocker: VitestBrowserServerMocker;
|
|
973
|
-
browserRpc: {
|
|
974
|
-
orchestrators: Map<string, WebSocketBrowserRPC>;
|
|
975
|
-
testers: Map<string, WebSocketBrowserRPC>;
|
|
976
|
-
};
|
|
977
|
-
browserState: Map<string, {
|
|
978
|
-
files: string[];
|
|
979
|
-
resolve: () => void;
|
|
980
|
-
reject: (v: unknown) => void;
|
|
981
|
-
}>;
|
|
982
851
|
testFilesList: string[] | null;
|
|
983
852
|
readonly id: string;
|
|
984
853
|
readonly tmpDir: string;
|
|
@@ -1027,7 +896,7 @@ declare function getFilePoolName(project: WorkspaceProject, file: string): Pool;
|
|
|
1027
896
|
type Awaitable<T> = T | PromiseLike<T>;
|
|
1028
897
|
type Nullable<T> = T | null | undefined;
|
|
1029
898
|
type Arrayable<T> = T | Array<T>;
|
|
1030
|
-
type ArgumentsType<T> = T extends (...args: infer U) => any ? U : never;
|
|
899
|
+
type ArgumentsType$1<T> = T extends (...args: infer U) => any ? U : never;
|
|
1031
900
|
type MutableArray<T extends readonly any[]> = {
|
|
1032
901
|
-readonly [k in keyof T]: T[k];
|
|
1033
902
|
};
|
|
@@ -1189,6 +1058,7 @@ declare class Vitest {
|
|
|
1189
1058
|
private _onSetServer;
|
|
1190
1059
|
private _onCancelListeners;
|
|
1191
1060
|
setServer(options: UserConfig, server: ViteDevServer, cliOptions: UserConfig): Promise<void>;
|
|
1061
|
+
provide<T extends keyof ProvidedContext>(key: T, value: ProvidedContext[T]): void;
|
|
1192
1062
|
private createCoreProject;
|
|
1193
1063
|
getCoreWorkspaceProject(): WorkspaceProject;
|
|
1194
1064
|
getProjectByTaskId(taskId: string): WorkspaceProject;
|
|
@@ -1232,7 +1102,7 @@ declare class Vitest {
|
|
|
1232
1102
|
* Close the thread pool and exit the process
|
|
1233
1103
|
*/
|
|
1234
1104
|
exit(force?: boolean): Promise<void>;
|
|
1235
|
-
report<T extends keyof Reporter>(name: T, ...args: ArgumentsType<Reporter[T]>): Promise<void>;
|
|
1105
|
+
report<T extends keyof Reporter>(name: T, ...args: ArgumentsType$1<Reporter[T]>): Promise<void>;
|
|
1236
1106
|
getTestFilepaths(): Promise<string[]>;
|
|
1237
1107
|
globTestFiles(filters?: string[]): Promise<WorkspaceSpec[]>;
|
|
1238
1108
|
shouldKeepServer(): boolean;
|
|
@@ -1327,10 +1197,13 @@ interface Reporter {
|
|
|
1327
1197
|
onProcessTimeout?: () => Awaitable<void>;
|
|
1328
1198
|
}
|
|
1329
1199
|
|
|
1330
|
-
type SerializableSpec = [
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1200
|
+
type SerializableSpec = [
|
|
1201
|
+
project: {
|
|
1202
|
+
name: string | undefined;
|
|
1203
|
+
root: string;
|
|
1204
|
+
},
|
|
1205
|
+
file: string
|
|
1206
|
+
];
|
|
1334
1207
|
|
|
1335
1208
|
interface JUnitOptions {
|
|
1336
1209
|
outputFile?: string;
|
|
@@ -1376,6 +1249,7 @@ declare abstract class BaseReporter implements Reporter {
|
|
|
1376
1249
|
watchFilters?: string[];
|
|
1377
1250
|
isTTY: boolean;
|
|
1378
1251
|
ctx: Vitest;
|
|
1252
|
+
protected verbose: boolean;
|
|
1379
1253
|
private _filesInWatchMode;
|
|
1380
1254
|
private _lastRunTimeout;
|
|
1381
1255
|
private _lastRunTimer;
|
|
@@ -1456,6 +1330,7 @@ declare class DotReporter extends BaseReporter {
|
|
|
1456
1330
|
}
|
|
1457
1331
|
|
|
1458
1332
|
declare class VerboseReporter extends DefaultReporter {
|
|
1333
|
+
protected verbose: boolean;
|
|
1459
1334
|
constructor();
|
|
1460
1335
|
onTaskUpdate(packs: TaskResultPack[]): void;
|
|
1461
1336
|
}
|
|
@@ -1644,6 +1519,71 @@ interface LinkMapper {
|
|
|
1644
1519
|
assetPath(node: Node, name: string): string;
|
|
1645
1520
|
}
|
|
1646
1521
|
|
|
1522
|
+
type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never;
|
|
1523
|
+
type ReturnType$1<T> = T extends (...args: any) => infer R ? R : never;
|
|
1524
|
+
type PromisifyFn<T> = ReturnType$1<T> extends Promise<any> ? T : (...args: ArgumentsType<T>) => Promise<Awaited<ReturnType$1<T>>>;
|
|
1525
|
+
type BirpcResolver = (name: string, resolved: (...args: unknown[]) => unknown) => ((...args: unknown[]) => unknown) | undefined;
|
|
1526
|
+
interface ChannelOptions {
|
|
1527
|
+
/**
|
|
1528
|
+
* Function to post raw message
|
|
1529
|
+
*/
|
|
1530
|
+
post: (data: any, ...extras: any[]) => any | Promise<any>;
|
|
1531
|
+
/**
|
|
1532
|
+
* Listener to receive raw message
|
|
1533
|
+
*/
|
|
1534
|
+
on: (fn: (data: any, ...extras: any[]) => void) => any | Promise<any>;
|
|
1535
|
+
/**
|
|
1536
|
+
* Custom function to serialize data
|
|
1537
|
+
*
|
|
1538
|
+
* by default it passes the data as-is
|
|
1539
|
+
*/
|
|
1540
|
+
serialize?: (data: any) => any;
|
|
1541
|
+
/**
|
|
1542
|
+
* Custom function to deserialize data
|
|
1543
|
+
*
|
|
1544
|
+
* by default it passes the data as-is
|
|
1545
|
+
*/
|
|
1546
|
+
deserialize?: (data: any) => any;
|
|
1547
|
+
}
|
|
1548
|
+
interface EventOptions<Remote> {
|
|
1549
|
+
/**
|
|
1550
|
+
* Names of remote functions that do not need response.
|
|
1551
|
+
*/
|
|
1552
|
+
eventNames?: (keyof Remote)[];
|
|
1553
|
+
/**
|
|
1554
|
+
* Maximum timeout for waiting for response, in milliseconds.
|
|
1555
|
+
*
|
|
1556
|
+
* @default 60_000
|
|
1557
|
+
*/
|
|
1558
|
+
timeout?: number;
|
|
1559
|
+
/**
|
|
1560
|
+
* Custom resolver to resolve function to be called
|
|
1561
|
+
*
|
|
1562
|
+
* For advanced use cases only
|
|
1563
|
+
*/
|
|
1564
|
+
resolver?: BirpcResolver;
|
|
1565
|
+
/**
|
|
1566
|
+
* Custom error handler
|
|
1567
|
+
*/
|
|
1568
|
+
onError?: (error: Error, functionName: string, args: any[]) => boolean | void;
|
|
1569
|
+
/**
|
|
1570
|
+
* Custom error handler for timeouts
|
|
1571
|
+
*/
|
|
1572
|
+
onTimeoutError?: (functionName: string, args: any[]) => boolean | void;
|
|
1573
|
+
}
|
|
1574
|
+
type BirpcOptions<Remote> = EventOptions<Remote> & ChannelOptions;
|
|
1575
|
+
type BirpcFn<T> = PromisifyFn<T> & {
|
|
1576
|
+
/**
|
|
1577
|
+
* Send event without asking for response
|
|
1578
|
+
*/
|
|
1579
|
+
asEvent: (...args: ArgumentsType<T>) => void;
|
|
1580
|
+
};
|
|
1581
|
+
type BirpcReturn<RemoteFunctions, LocalFunctions = Record<string, never>> = {
|
|
1582
|
+
[K in keyof RemoteFunctions]: BirpcFn<RemoteFunctions[K]>;
|
|
1583
|
+
} & {
|
|
1584
|
+
$functions: LocalFunctions;
|
|
1585
|
+
};
|
|
1586
|
+
|
|
1647
1587
|
type MockFactoryWithHelper<M = unknown> = (importOriginal: <T extends M>() => Promise<T>) => any;
|
|
1648
1588
|
type MockFactory = () => any;
|
|
1649
1589
|
type MockMap = Map<string, Record<string, string | null | MockFactory>>;
|
|
@@ -1774,20 +1714,20 @@ interface CoverageProviderModule {
|
|
|
1774
1714
|
type CoverageReporter = keyof ReportOptions | (string & {});
|
|
1775
1715
|
type CoverageReporterWithOptions<ReporterName extends CoverageReporter = CoverageReporter> = ReporterName extends keyof ReportOptions ? ReportOptions[ReporterName] extends never ? [ReporterName, {}] : [ReporterName, Partial<ReportOptions[ReporterName]>] : [ReporterName, Record<string, unknown>];
|
|
1776
1716
|
type Provider = 'v8' | 'istanbul' | 'custom' | undefined;
|
|
1777
|
-
type CoverageOptions<T extends Provider = Provider> = T extends 'istanbul' ?
|
|
1717
|
+
type CoverageOptions<T extends Provider = Provider> = T extends 'istanbul' ? {
|
|
1778
1718
|
provider: T;
|
|
1779
|
-
} & CoverageIstanbulOptions
|
|
1719
|
+
} & CoverageIstanbulOptions : T extends 'v8' ? {
|
|
1780
1720
|
/**
|
|
1781
1721
|
* Provider to use for coverage collection.
|
|
1782
1722
|
*
|
|
1783
1723
|
* @default 'v8'
|
|
1784
1724
|
*/
|
|
1785
1725
|
provider: T;
|
|
1786
|
-
} & CoverageV8Options
|
|
1726
|
+
} & CoverageV8Options : T extends 'custom' ? {
|
|
1787
1727
|
provider: T;
|
|
1788
|
-
} & CustomProviderOptions
|
|
1728
|
+
} & CustomProviderOptions : {
|
|
1789
1729
|
provider?: T;
|
|
1790
|
-
} &
|
|
1730
|
+
} & CoverageV8Options;
|
|
1791
1731
|
/** Fields that have default values. Internally these will always be defined. */
|
|
1792
1732
|
type FieldsWithDefaultValues = 'enabled' | 'clean' | 'cleanOnRerun' | 'reportsDirectory' | 'exclude' | 'extension' | 'reportOnFailure' | 'allowExternal' | 'processingConcurrency';
|
|
1793
1733
|
type ResolvedCoverageOptions<T extends Provider = Provider> = CoverageOptions<T> & Required<Pick<CoverageOptions<T>, FieldsWithDefaultValues>> & {
|
|
@@ -2107,6 +2047,9 @@ type BenchmarkAPI = ChainableBenchmarkAPI & {
|
|
|
2107
2047
|
runIf: (condition: any) => ChainableBenchmarkAPI;
|
|
2108
2048
|
};
|
|
2109
2049
|
|
|
2050
|
+
declare const defaultBrowserPort = 63315;
|
|
2051
|
+
declare const extraInlineDeps: (string | RegExp)[];
|
|
2052
|
+
|
|
2110
2053
|
declare const defaultInclude: string[];
|
|
2111
2054
|
declare const defaultExclude: string[];
|
|
2112
2055
|
declare const coverageConfigDefaults: ResolvedCoverageOptions;
|
|
@@ -2122,8 +2065,6 @@ declare const configDefaults: Readonly<{
|
|
|
2122
2065
|
mockReset: false;
|
|
2123
2066
|
include: string[];
|
|
2124
2067
|
exclude: string[];
|
|
2125
|
-
testTimeout: number;
|
|
2126
|
-
hookTimeout: number;
|
|
2127
2068
|
teardownTimeout: number;
|
|
2128
2069
|
forceRerunTriggers: string[];
|
|
2129
2070
|
update: false;
|
|
@@ -2154,8 +2095,6 @@ declare const configDefaults: Readonly<{
|
|
|
2154
2095
|
disableConsoleIntercept: false;
|
|
2155
2096
|
}>;
|
|
2156
2097
|
|
|
2157
|
-
declare const extraInlineDeps: (string | RegExp)[];
|
|
2158
|
-
|
|
2159
2098
|
interface UserWorkspaceConfig extends UserConfig$1 {
|
|
2160
2099
|
test?: ProjectConfig;
|
|
2161
2100
|
}
|
|
@@ -2171,9 +2110,9 @@ declare function defineConfig(config: Promise<UserConfig$1>): Promise<UserConfig
|
|
|
2171
2110
|
declare function defineConfig(config: UserConfigFnObject): UserConfigFnObject;
|
|
2172
2111
|
declare function defineConfig(config: UserConfigExport): UserConfigExport;
|
|
2173
2112
|
declare function defineProject<T extends UserProjectConfigExport>(config: T): T;
|
|
2174
|
-
type Workspace =
|
|
2113
|
+
type Workspace = string | (UserProjectConfigExport & {
|
|
2175
2114
|
extends?: string;
|
|
2176
|
-
})
|
|
2115
|
+
});
|
|
2177
2116
|
declare function defineWorkspace(config: Workspace[]): Workspace[];
|
|
2178
2117
|
|
|
2179
2118
|
type BuiltinEnvironment = 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime';
|
|
@@ -2644,7 +2583,7 @@ interface InlineConfig {
|
|
|
2644
2583
|
*/
|
|
2645
2584
|
resolveSnapshotPath?: (path: string, extension: string) => string;
|
|
2646
2585
|
/**
|
|
2647
|
-
* Path to a custom snapshot environment module that has a
|
|
2586
|
+
* Path to a custom snapshot environment module that has a default export of `SnapshotEnvironment` object.
|
|
2648
2587
|
*/
|
|
2649
2588
|
snapshotEnvironment?: string;
|
|
2650
2589
|
/**
|
|
@@ -3114,4 +3053,4 @@ type Context = RootAndTarget & {
|
|
|
3114
3053
|
lastActivePath?: string;
|
|
3115
3054
|
};
|
|
3116
3055
|
|
|
3117
|
-
export { type
|
|
3056
|
+
export { type Nullable as $, type ApiConfig as A, type BaseCoverageOptions as B, type CoverageOptions as C, type DepsOptimizationOptions as D, type Environment as E, type FakeTimerInstallOpts as F, type BrowserConfigOptions as G, type HappyDOMOptions as H, type InlineConfig as I, type JSDOMOptions as J, type UserWorkspaceConfig as K, type RunnerRPC as L, type MockFactoryWithHelper as M, type ContextTestEnvironment as N, type ResolvedTestEnvironment as O, type ProvidedContext as P, Vitest as Q, type ResolvedConfig as R, type SerializableSpec as S, type TscErrorInfo as T, type UserConfig as U, type VitestEnvironment as V, type WorkerGlobalState as W, type ResolveIdFunction as X, type AfterSuiteRunMeta as Y, type WorkerRPC as Z, type Awaitable as _, type ResolvedCoverageOptions as a, JsonReporter as a$, type Arrayable as a0, type ArgumentsType$1 as a1, type MutableArray as a2, type Constructable as a3, type ModuleCache as a4, type EnvironmentReturn as a5, type VmEnvironmentReturn as a6, type UserConsoleLog as a7, type OnServerRestartHandler as a8, type ReportContext as a9, type BrowserServerState as aA, type BrowserServerStateContext as aB, type BrowserOrchestrator as aC, type JsonOptions$1 as aD, type JUnitOptions as aE, type HTMLOptions as aF, type PendingSuiteMock as aG, type MockFactory as aH, type MockMap as aI, type UserConfigFnObject as aJ, type UserConfigFnPromise as aK, type UserConfigFn as aL, type UserConfigExport as aM, type UserProjectConfigFn as aN, type UserProjectConfigExport as aO, defineConfig as aP, defineProject as aQ, defineWorkspace as aR, defaultBrowserPort as aS, configDefaults as aT, defaultInclude as aU, defaultExclude as aV, coverageConfigDefaults as aW, extraInlineDeps as aX, DefaultReporter as aY, BasicReporter as aZ, DotReporter as a_, type CoverageReporter as aa, type CoverageIstanbulOptions as ab, type CoverageV8Options as ac, type CustomProviderOptions as ad, type BenchmarkUserOptions as ae, type Benchmark as af, type BenchmarkResult as ag, type BenchFunction as ah, type BenchmarkAPI as ai, type VitestOptions as aj, WorkspaceProject as ak, Logger as al, type TestSequencer as am, type WorkspaceSpec as an, type ProcessPool as ao, getFilePoolName as ap, VitestPackageInstaller as aq, type TestSequencerConstructor as ar, type BrowserProviderInitializationOptions as as, type BrowserProvider as at, type BrowserProviderModule as au, type ResolvedBrowserOptions as av, type BrowserProviderOptions as aw, type BrowserCommand as ax, type BrowserCommandContext as ay, type BrowserServer as az, type CoverageProvider as b, VerboseReporter as b0, TapReporter as b1, JUnitReporter as b2, TapFlatReporter as b3, HangingProcessReporter as b4, GithubActionsReporter as b5, BaseReporter as b6, ReportersMap as b7, type BuiltinReporters as b8, type BuiltinReporterOptions as b9, type JsonAssertionResult as ba, type JsonTestResult as bb, type JsonTestResults as bc, BenchmarkReportsMap as bd, type BenchmarkBuiltinReporters as be, type CoverageProviderModule as c, type BirpcOptions as d, type RuntimeRPC as e, type ContextRPC as f, type WorkerContext as g, type RuntimeConfig as h, type ModuleGraphData as i, type Reporter as j, type BirpcReturn as k, type RawErrsMap as l, type CollectLineNumbers as m, type CollectLines as n, type RootAndTarget as o, type Context as p, type Pool as q, type PoolOptions as r, type BuiltinEnvironment as s, type CSSModuleScopeStrategy as t, type EnvironmentOptions as u, type VitestRunMode as v, type TransformModePatterns as w, type TypecheckConfig as x, type ProjectConfig as y, type BrowserScript as z };
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { b6 as BaseReporter, aZ as BasicReporter, be as BenchmarkBuiltinReporters, bd as BenchmarkReportsMap, b9 as BuiltinReporterOptions, b8 as BuiltinReporters, aY as DefaultReporter, a_ as DotReporter, b5 as GithubActionsReporter, b4 as HangingProcessReporter, b2 as JUnitReporter, ba as JsonAssertionResult, a$ as JsonReporter, bb as JsonTestResult, bc as JsonTestResults, j as Reporter, b7 as ReportersMap, b3 as TapFlatReporter, b1 as TapReporter, b0 as VerboseReporter } from './reporters-fiIq_dT9.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
package/dist/reporters.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export {
|
|
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.BC5zhX9y.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'picocolors';
|
|
4
4
|
import 'pathe';
|
|
5
|
-
import './vendor/tasks.
|
|
5
|
+
import './vendor/tasks.DhVtQBtW.js';
|
|
6
6
|
import '@vitest/runner/utils';
|
|
7
7
|
import '@vitest/utils';
|
|
8
8
|
import './vendor/env.bmJgw1qP.js';
|
|
9
9
|
import 'std-env';
|
|
10
|
-
import './vendor/utils.
|
|
11
|
-
import './vendor/base.
|
|
10
|
+
import './vendor/utils.DSO2UK15.js';
|
|
11
|
+
import './vendor/base.CTYV4Gnz.js';
|
|
12
12
|
import 'node:perf_hooks';
|
|
13
13
|
import '@vitest/utils/source-map';
|
|
14
|
-
import './vendor/index.
|
|
14
|
+
import './vendor/index.C9Thslzw.js';
|
|
15
15
|
import './vendor/global.7bFbnyXl.js';
|
|
16
|
-
import './chunks/runtime-console.
|
|
16
|
+
import './chunks/runtime-console.Ckl0vEQr.js';
|
|
17
17
|
import 'node:stream';
|
|
18
18
|
import 'node:console';
|
|
19
19
|
import 'node:path';
|
|
20
|
-
import './vendor/date.
|
|
20
|
+
import './vendor/date.W2xKR2qe.js';
|
|
21
21
|
import 'node:os';
|
|
22
22
|
import 'node:fs/promises';
|
|
23
23
|
import 'execa';
|
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-fiIq_dT9.js';
|
|
3
3
|
import * as tinybench from 'tinybench';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vite-node';
|