vitest 3.0.4 → 3.0.6
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/LICENSE.md +20 -304
- package/dist/browser.d.ts +8 -14
- package/dist/browser.js +2 -2
- package/dist/chunks/{base.wKnmhRYd.js → base.B2NLWv2w.js} +5 -3
- package/dist/chunks/{cac.DYBkNWP6.js → cac.mNJBJcT7.js} +24 -24
- package/dist/chunks/{cli-api.Ci-9Ccnz.js → cli-api.Dkt_XoKq.js} +3289 -3054
- package/dist/chunks/{console.BxE0RUCr.js → console.CN7AiMGV.js} +3 -3
- package/dist/chunks/{coverage.BWeNbfBa.js → coverage.DnNIv-kJ.js} +1 -1
- package/dist/chunks/{creator.fUJbheb8.js → creator.2CFRE1Yx.js} +5 -5
- package/dist/chunks/{execute.PoofJYS5.js → execute.DNQad00_.js} +11 -4
- package/dist/chunks/{globals.BSNBk3vE.js → globals.DrEiwfS1.js} +2 -2
- package/dist/chunks/{index.TH3f4LSA.js → index.68735LiX.js} +2 -2
- package/dist/chunks/{index.NxxmQyK2.js → index.Bw6JxgX8.js} +3 -3
- package/dist/chunks/{index.vId0fl99.js → index.C1f-_gvH.js} +86 -45
- package/dist/chunks/{index.B57_6XMC.js → index.DBIGubLC.js} +8 -8
- package/dist/chunks/{index.C2XSkjNu.js → index.DC3HGwr0.js} +3 -3
- package/dist/chunks/{index.cYxyd29h.js → index.K90BXFOx.js} +12 -12
- package/dist/chunks/{index.Bf4FgyZN.js → index.SduP00mx.js} +1 -1
- package/dist/chunks/{inspector.CU9GlB9I.js → inspector.DKLceBVD.js} +1 -1
- package/dist/chunks/{reporters.0x019-V2.d.ts → reporters.DTtkbAtP.d.ts} +78 -60
- package/dist/chunks/{resolveConfig.DkmB2h7h.js → resolveConfig.BbcK25zb.js} +23 -24
- package/dist/chunks/{rpc.Bf456uf4.js → rpc.TVf73xOu.js} +1 -1
- package/dist/chunks/{runBaseTests.Ba8jtu6O.js → runBaseTests.Cr-AyqFv.js} +9 -9
- package/dist/chunks/{setup-common.jLbIuaww.js → setup-common.IrcyRZ8C.js} +1 -1
- package/dist/chunks/{suite.BJU7kdY9.d.ts → suite.qtkXWc6R.d.ts} +1 -1
- package/dist/chunks/{typechecker.CdcjdhoT.js → typechecker.cZ0LjdSi.js} +7 -7
- package/dist/chunks/{utils.DJWL04yX.js → utils.bLM2atbD.js} +3 -3
- package/dist/chunks/{vi.CjhMlMwf.js → vi.DrftpPF8.js} +26 -20
- package/dist/chunks/{vite.DiG-KbRF.d.ts → vite.BmCIRnbq.d.ts} +1 -1
- package/dist/chunks/{vm.DXDoSHPT.js → vm.ku9l48hv.js} +7 -5
- package/dist/chunks/{worker.B1y96qmv.d.ts → worker.B2JXutr8.d.ts} +1 -1
- package/dist/chunks/{worker.CIpff8Eg.d.ts → worker.DaAIyCKm.d.ts} +2 -1
- package/dist/cli.js +1 -1
- package/dist/config.cjs +3 -4
- package/dist/config.d.ts +23 -26
- package/dist/config.js +3 -4
- package/dist/coverage.d.ts +3 -3
- package/dist/coverage.js +10 -10
- package/dist/environments.d.ts +2 -2
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +6 -6
- package/dist/execute.js +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +2 -2
- package/dist/node.d.ts +16 -13
- package/dist/node.js +12 -13
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +3 -3
- package/dist/runners.js +4 -4
- package/dist/suite.d.ts +1 -1
- package/dist/worker.js +6 -5
- package/dist/workers/forks.js +4 -4
- package/dist/workers/runVmTests.js +8 -8
- package/dist/workers/threads.js +4 -4
- package/dist/workers/vmForks.js +5 -5
- package/dist/workers/vmThreads.js +5 -5
- package/dist/workers.d.ts +2 -2
- package/dist/workers.js +8 -8
- package/package.json +18 -18
|
@@ -1,20 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { TestError, SerializedError, ParsedStack, Arrayable, ErrorWithDiff, Awaitable as Awaitable$1 } from '@vitest/utils';
|
|
1
|
+
import { Task, Suite, File, TaskMeta, TaskResultPack, SequenceSetupFiles, SequenceHooks, CancelReason } from '@vitest/runner';
|
|
2
|
+
import { b as Awaitable, U as UserConsoleLog, c as Arrayable$1, A as AfterSuiteRunMeta, f as EnvironmentOptions, P as ProvidedContext } from './environment.d8YfPkTm.js';
|
|
3
|
+
import { ParsedStack, TestError, SerializedError, ErrorWithDiff, Arrayable, Awaitable as Awaitable$1 } from '@vitest/utils';
|
|
5
4
|
import { Writable } from 'node:stream';
|
|
6
|
-
import { TransformResult as TransformResult$1,
|
|
5
|
+
import { TransformResult as TransformResult$1, UserConfig as UserConfig$1, DepOptimizationConfig, ServerOptions, ConfigEnv, AliasOptions, ViteDevServer, ModuleNode } from 'vite';
|
|
7
6
|
import { StackTraceParserOptions } from '@vitest/utils/source-map';
|
|
8
7
|
import { S as SerializedConfig, F as FakeTimerInstallOpts } from './config.BRtC-JeT.js';
|
|
9
8
|
import { PrettyFormatOptions } from '@vitest/pretty-format';
|
|
10
9
|
import { SnapshotSummary, SnapshotStateOptions } from '@vitest/snapshot';
|
|
11
10
|
import { SerializedDiffOptions } from '@vitest/utils/diff';
|
|
12
|
-
import { ViteNodeServerOptions } from 'vite-node';
|
|
11
|
+
import { ModuleExecutionInfo, ViteNodeServerOptions } from 'vite-node';
|
|
13
12
|
import * as chai from 'chai';
|
|
14
13
|
import { B as BenchmarkResult } from './benchmark.CFFwLv-O.js';
|
|
15
14
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
16
15
|
import { Stats } from 'node:fs';
|
|
17
16
|
|
|
17
|
+
declare class TypeCheckError extends Error {
|
|
18
|
+
message: string;
|
|
19
|
+
stacks: ParsedStack[];
|
|
20
|
+
name: string;
|
|
21
|
+
constructor(message: string, stacks: ParsedStack[]);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface ErrorOptions {
|
|
25
|
+
type?: string;
|
|
26
|
+
fullStack?: boolean;
|
|
27
|
+
project?: TestProject;
|
|
28
|
+
verbose?: boolean;
|
|
29
|
+
screenshotPaths?: string[];
|
|
30
|
+
task?: Task;
|
|
31
|
+
showCodeFrame?: boolean;
|
|
32
|
+
}
|
|
33
|
+
type Listener = () => void;
|
|
34
|
+
declare class Logger {
|
|
35
|
+
ctx: Vitest;
|
|
36
|
+
outputStream: NodeJS.WriteStream | Writable;
|
|
37
|
+
errorStream: NodeJS.WriteStream | Writable;
|
|
38
|
+
private _clearScreenPending;
|
|
39
|
+
private _highlights;
|
|
40
|
+
private cleanupListeners;
|
|
41
|
+
console: Console;
|
|
42
|
+
constructor(ctx: Vitest, outputStream?: NodeJS.WriteStream | Writable, errorStream?: NodeJS.WriteStream | Writable);
|
|
43
|
+
log(...args: any[]): void;
|
|
44
|
+
error(...args: any[]): void;
|
|
45
|
+
warn(...args: any[]): void;
|
|
46
|
+
clearFullScreen(message?: string): void;
|
|
47
|
+
clearScreen(message: string, force?: boolean): void;
|
|
48
|
+
private _clearScreen;
|
|
49
|
+
printError(err: unknown, options?: ErrorOptions): void;
|
|
50
|
+
clearHighlightCache(filename?: string): void;
|
|
51
|
+
highlight(filename: string, source: string): string;
|
|
52
|
+
printNoTestFound(filters?: string[]): void;
|
|
53
|
+
printBanner(): void;
|
|
54
|
+
printBrowserBanner(project: TestProject): void;
|
|
55
|
+
printUnhandledErrors(errors: unknown[]): void;
|
|
56
|
+
printSourceTypeErrors(errors: TypeCheckError[]): void;
|
|
57
|
+
getColumns(): number;
|
|
58
|
+
onTerminalCleanup(listener: Listener): void;
|
|
59
|
+
private addCleanupListeners;
|
|
60
|
+
private registerUnhandledRejection;
|
|
61
|
+
}
|
|
62
|
+
|
|
18
63
|
type SerializedTestSpecification = [
|
|
19
64
|
project: {
|
|
20
65
|
name: string | undefined;
|
|
@@ -601,6 +646,10 @@ declare abstract class BaseReporter implements Reporter {
|
|
|
601
646
|
* Callback invoked with a single `Task` from `onTaskUpdate`
|
|
602
647
|
*/
|
|
603
648
|
protected printTask(task: Task): void;
|
|
649
|
+
protected printSuite(_task: Task): void;
|
|
650
|
+
protected getTestName(test: Task, separator?: string): string;
|
|
651
|
+
protected formatShortError(error: ErrorWithDiff): string;
|
|
652
|
+
protected getTestIndentation(_test: Task): string;
|
|
604
653
|
private getDurationPrefix;
|
|
605
654
|
onWatcherStart(files?: File[], errors?: unknown[]): void;
|
|
606
655
|
onWatcherRerun(files: string[], trigger?: string): void;
|
|
@@ -883,7 +932,7 @@ declare class JUnitReporter implements Reporter {
|
|
|
883
932
|
writeElement(name: string, attrs: Record<string, any>, children: () => Promise<void>): Promise<void>;
|
|
884
933
|
writeLogs(task: Task, type: 'err' | 'out'): Promise<void>;
|
|
885
934
|
writeTasks(tasks: Task[], filename: string): Promise<void>;
|
|
886
|
-
onFinished(files?:
|
|
935
|
+
onFinished(files?: File[]): Promise<void>;
|
|
887
936
|
}
|
|
888
937
|
|
|
889
938
|
declare class TapReporter implements Reporter {
|
|
@@ -893,18 +942,22 @@ declare class TapReporter implements Reporter {
|
|
|
893
942
|
static getComment(task: Task): string;
|
|
894
943
|
private logErrorDetails;
|
|
895
944
|
protected logTasks(tasks: Task[]): void;
|
|
896
|
-
onFinished(files?:
|
|
945
|
+
onFinished(files?: File[]): void;
|
|
897
946
|
}
|
|
898
947
|
|
|
899
948
|
declare class TapFlatReporter extends TapReporter {
|
|
900
949
|
onInit(ctx: Vitest): void;
|
|
901
|
-
onFinished(files?:
|
|
950
|
+
onFinished(files?: File[]): void;
|
|
902
951
|
}
|
|
903
952
|
|
|
904
953
|
declare class VerboseReporter extends DefaultReporter {
|
|
905
954
|
protected verbose: boolean;
|
|
906
955
|
renderSucceed: boolean;
|
|
907
956
|
printTask(task: Task): void;
|
|
957
|
+
protected printSuite(task: Task): void;
|
|
958
|
+
protected getTestName(test: Task): string;
|
|
959
|
+
protected getTestIndentation(test: Task): string;
|
|
960
|
+
protected formatShortError(): string;
|
|
908
961
|
}
|
|
909
962
|
|
|
910
963
|
type FormattedBenchmarkResult = BenchmarkResult & {
|
|
@@ -926,7 +979,7 @@ declare class BenchmarkReporter extends DefaultReporter {
|
|
|
926
979
|
onInit(ctx: Vitest): Promise<void>;
|
|
927
980
|
onTaskUpdate(packs: TaskResultPack[]): void;
|
|
928
981
|
printTask(task: Task): void;
|
|
929
|
-
onFinished(files?:
|
|
982
|
+
onFinished(files?: File[], errors?: unknown[]): Promise<void>;
|
|
930
983
|
}
|
|
931
984
|
|
|
932
985
|
declare class VerboseBenchmarkReporter extends BenchmarkReporter {
|
|
@@ -967,52 +1020,6 @@ interface BuiltinReporterOptions {
|
|
|
967
1020
|
'html': HTMLOptions;
|
|
968
1021
|
}
|
|
969
1022
|
|
|
970
|
-
declare class TypeCheckError extends Error {
|
|
971
|
-
message: string;
|
|
972
|
-
stacks: ParsedStack[];
|
|
973
|
-
name: string;
|
|
974
|
-
constructor(message: string, stacks: ParsedStack[]);
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
interface ErrorOptions {
|
|
978
|
-
type?: string;
|
|
979
|
-
fullStack?: boolean;
|
|
980
|
-
project?: TestProject;
|
|
981
|
-
verbose?: boolean;
|
|
982
|
-
screenshotPaths?: string[];
|
|
983
|
-
task?: Task;
|
|
984
|
-
showCodeFrame?: boolean;
|
|
985
|
-
}
|
|
986
|
-
type Listener = () => void;
|
|
987
|
-
declare class Logger {
|
|
988
|
-
ctx: Vitest;
|
|
989
|
-
outputStream: NodeJS.WriteStream | Writable;
|
|
990
|
-
errorStream: NodeJS.WriteStream | Writable;
|
|
991
|
-
private _clearScreenPending;
|
|
992
|
-
private _highlights;
|
|
993
|
-
private cleanupListeners;
|
|
994
|
-
console: Console;
|
|
995
|
-
constructor(ctx: Vitest, outputStream?: NodeJS.WriteStream | Writable, errorStream?: NodeJS.WriteStream | Writable);
|
|
996
|
-
log(...args: any[]): void;
|
|
997
|
-
error(...args: any[]): void;
|
|
998
|
-
warn(...args: any[]): void;
|
|
999
|
-
clearFullScreen(message?: string): void;
|
|
1000
|
-
clearScreen(message: string, force?: boolean): void;
|
|
1001
|
-
private _clearScreen;
|
|
1002
|
-
printError(err: unknown, options?: ErrorOptions): void;
|
|
1003
|
-
clearHighlightCache(filename?: string): void;
|
|
1004
|
-
highlight(filename: string, source: string): string;
|
|
1005
|
-
printNoTestFound(filters?: string[]): void;
|
|
1006
|
-
printBanner(): void;
|
|
1007
|
-
printBrowserBanner(project: TestProject): void;
|
|
1008
|
-
printUnhandledErrors(errors: unknown[]): void;
|
|
1009
|
-
printSourceTypeErrors(errors: TypeCheckError[]): void;
|
|
1010
|
-
getColumns(): number;
|
|
1011
|
-
onTerminalCleanup(listener: Listener): void;
|
|
1012
|
-
private addCleanupListeners;
|
|
1013
|
-
private registerUnhandledRejection;
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
1023
|
type ChaiConfig = Omit<Partial<typeof chai.config>, 'useProxy' | 'proxyExcludedKeys'>;
|
|
1017
1024
|
|
|
1018
1025
|
interface TestSequencer {
|
|
@@ -1174,6 +1181,13 @@ interface ReportContext {
|
|
|
1174
1181
|
/** Indicates whether all tests were run. False when only specific tests were run. */
|
|
1175
1182
|
allTestsRun?: boolean;
|
|
1176
1183
|
}
|
|
1184
|
+
interface CoverageModuleLoader {
|
|
1185
|
+
executeId: (id: string) => Promise<{
|
|
1186
|
+
default: CoverageProviderModule;
|
|
1187
|
+
}>;
|
|
1188
|
+
isBrowser?: boolean;
|
|
1189
|
+
moduleExecutionInfo?: ModuleExecutionInfo;
|
|
1190
|
+
}
|
|
1177
1191
|
interface CoverageProviderModule {
|
|
1178
1192
|
/**
|
|
1179
1193
|
* Factory for creating a new coverage provider
|
|
@@ -1188,7 +1202,9 @@ interface CoverageProviderModule {
|
|
|
1188
1202
|
/**
|
|
1189
1203
|
* Executed on after each run in the worker thread. Possible to return a payload passed to the provider
|
|
1190
1204
|
*/
|
|
1191
|
-
takeCoverage?: (
|
|
1205
|
+
takeCoverage?: (runtimeOptions?: {
|
|
1206
|
+
moduleExecutionInfo?: ModuleExecutionInfo;
|
|
1207
|
+
}) => unknown | Promise<unknown>;
|
|
1192
1208
|
/**
|
|
1193
1209
|
* Executed after all tests have been run in the worker thread.
|
|
1194
1210
|
*/
|
|
@@ -1437,7 +1453,7 @@ interface SequenceOptions {
|
|
|
1437
1453
|
* - `stack` will order "after" hooks in reverse order, "before" hooks will run sequentially
|
|
1438
1454
|
* - `list` will order hooks in the order they are defined
|
|
1439
1455
|
* - `parallel` will run hooks in a single group in parallel
|
|
1440
|
-
* @default '
|
|
1456
|
+
* @default 'stack'
|
|
1441
1457
|
*/
|
|
1442
1458
|
hooks?: SequenceHooks;
|
|
1443
1459
|
}
|
|
@@ -2195,7 +2211,9 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, 'project' | 'config'
|
|
|
2195
2211
|
poolOptions?: ResolvedPoolOptions;
|
|
2196
2212
|
reporters: (InlineReporter | ReporterWithOptions)[];
|
|
2197
2213
|
defines: Record<string, any>;
|
|
2198
|
-
api
|
|
2214
|
+
api: ApiConfig & {
|
|
2215
|
+
token: string;
|
|
2216
|
+
};
|
|
2199
2217
|
cliExclude?: string[];
|
|
2200
2218
|
project: string[];
|
|
2201
2219
|
benchmark?: Required<Omit<BenchmarkUserOptions, 'outputFile' | 'compare' | 'outputJson'>> & Pick<BenchmarkUserOptions, 'outputFile' | 'compare' | 'outputJson'>;
|
|
@@ -3032,4 +3050,4 @@ declare class Vitest {
|
|
|
3032
3050
|
type OnServerRestartHandler = (reason?: string) => Promise<void> | void;
|
|
3033
3051
|
type OnTestsRerunHandler = (testFiles: TestSpecification[]) => Promise<void> | void;
|
|
3034
3052
|
|
|
3035
|
-
export { type
|
|
3053
|
+
export { type JsonOptions$1 as $, type ApiConfig as A, type BaseCoverageOptions as B, CoverageMap as C, type DepsOptimizationOptions as D, type VitestOptions as E, TestProject as F, type TestSequencer as G, TestSpecification as H, type InlineConfig as I, TestModule as J, type OnTestsRerunHandler as K, Logger as L, type ModuleDiagnostic as M, VitestPackageInstaller as N, type OnServerRestartHandler as O, type Pool as P, type ProcessPool as Q, type ResolvedCoverageOptions as R, type SerializedTestSpecification as S, type TestProjectConfiguration as T, type UserWorkspaceConfig as U, Vitest as V, type WorkspaceProjectConfiguration as W, type WorkspaceSpec as X, getFilePoolName as Y, type SerializedTestProject as Z, type HTMLOptions as _, type ReportContext as a, type JUnitOptions as a0, type TaskOptions as a1, TestCase as a2, TestCollection as a3, type TestDiagnostic as a4, type TestModuleState as a5, type TestResult as a6, type TestResultFailed as a7, type TestResultPassed as a8, type TestResultSkipped as a9, BenchmarkReporter as aA, BenchmarkReportsMap as aB, DefaultReporter as aC, DotReporter as aD, GithubActionsReporter as aE, HangingProcessReporter as aF, JsonReporter as aG, JUnitReporter as aH, ReportersMap as aI, TapFlatReporter as aJ, TapReporter as aK, VerboseBenchmarkReporter as aL, VerboseReporter as aM, BaseReporter as aN, type BenchmarkBuiltinReporters as aO, type BuiltinReporterOptions as aP, type BuiltinReporters as aQ, type JsonAssertionResult as aR, type JsonTestResult as aS, type JsonTestResults as aT, type TestState as aa, TestSuite as ab, type TestSuiteState as ac, type TestSequencerConstructor as ad, type BrowserBuiltinProvider as ae, type BrowserCommand as af, type BrowserCommandContext as ag, type BrowserInstanceOption as ah, type BrowserOrchestrator as ai, type BrowserProvider as aj, type BrowserProviderInitializationOptions as ak, type BrowserProviderModule as al, type BrowserProviderOptions as am, type BrowserServerState as an, type BrowserServerStateSession as ao, type CDPSession as ap, type ParentProjectBrowser as aq, type ProjectBrowser as ar, type ResolvedBrowserOptions as as, type ResolvedProjectConfig as at, type ResolveSnapshotPathHandler as au, type ResolveSnapshotPathHandlerContext as av, type TestRunResult as aw, type ReportedHookContext as ax, type TestRunEndReason as ay, BasicReporter as az, type CoverageModuleLoader as b, type CoverageProvider as c, type CoverageV8Options as d, type UserProjectConfigFn as e, type UserProjectConfigExport as f, type CoverageProviderModule as g, type CoverageReporter as h, type CoverageProviderName as i, type CoverageOptions as j, type CoverageIstanbulOptions as k, type CustomProviderOptions as l, type Reporter as m, type BrowserScript as n, type BrowserConfigOptions as o, type BuiltinEnvironment as p, type VitestEnvironment as q, type PoolOptions as r, type CSSModuleScopeStrategy as s, type VitestRunMode as t, type TransformModePatterns as u, type TypecheckConfig as v, type UserConfig as w, type ResolvedConfig as x, type ProjectConfig as y, type BenchmarkUserOptions as z };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
1
2
|
import { slash, createDefer, shuffle, toArray } from '@vitest/utils';
|
|
2
3
|
import fs, { statSync, realpathSync, promises as promises$1 } from 'node:fs';
|
|
3
4
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
@@ -10,19 +11,18 @@ import assert from 'node:assert';
|
|
|
10
11
|
import v8 from 'node:v8';
|
|
11
12
|
import { format, inspect } from 'node:util';
|
|
12
13
|
import c from 'tinyrainbow';
|
|
13
|
-
import { e as extraInlineDeps,
|
|
14
|
+
import { e as extraInlineDeps, a as defaultBrowserPort, b as defaultInspectPort, d as defaultPort } from './constants.fzPh7AOq.js';
|
|
14
15
|
import * as nodeos from 'node:os';
|
|
15
16
|
import nodeos__default from 'node:os';
|
|
16
|
-
import { w as wrapSerializableConfig, a as Typechecker, b as isWindows } from './typechecker.
|
|
17
|
+
import { w as wrapSerializableConfig, a as Typechecker, b as isWindows } from './typechecker.cZ0LjdSi.js';
|
|
17
18
|
import { isCI, provider } from 'std-env';
|
|
18
|
-
import crypto from 'node:crypto';
|
|
19
19
|
import { isatty } from 'node:tty';
|
|
20
20
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
|
|
21
21
|
import require$$0 from 'util';
|
|
22
22
|
import require$$0$1 from 'path';
|
|
23
23
|
import { version } from 'vite';
|
|
24
24
|
import EventEmitter from 'node:events';
|
|
25
|
-
import { c as createBirpc } from './index.
|
|
25
|
+
import { c as createBirpc } from './index.68735LiX.js';
|
|
26
26
|
import Tinypool$1, { Tinypool } from 'tinypool';
|
|
27
27
|
import { MessageChannel } from 'node:worker_threads';
|
|
28
28
|
import { hasFailed } from '@vitest/runner/utils';
|
|
@@ -1032,7 +1032,6 @@ function defaultGetFormatWithoutErrors(url, context) {
|
|
|
1032
1032
|
const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
|
|
1033
1033
|
|
|
1034
1034
|
const {
|
|
1035
|
-
ERR_NETWORK_IMPORT_DISALLOWED,
|
|
1036
1035
|
ERR_INVALID_MODULE_SPECIFIER,
|
|
1037
1036
|
ERR_INVALID_PACKAGE_CONFIG,
|
|
1038
1037
|
ERR_INVALID_PACKAGE_TARGET,
|
|
@@ -2377,7 +2376,7 @@ const fakeTimersDefaults = {
|
|
|
2377
2376
|
loopLimit: 1e4,
|
|
2378
2377
|
shouldClearNativeTimers: true
|
|
2379
2378
|
};
|
|
2380
|
-
const
|
|
2379
|
+
const configDefaults = Object.freeze({
|
|
2381
2380
|
allowOnly: !isCI,
|
|
2382
2381
|
isolate: true,
|
|
2383
2382
|
watch: !isCI,
|
|
@@ -2415,8 +2414,7 @@ const config = {
|
|
|
2415
2414
|
},
|
|
2416
2415
|
slowTestThreshold: 300,
|
|
2417
2416
|
disableConsoleIntercept: false
|
|
2418
|
-
};
|
|
2419
|
-
const configDefaults = Object.freeze(config);
|
|
2417
|
+
});
|
|
2420
2418
|
|
|
2421
2419
|
function getWorkersCountByPercentage(percent) {
|
|
2422
2420
|
const maxWorkersCount = nodeos__default.availableParallelism?.() ?? nodeos__default.cpus().length;
|
|
@@ -2643,7 +2641,7 @@ function requireToRegexRange () {
|
|
|
2643
2641
|
throw new TypeError('toRegexRange: expected the first argument to be a number');
|
|
2644
2642
|
}
|
|
2645
2643
|
|
|
2646
|
-
if (max ===
|
|
2644
|
+
if (max === void 0 || min === max) {
|
|
2647
2645
|
return String(min);
|
|
2648
2646
|
}
|
|
2649
2647
|
|
|
@@ -2715,9 +2713,9 @@ function requireToRegexRange () {
|
|
|
2715
2713
|
};
|
|
2716
2714
|
|
|
2717
2715
|
function collatePatterns(neg, pos, options) {
|
|
2718
|
-
let onlyNegative = filterPatterns(neg, pos, '-', false);
|
|
2719
|
-
let onlyPositive = filterPatterns(pos, neg, '', false);
|
|
2720
|
-
let intersected = filterPatterns(neg, pos, '-?', true);
|
|
2716
|
+
let onlyNegative = filterPatterns(neg, pos, '-', false) || [];
|
|
2717
|
+
let onlyPositive = filterPatterns(pos, neg, '', false) || [];
|
|
2718
|
+
let intersected = filterPatterns(neg, pos, '-?', true) || [];
|
|
2721
2719
|
let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
|
|
2722
2720
|
return subpatterns.join('|');
|
|
2723
2721
|
}
|
|
@@ -5486,7 +5484,7 @@ function requireParse () {
|
|
|
5486
5484
|
}
|
|
5487
5485
|
|
|
5488
5486
|
if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
|
|
5489
|
-
const end = rest[1] !==
|
|
5487
|
+
const end = rest[1] !== void 0 ? '|$' : '';
|
|
5490
5488
|
|
|
5491
5489
|
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
5492
5490
|
prior.output = `(?:${prior.output}`;
|
|
@@ -6442,7 +6440,7 @@ function requireMicromatch () {
|
|
|
6442
6440
|
let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
|
|
6443
6441
|
|
|
6444
6442
|
if (match) {
|
|
6445
|
-
return match.slice(1).map(v => v ===
|
|
6443
|
+
return match.slice(1).map(v => v === void 0 ? '' : v);
|
|
6446
6444
|
}
|
|
6447
6445
|
};
|
|
6448
6446
|
|
|
@@ -6559,7 +6557,7 @@ function getTransformMode(patterns, filename) {
|
|
|
6559
6557
|
if (patterns.ssr && mm.isMatch(filename, patterns.ssr)) {
|
|
6560
6558
|
return "ssr";
|
|
6561
6559
|
}
|
|
6562
|
-
return
|
|
6560
|
+
return void 0;
|
|
6563
6561
|
}
|
|
6564
6562
|
async function groupFilesByEnv(files) {
|
|
6565
6563
|
const filesWithEnv = await Promise.all(
|
|
@@ -7254,7 +7252,7 @@ function getWorkerMemoryLimit(config) {
|
|
|
7254
7252
|
return 1 / (config.poolOptions?.vmThreads?.maxThreads ?? getDefaultThreadsCount(config));
|
|
7255
7253
|
}
|
|
7256
7254
|
function stringToBytes(input, percentageReference) {
|
|
7257
|
-
if (input === null || input ===
|
|
7255
|
+
if (input === null || input === void 0) {
|
|
7258
7256
|
return input;
|
|
7259
7257
|
}
|
|
7260
7258
|
if (typeof input === "string") {
|
|
@@ -7358,7 +7356,7 @@ function createVmForksPool(ctx, { execArgv, env }) {
|
|
|
7358
7356
|
],
|
|
7359
7357
|
terminateTimeout: ctx.config.teardownTimeout,
|
|
7360
7358
|
concurrentTasksPerWorker: 1,
|
|
7361
|
-
maxMemoryLimitBeforeRecycle: getMemoryLimit$1(ctx.config) ||
|
|
7359
|
+
maxMemoryLimitBeforeRecycle: getMemoryLimit$1(ctx.config) || void 0
|
|
7362
7360
|
};
|
|
7363
7361
|
if (poolOptions.singleFork || !ctx.config.fileParallelism) {
|
|
7364
7362
|
options.maxThreads = 1;
|
|
@@ -7497,7 +7495,7 @@ function createVmThreadsPool(ctx, { execArgv, env }) {
|
|
|
7497
7495
|
],
|
|
7498
7496
|
terminateTimeout: ctx.config.teardownTimeout,
|
|
7499
7497
|
concurrentTasksPerWorker: 1,
|
|
7500
|
-
maxMemoryLimitBeforeRecycle: getMemoryLimit(ctx.config) ||
|
|
7498
|
+
maxMemoryLimitBeforeRecycle: getMemoryLimit(ctx.config) || void 0
|
|
7501
7499
|
};
|
|
7502
7500
|
if (poolOptions.singleThread || !ctx.config.fileParallelism) {
|
|
7503
7501
|
options.maxThreads = 1;
|
|
@@ -7820,7 +7818,7 @@ function resolvePath(path, root) {
|
|
|
7820
7818
|
);
|
|
7821
7819
|
}
|
|
7822
7820
|
function parseInspector(inspect) {
|
|
7823
|
-
if (typeof inspect === "boolean" || inspect ===
|
|
7821
|
+
if (typeof inspect === "boolean" || inspect === void 0) {
|
|
7824
7822
|
return {};
|
|
7825
7823
|
}
|
|
7826
7824
|
if (typeof inspect === "number") {
|
|
@@ -8080,7 +8078,7 @@ ${JSON.stringify({ browser: { provider: "playwright", instances: [{ browser: "ch
|
|
|
8080
8078
|
resolved.server.deps ??= {};
|
|
8081
8079
|
const deprecatedDepsOptions = ["inline", "external", "fallbackCJS"];
|
|
8082
8080
|
deprecatedDepsOptions.forEach((option) => {
|
|
8083
|
-
if (resolved.deps[option] ===
|
|
8081
|
+
if (resolved.deps[option] === void 0) {
|
|
8084
8082
|
return;
|
|
8085
8083
|
}
|
|
8086
8084
|
if (option === "fallbackCJS") {
|
|
@@ -8101,7 +8099,7 @@ ${JSON.stringify({ browser: { provider: "playwright", instances: [{ browser: "ch
|
|
|
8101
8099
|
)
|
|
8102
8100
|
);
|
|
8103
8101
|
}
|
|
8104
|
-
if (resolved.server.deps[option] ===
|
|
8102
|
+
if (resolved.server.deps[option] === void 0) {
|
|
8105
8103
|
resolved.server.deps[option] = resolved.deps[option];
|
|
8106
8104
|
}
|
|
8107
8105
|
});
|
|
@@ -8132,7 +8130,7 @@ ${JSON.stringify({ browser: { provider: "playwright", instances: [{ browser: "ch
|
|
|
8132
8130
|
resolved.root
|
|
8133
8131
|
);
|
|
8134
8132
|
}
|
|
8135
|
-
resolved.testNamePattern = resolved.testNamePattern ? resolved.testNamePattern instanceof RegExp ? resolved.testNamePattern : new RegExp(resolved.testNamePattern) :
|
|
8133
|
+
resolved.testNamePattern = resolved.testNamePattern ? resolved.testNamePattern instanceof RegExp ? resolved.testNamePattern : new RegExp(resolved.testNamePattern) : void 0;
|
|
8136
8134
|
if (resolved.snapshotFormat && "plugins" in resolved.snapshotFormat) {
|
|
8137
8135
|
resolved.snapshotFormat.plugins = [];
|
|
8138
8136
|
}
|
|
@@ -8287,7 +8285,8 @@ ${JSON.stringify({ browser: { provider: "playwright", instances: [{ browser: "ch
|
|
|
8287
8285
|
resolved.diff = resolvePath(resolved.diff, resolved.root);
|
|
8288
8286
|
resolved.forceRerunTriggers.push(resolved.diff);
|
|
8289
8287
|
}
|
|
8290
|
-
|
|
8288
|
+
const api = resolveApiServerConfig(options, defaultPort);
|
|
8289
|
+
resolved.api = { ...api, token: crypto.randomUUID() };
|
|
8291
8290
|
if (options.related) {
|
|
8292
8291
|
resolved.related = toArray(options.related).map(
|
|
8293
8292
|
(file) => resolve(resolved.root, file)
|
|
@@ -8501,4 +8500,4 @@ function isPlaywrightChromiumOnly(vitest, config) {
|
|
|
8501
8500
|
return true;
|
|
8502
8501
|
}
|
|
8503
8502
|
|
|
8504
|
-
export { BaseSequencer as B, RandomSequencer as R, VitestCache as V, resolveConfig as a, resolveApiServerConfig as b, coverageConfigDefaults as c, createMethodsRPC as d,
|
|
8503
|
+
export { BaseSequencer as B, RandomSequencer as R, VitestCache as V, resolveConfig as a, resolveApiServerConfig as b, coverageConfigDefaults as c, createMethodsRPC as d, configDefaults as e, isBrowserEnabled as f, getFilePoolName as g, hash as h, isPackageExists as i, groupBy as j, createPool as k, mm as m, resolveCoverageReporters as r, stdout as s, wildcardPatternToRegExp as w };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
2
|
import { startTests, collectTests } from '@vitest/runner';
|
|
3
|
-
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.
|
|
4
|
-
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './coverage.
|
|
5
|
-
import { a as globalExpect, v as vi } from './vi.
|
|
6
|
-
import { c as closeInspector } from './inspector.
|
|
3
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.DC3HGwr0.js';
|
|
4
|
+
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './coverage.DnNIv-kJ.js';
|
|
5
|
+
import { a as globalExpect, v as vi } from './vi.DrftpPF8.js';
|
|
6
|
+
import { c as closeInspector } from './inspector.DKLceBVD.js';
|
|
7
7
|
import { createRequire } from 'node:module';
|
|
8
8
|
import timers from 'node:timers';
|
|
9
9
|
import timersPromises from 'node:timers/promises';
|
|
@@ -11,15 +11,15 @@ import util from 'node:util';
|
|
|
11
11
|
import { getSafeTimers } from '@vitest/utils';
|
|
12
12
|
import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
|
|
13
13
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
14
|
-
import { V as VitestIndex } from './index.
|
|
15
|
-
import { s as setupCommonEnv } from './setup-common.
|
|
14
|
+
import { V as VitestIndex } from './index.SduP00mx.js';
|
|
15
|
+
import { s as setupCommonEnv } from './setup-common.IrcyRZ8C.js';
|
|
16
16
|
import { g as getWorkerState, r as resetModules } from './utils.C8RiOc4B.js';
|
|
17
17
|
import 'chai';
|
|
18
18
|
import 'node:path';
|
|
19
19
|
import '../path.js';
|
|
20
20
|
import 'node:url';
|
|
21
|
-
import './rpc.
|
|
22
|
-
import './index.
|
|
21
|
+
import './rpc.TVf73xOu.js';
|
|
22
|
+
import './index.68735LiX.js';
|
|
23
23
|
import '@vitest/expect';
|
|
24
24
|
import '@vitest/runner/utils';
|
|
25
25
|
import './_commonjsHelpers.BFTU3MAI.js';
|
|
@@ -79,7 +79,7 @@ function resolveAsset(mod, url) {
|
|
|
79
79
|
mod.exports = url;
|
|
80
80
|
}
|
|
81
81
|
async function setupConsoleLogSpy() {
|
|
82
|
-
const { createCustomConsole } = await import('./console.
|
|
82
|
+
const { createCustomConsole } = await import('./console.CN7AiMGV.js');
|
|
83
83
|
globalThis.console = createCustomConsole();
|
|
84
84
|
}
|
|
85
85
|
async function withEnv({ environment }, options, fn) {
|
|
@@ -13,7 +13,7 @@ async function setupCommonEnv(config) {
|
|
|
13
13
|
globalSetup = true;
|
|
14
14
|
setSafeTimers();
|
|
15
15
|
if (config.globals) {
|
|
16
|
-
(await import('./globals.
|
|
16
|
+
(await import('./globals.DrEiwfS1.js')).registerApiGlobally();
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
function setupDefines(defines) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Test } from '@vitest/runner';
|
|
2
|
-
import {
|
|
2
|
+
import { c as BenchmarkAPI, a as BenchFunction } from './benchmark.CFFwLv-O.js';
|
|
3
3
|
import { Options } from 'tinybench';
|
|
4
4
|
import '@vitest/runner/utils';
|
|
5
5
|
|