vitest 1.0.0-beta.3 → 1.0.0-beta.5
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 +3 -498
- package/dist/browser.d.ts +1 -2
- package/dist/browser.js +4 -4
- package/dist/child.js +15 -18
- package/dist/{chunk-api-setup.37a43981.js → chunks/api-setup.jHV5vgr2.js} +101 -39
- package/dist/chunks/install-pkg.ORGzQeqb.js +457 -0
- package/dist/chunks/integrations-globals.-pds_Gug.js +29 -0
- package/dist/{chunk-node-git.6c12e560.js → chunks/node-git.Hw101KjS.js} +1 -18
- package/dist/{chunk-runtime-console.f3263f87.js → chunks/runtime-console.iCAG0Yz3.js} +1 -1
- package/dist/cli-wrapper.js +2 -18
- package/dist/cli.js +21 -23
- package/dist/config.cjs +2 -1
- package/dist/config.d.ts +4 -7
- package/dist/config.js +2 -1
- package/dist/coverage.d.ts +25 -16
- package/dist/coverage.js +118 -49
- package/dist/entry-vm.js +13 -13
- package/dist/entry.js +14 -14
- package/dist/environments.d.ts +1 -2
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +2 -3
- package/dist/execute.js +3 -4
- package/dist/index.d.ts +396 -95
- package/dist/index.js +10 -10
- package/dist/node.d.ts +10 -6
- package/dist/node.js +17 -22
- package/dist/{vendor-paths.84fc7a99.js → paths.js} +1 -1
- package/dist/{reporters-1678fe04.d.ts → reporters-ANEBTnOh.d.ts} +336 -340
- package/dist/reporters.d.ts +1 -2
- package/dist/reporters.js +7 -8
- package/dist/runners.d.ts +1 -2
- package/dist/runners.js +8 -9
- package/dist/{suite-0579b50d.d.ts → suite-C1OmA61l.d.ts} +1 -1
- package/dist/suite.d.ts +2 -3
- package/dist/suite.js +3 -3
- package/dist/{vendor-benchmark.44931cfa.js → vendor/benchmark.WVm6DARl.js} +1 -1
- package/dist/{vendor-execute.e6e4e89b.js → vendor/execute.aMjV5C9u.js} +4 -7
- package/dist/vendor/global.L7JRz1qU.js +14 -0
- package/dist/{vendor-index.68ecee35.js → vendor/index.Npc-eff0.js} +11 -4
- package/dist/{vendor-index.29282562.js → vendor/index.XU72Rmy8.js} +1 -1
- package/dist/{vendor-index.3d079eea.js → vendor/index.h0j9y5vy.js} +5 -5
- package/dist/vendor/index.xL8XjTLv.js +3962 -0
- package/dist/vendor/loader.CU0NY2Is.js +39 -0
- package/dist/{vendor-node.327f8f1f.js → vendor/node.c-kzGvOB.js} +2192 -5614
- package/dist/{vendor-reporters.b9600369.js → vendor/reporters.1xKxm8im.js} +424 -374
- package/dist/{vendor-rpc.cbd8e972.js → vendor/rpc.Bl-ysZIr.js} +1 -1
- package/dist/{vendor-run-once.3e5ef7d7.js → vendor/run-once.X3E7xx3F.js} +1 -1
- package/dist/{vendor-vi.d30b47ae.js → vendor/vi.voNYQWB_.js} +35 -38
- package/dist/vm.js +16 -20
- package/dist/worker.js +16 -20
- package/index.cjs +5 -0
- package/package.json +50 -54
- package/dist/chunk-install-pkg.6349b322.js +0 -1740
- package/dist/chunk-integrations-globals.9df12d91.js +0 -29
- package/dist/vendor-global.97e4527c.js +0 -9
- package/dist/vendor-index.8efe7746.js +0 -2236
- package/dist/vendor-loader.9c966f23.js +0 -2089
- /package/dist/{vendor-_commonjsHelpers.7d1333e8.js → vendor/_commonjsHelpers.jjO7Zipk.js} +0 -0
- /package/dist/{vendor-base.9c08bbd0.js → vendor/base._79unx2z.js} +0 -0
- /package/dist/{vendor-constants.538d9b49.js → vendor/constants.WSvnD_fn.js} +0 -0
- /package/dist/{vendor-coverage.78040316.js → vendor/coverage.v6aD8iAh.js} +0 -0
- /package/dist/{vendor-date.6e993429.js → vendor/date.W90-E5kF.js} +0 -0
- /package/dist/{vendor-environments.dcc4a34e.js → vendor/environments.hpEVJZPC.js} +0 -0
- /package/dist/{vendor-index.1ca68bd5.js → vendor/index.cAUulNDf.js} +0 -0
- /package/dist/{vendor-inspector.209edf5a.js → vendor/inspector.lFAeuaAt.js} +0 -0
- /package/dist/{vendor-tasks.f9d75aed.js → vendor/tasks.IknbGB2n.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import { ViteDevServer,
|
|
2
|
+
import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
|
|
3
3
|
import * as _vitest_runner from '@vitest/runner';
|
|
4
4
|
import { File, Test as Test$1, Suite, TaskResultPack, Task, CancelReason, Custom, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
5
5
|
import { RawSourceMap, FetchResult, ViteNodeResolveId, ModuleCacheMap, ViteNodeServerOptions } from 'vite-node';
|
|
@@ -12,120 +12,114 @@ import { ViteNodeRunner } from 'vite-node/client';
|
|
|
12
12
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
13
13
|
import { ViteNodeServer } from 'vite-node/server';
|
|
14
14
|
import { MessagePort } from 'node:worker_threads';
|
|
15
|
-
import * as rollup from 'rollup';
|
|
16
15
|
import { Stats } from 'node:fs';
|
|
17
16
|
import * as chai from 'chai';
|
|
18
17
|
|
|
19
|
-
declare const
|
|
20
|
-
declare const Hint: unique symbol;
|
|
21
|
-
declare const
|
|
22
|
-
type
|
|
23
|
-
[
|
|
24
|
-
};
|
|
25
|
-
type
|
|
26
|
-
[Modifier]: '
|
|
27
|
-
};
|
|
28
|
-
type
|
|
29
|
-
[Modifier]: '
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
[
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
interface
|
|
65
|
-
[Kind]: '
|
|
66
|
-
static:
|
|
67
|
-
type: '
|
|
68
|
-
}
|
|
69
|
-
interface
|
|
70
|
-
[Kind]: '
|
|
71
|
-
static:
|
|
72
|
-
type: '
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
[
|
|
76
|
-
|
|
77
|
-
type
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
[
|
|
92
|
-
}
|
|
93
|
-
type
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
type: 'string';
|
|
125
|
-
}
|
|
126
|
-
/** Creates a static type from a TypeBox type */
|
|
127
|
-
type Static<T extends TSchema, P extends unknown[] = []> = (T & {
|
|
128
|
-
params: P;
|
|
18
|
+
declare const Modifier: unique symbol;
|
|
19
|
+
declare const Hint: unique symbol;
|
|
20
|
+
declare const Kind: unique symbol;
|
|
21
|
+
type Evaluate<T> = T extends infer O ? {
|
|
22
|
+
[K in keyof O]: O[K];
|
|
23
|
+
} : never;
|
|
24
|
+
type TReadonly<T extends TSchema> = T & {
|
|
25
|
+
[Modifier]: 'Readonly';
|
|
26
|
+
};
|
|
27
|
+
type TOptional<T extends TSchema> = T & {
|
|
28
|
+
[Modifier]: 'Optional';
|
|
29
|
+
};
|
|
30
|
+
type TReadonlyOptional<T extends TSchema> = T & {
|
|
31
|
+
[Modifier]: 'ReadonlyOptional';
|
|
32
|
+
};
|
|
33
|
+
interface SchemaOptions {
|
|
34
|
+
$schema?: string;
|
|
35
|
+
/** Id for this schema */
|
|
36
|
+
$id?: string;
|
|
37
|
+
/** Title of this schema */
|
|
38
|
+
title?: string;
|
|
39
|
+
/** Description of this schema */
|
|
40
|
+
description?: string;
|
|
41
|
+
/** Default value for this schema */
|
|
42
|
+
default?: any;
|
|
43
|
+
/** Example values matching this schema */
|
|
44
|
+
examples?: any;
|
|
45
|
+
[prop: string]: any;
|
|
46
|
+
}
|
|
47
|
+
interface TKind {
|
|
48
|
+
[Kind]: string;
|
|
49
|
+
}
|
|
50
|
+
interface TSchema extends SchemaOptions, TKind {
|
|
51
|
+
[Modifier]?: string;
|
|
52
|
+
[Hint]?: string;
|
|
53
|
+
params: unknown[];
|
|
54
|
+
static: unknown;
|
|
55
|
+
}
|
|
56
|
+
interface NumericOptions<N extends number | bigint> extends SchemaOptions {
|
|
57
|
+
exclusiveMaximum?: N;
|
|
58
|
+
exclusiveMinimum?: N;
|
|
59
|
+
maximum?: N;
|
|
60
|
+
minimum?: N;
|
|
61
|
+
multipleOf?: N;
|
|
62
|
+
}
|
|
63
|
+
interface TBoolean extends TSchema {
|
|
64
|
+
[Kind]: 'Boolean';
|
|
65
|
+
static: boolean;
|
|
66
|
+
type: 'boolean';
|
|
67
|
+
}
|
|
68
|
+
interface TNull extends TSchema {
|
|
69
|
+
[Kind]: 'Null';
|
|
70
|
+
static: null;
|
|
71
|
+
type: 'null';
|
|
72
|
+
}
|
|
73
|
+
interface TNumber extends TSchema, NumericOptions<number> {
|
|
74
|
+
[Kind]: 'Number';
|
|
75
|
+
static: number;
|
|
76
|
+
type: 'number';
|
|
77
|
+
}
|
|
78
|
+
type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
|
|
79
|
+
[K in keyof T]: T[K] extends TReadonlyOptional<TSchema> ? K : never;
|
|
80
|
+
}[keyof T];
|
|
81
|
+
type ReadonlyPropertyKeys<T extends TProperties> = {
|
|
82
|
+
[K in keyof T]: T[K] extends TReadonly<TSchema> ? K : never;
|
|
83
|
+
}[keyof T];
|
|
84
|
+
type OptionalPropertyKeys<T extends TProperties> = {
|
|
85
|
+
[K in keyof T]: T[K] extends TOptional<TSchema> ? K : never;
|
|
86
|
+
}[keyof T];
|
|
87
|
+
type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
|
|
88
|
+
type PropertiesReducer<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
|
|
89
|
+
type PropertiesReduce<T extends TProperties, P extends unknown[]> = PropertiesReducer<T, {
|
|
90
|
+
[K in keyof T]: Static<T[K], P>;
|
|
91
|
+
}>;
|
|
92
|
+
type TProperties = Record<keyof any, TSchema>;
|
|
93
|
+
type TAdditionalProperties = undefined | TSchema | boolean;
|
|
94
|
+
interface ObjectOptions extends SchemaOptions {
|
|
95
|
+
additionalProperties?: TAdditionalProperties;
|
|
96
|
+
minProperties?: number;
|
|
97
|
+
maxProperties?: number;
|
|
98
|
+
}
|
|
99
|
+
interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
|
|
100
|
+
[Kind]: 'Object';
|
|
101
|
+
static: PropertiesReduce<T, this['params']>;
|
|
102
|
+
additionalProperties?: TAdditionalProperties;
|
|
103
|
+
type: 'object';
|
|
104
|
+
properties: T;
|
|
105
|
+
required?: string[];
|
|
106
|
+
}
|
|
107
|
+
interface StringOptions<Format extends string> extends SchemaOptions {
|
|
108
|
+
minLength?: number;
|
|
109
|
+
maxLength?: number;
|
|
110
|
+
pattern?: string;
|
|
111
|
+
format?: Format;
|
|
112
|
+
contentEncoding?: '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64';
|
|
113
|
+
contentMediaType?: string;
|
|
114
|
+
}
|
|
115
|
+
interface TString<Format extends string = string> extends TSchema, StringOptions<Format> {
|
|
116
|
+
[Kind]: 'String';
|
|
117
|
+
static: string;
|
|
118
|
+
type: 'string';
|
|
119
|
+
}
|
|
120
|
+
/** Creates a TypeScript static type from a TypeBox type */
|
|
121
|
+
type Static<T extends TSchema, P extends unknown[] = []> = (T & {
|
|
122
|
+
params: P;
|
|
129
123
|
})['static'];
|
|
130
124
|
|
|
131
125
|
/**
|
|
@@ -136,59 +130,51 @@ type Static<T extends TSchema, P extends unknown[] = []> = (T & {
|
|
|
136
130
|
*/
|
|
137
131
|
|
|
138
132
|
|
|
139
|
-
declare const RawSnapshotFormat:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
>;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
prop: TReadonly<TString<string>>;
|
|
185
|
-
tag: TReadonly<TString<string>>;
|
|
186
|
-
value: TReadonly<TString<string>>;
|
|
187
|
-
}>
|
|
188
|
-
>
|
|
189
|
-
>;
|
|
190
|
-
}>
|
|
191
|
-
>;
|
|
133
|
+
declare const RawSnapshotFormat: TObject<{
|
|
134
|
+
callToJSON: TReadonlyOptional<TBoolean>;
|
|
135
|
+
compareKeys: TReadonlyOptional<TNull>;
|
|
136
|
+
escapeRegex: TReadonlyOptional<TBoolean>;
|
|
137
|
+
escapeString: TReadonlyOptional<TBoolean>;
|
|
138
|
+
highlight: TReadonlyOptional<TBoolean>;
|
|
139
|
+
indent: TReadonlyOptional<TNumber>;
|
|
140
|
+
maxDepth: TReadonlyOptional<TNumber>;
|
|
141
|
+
maxWidth: TReadonlyOptional<TNumber>;
|
|
142
|
+
min: TReadonlyOptional<TBoolean>;
|
|
143
|
+
printBasicPrototype: TReadonlyOptional<TBoolean>;
|
|
144
|
+
printFunctionName: TReadonlyOptional<TBoolean>;
|
|
145
|
+
theme: TReadonlyOptional<
|
|
146
|
+
TObject<{
|
|
147
|
+
comment: TReadonlyOptional<TString<string>>;
|
|
148
|
+
content: TReadonlyOptional<TString<string>>;
|
|
149
|
+
prop: TReadonlyOptional<TString<string>>;
|
|
150
|
+
tag: TReadonlyOptional<TString<string>>;
|
|
151
|
+
value: TReadonlyOptional<TString<string>>;
|
|
152
|
+
}>
|
|
153
|
+
>;
|
|
154
|
+
}>;
|
|
155
|
+
|
|
156
|
+
declare const SnapshotFormat: TObject<{
|
|
157
|
+
callToJSON: TReadonlyOptional<TBoolean>;
|
|
158
|
+
compareKeys: TReadonlyOptional<TNull>;
|
|
159
|
+
escapeRegex: TReadonlyOptional<TBoolean>;
|
|
160
|
+
escapeString: TReadonlyOptional<TBoolean>;
|
|
161
|
+
highlight: TReadonlyOptional<TBoolean>;
|
|
162
|
+
indent: TReadonlyOptional<TNumber>;
|
|
163
|
+
maxDepth: TReadonlyOptional<TNumber>;
|
|
164
|
+
maxWidth: TReadonlyOptional<TNumber>;
|
|
165
|
+
min: TReadonlyOptional<TBoolean>;
|
|
166
|
+
printBasicPrototype: TReadonlyOptional<TBoolean>;
|
|
167
|
+
printFunctionName: TReadonlyOptional<TBoolean>;
|
|
168
|
+
theme: TReadonlyOptional<
|
|
169
|
+
TObject<{
|
|
170
|
+
comment: TReadonlyOptional<TString<string>>;
|
|
171
|
+
content: TReadonlyOptional<TString<string>>;
|
|
172
|
+
prop: TReadonlyOptional<TString<string>>;
|
|
173
|
+
tag: TReadonlyOptional<TString<string>>;
|
|
174
|
+
value: TReadonlyOptional<TString<string>>;
|
|
175
|
+
}>
|
|
176
|
+
>;
|
|
177
|
+
}>;
|
|
192
178
|
|
|
193
179
|
declare type SnapshotFormat = Static<typeof RawSnapshotFormat>;
|
|
194
180
|
|
|
@@ -302,16 +288,6 @@ declare type Refs = Array<unknown>;
|
|
|
302
288
|
|
|
303
289
|
declare type Test = (arg0: any) => boolean;
|
|
304
290
|
|
|
305
|
-
// Type definitions for @sinonjs/fake-timers 8.1
|
|
306
|
-
// Project: https://github.com/sinonjs/fake-timers
|
|
307
|
-
// Definitions by: Wim Looman <https://github.com/Nemo157>
|
|
308
|
-
// Rogier Schouten <https://github.com/rogierschouten>
|
|
309
|
-
// Yishai Zehavi <https://github.com/zyishai>
|
|
310
|
-
// Remco Haszing <https://github.com/remcohaszing>
|
|
311
|
-
// Jaden Simon <https://github.com/JadenSimon>
|
|
312
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
313
|
-
// TypeScript Version: 2.3
|
|
314
|
-
|
|
315
291
|
/**
|
|
316
292
|
* Names of clock methods that may be faked by install.
|
|
317
293
|
*/
|
|
@@ -496,23 +472,25 @@ declare class WorkspaceProject {
|
|
|
496
472
|
typechecker?: Typechecker;
|
|
497
473
|
closingPromise: Promise<unknown> | undefined;
|
|
498
474
|
browserProvider: BrowserProvider | undefined;
|
|
499
|
-
testFilesList: string[];
|
|
500
|
-
private _globalSetupInit;
|
|
475
|
+
testFilesList: string[] | null;
|
|
501
476
|
private _globalSetups;
|
|
477
|
+
private _provided;
|
|
502
478
|
constructor(path: string | number, ctx: Vitest);
|
|
503
479
|
getName(): string;
|
|
504
480
|
isCore(): boolean;
|
|
481
|
+
provide: (key: string, value: unknown) => void;
|
|
482
|
+
getProvidedContext(): ProvidedContext;
|
|
505
483
|
initializeGlobalSetup(): Promise<void>;
|
|
506
484
|
teardownGlobalSetup(): Promise<void>;
|
|
507
485
|
get logger(): Logger;
|
|
508
486
|
getModulesByFilepath(file: string): Set<vite.ModuleNode>;
|
|
509
487
|
getModuleById(id: string): vite.ModuleNode | undefined;
|
|
510
|
-
getSourceMapModuleById(id: string):
|
|
511
|
-
getBrowserSourceMapModuleById(id: string):
|
|
488
|
+
getSourceMapModuleById(id: string): TransformResult$1['map'] | undefined;
|
|
489
|
+
getBrowserSourceMapModuleById(id: string): TransformResult$1['map'] | undefined;
|
|
512
490
|
get reporters(): Reporter[];
|
|
513
491
|
globTestFiles(filters?: string[]): Promise<string[]>;
|
|
514
|
-
globAllTestFiles(
|
|
515
|
-
isTestFile(id: string): boolean;
|
|
492
|
+
globAllTestFiles(include: string[], exclude: string[], includeSource: string[] | undefined, cwd: string): Promise<string[]>;
|
|
493
|
+
isTestFile(id: string): boolean | null;
|
|
516
494
|
globFiles(include: string[], exclude: string[], cwd: string): Promise<string[]>;
|
|
517
495
|
isTargetFile(id: string, source?: string): Promise<boolean>;
|
|
518
496
|
isInSourceTestFile(code: string): boolean;
|
|
@@ -558,7 +536,7 @@ interface BrowserConfigOptions {
|
|
|
558
536
|
*
|
|
559
537
|
* @default 'webdriverio'
|
|
560
538
|
*/
|
|
561
|
-
provider?: 'webdriverio' | 'playwright' | (string & {});
|
|
539
|
+
provider?: 'webdriverio' | 'playwright' | 'none' | (string & {});
|
|
562
540
|
/**
|
|
563
541
|
* Options that are passed down to a browser provider.
|
|
564
542
|
* To support type hinting, add one of the types to your tsconfig.json "compilerOptions.types" field:
|
|
@@ -604,11 +582,111 @@ interface ResolvedBrowserOptions extends BrowserConfigOptions {
|
|
|
604
582
|
api: ApiConfig;
|
|
605
583
|
}
|
|
606
584
|
|
|
585
|
+
type BuiltinPool = 'browser' | 'threads' | 'forks' | 'vmThreads' | 'typescript';
|
|
586
|
+
type Pool = BuiltinPool | (string & {});
|
|
587
|
+
interface PoolOptions extends Record<string, unknown> {
|
|
588
|
+
/**
|
|
589
|
+
* Run tests in `node:worker_threads`.
|
|
590
|
+
*
|
|
591
|
+
* Test isolation (when enabled) is done by spawning a new thread for each test file.
|
|
592
|
+
*
|
|
593
|
+
* This pool is used by default.
|
|
594
|
+
*/
|
|
595
|
+
threads?: ThreadsOptions & WorkerContextOptions;
|
|
596
|
+
/**
|
|
597
|
+
* Run tests in `node:child_process` using [`fork()`](https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options)
|
|
598
|
+
*
|
|
599
|
+
* Test isolation (when enabled) is done by spawning a new child process for each test file.
|
|
600
|
+
*/
|
|
601
|
+
forks?: ForksOptions & WorkerContextOptions;
|
|
602
|
+
/**
|
|
603
|
+
* Run tests in isolated `node:vm`.
|
|
604
|
+
* Test files are run parallel using `node:worker_threads`.
|
|
605
|
+
*
|
|
606
|
+
* This makes tests run faster, but VM module is unstable. Your tests might leak memory.
|
|
607
|
+
*/
|
|
608
|
+
vmThreads?: ThreadsOptions & VmOptions;
|
|
609
|
+
}
|
|
610
|
+
interface ThreadsOptions {
|
|
611
|
+
/** Minimum amount of threads to use */
|
|
612
|
+
minThreads?: number;
|
|
613
|
+
/** Maximum amount of threads to use */
|
|
614
|
+
maxThreads?: number;
|
|
615
|
+
/**
|
|
616
|
+
* Run tests inside a single thread.
|
|
617
|
+
*
|
|
618
|
+
* @default false
|
|
619
|
+
*/
|
|
620
|
+
singleThread?: boolean;
|
|
621
|
+
/**
|
|
622
|
+
* Use Atomics to synchronize threads
|
|
623
|
+
*
|
|
624
|
+
* This can improve performance in some cases, but might cause segfault in older Node versions.
|
|
625
|
+
*
|
|
626
|
+
* @default false
|
|
627
|
+
*/
|
|
628
|
+
useAtomics?: boolean;
|
|
629
|
+
}
|
|
630
|
+
interface ForksOptions {
|
|
631
|
+
/** Minimum amount of child processes to use */
|
|
632
|
+
minForks?: number;
|
|
633
|
+
/** Maximum amount of child processes to use */
|
|
634
|
+
maxForks?: number;
|
|
635
|
+
/**
|
|
636
|
+
* Run tests inside a single fork.
|
|
637
|
+
*
|
|
638
|
+
* @default false
|
|
639
|
+
*/
|
|
640
|
+
singleFork?: boolean;
|
|
641
|
+
}
|
|
642
|
+
interface WorkerContextOptions {
|
|
643
|
+
/**
|
|
644
|
+
* Isolate test environment by recycling `worker_threads` or `child_process` after each test
|
|
645
|
+
*
|
|
646
|
+
* @default true
|
|
647
|
+
*/
|
|
648
|
+
isolate?: boolean;
|
|
649
|
+
/**
|
|
650
|
+
* Pass additional arguments to `node` process when spawning `worker_threads` or `child_process`.
|
|
651
|
+
*
|
|
652
|
+
* See [Command-line API | Node.js](https://nodejs.org/docs/latest/api/cli.html) for more information.
|
|
653
|
+
*
|
|
654
|
+
* Set to `process.execArgv` to pass all arguments of the current process.
|
|
655
|
+
*
|
|
656
|
+
* Be careful when using, it as some options may crash worker, e.g. --prof, --title. See https://github.com/nodejs/node/issues/41103
|
|
657
|
+
*
|
|
658
|
+
* @default [] // no execution arguments are passed
|
|
659
|
+
*/
|
|
660
|
+
execArgv?: string[];
|
|
661
|
+
}
|
|
662
|
+
interface VmOptions {
|
|
663
|
+
/**
|
|
664
|
+
* Specifies the memory limit for `worker_thread` or `child_process` before they are recycled.
|
|
665
|
+
* If you see memory leaks, try to tinker this value.
|
|
666
|
+
*/
|
|
667
|
+
memoryLimit?: string | number;
|
|
668
|
+
/** Isolation is always enabled */
|
|
669
|
+
isolate?: true;
|
|
670
|
+
/**
|
|
671
|
+
* Pass additional arguments to `node` process when spawning `worker_threads` or `child_process`.
|
|
672
|
+
*
|
|
673
|
+
* See [Command-line API | Node.js](https://nodejs.org/docs/latest/api/cli.html) for more information.
|
|
674
|
+
*
|
|
675
|
+
* Set to `process.execArgv` to pass all arguments of the current process.
|
|
676
|
+
*
|
|
677
|
+
* Be careful when using, it as some options may crash worker, e.g. --prof, --title. See https://github.com/nodejs/node/issues/41103
|
|
678
|
+
*
|
|
679
|
+
* @default [] // no execution arguments are passed
|
|
680
|
+
*/
|
|
681
|
+
execArgv?: string[];
|
|
682
|
+
}
|
|
683
|
+
|
|
607
684
|
type WorkspaceSpec = [project: WorkspaceProject, testFile: string];
|
|
608
|
-
type RunWithFiles = (files: WorkspaceSpec[], invalidates?: string[]) =>
|
|
685
|
+
type RunWithFiles = (files: WorkspaceSpec[], invalidates?: string[]) => Awaitable$1<void>;
|
|
609
686
|
interface ProcessPool {
|
|
687
|
+
name: string;
|
|
610
688
|
runTests: RunWithFiles;
|
|
611
|
-
close
|
|
689
|
+
close?: () => Awaitable$1<void>;
|
|
612
690
|
}
|
|
613
691
|
|
|
614
692
|
type Awaitable<T> = T | PromiseLike<T>;
|
|
@@ -654,6 +732,8 @@ interface ModuleGraphData {
|
|
|
654
732
|
inlined: string[];
|
|
655
733
|
}
|
|
656
734
|
type OnServerRestartHandler = (reason?: string) => Promise<void> | void;
|
|
735
|
+
interface ProvidedContext {
|
|
736
|
+
}
|
|
657
737
|
|
|
658
738
|
declare class StateManager {
|
|
659
739
|
filesMap: Map<string, File[]>;
|
|
@@ -686,7 +766,7 @@ declare class StateManager {
|
|
|
686
766
|
updateTasks(packs: TaskResultPack[]): void;
|
|
687
767
|
updateUserLog(log: UserConsoleLog): void;
|
|
688
768
|
getCountOfFailedTests(): number;
|
|
689
|
-
cancelFiles(files: string[], root: string): void;
|
|
769
|
+
cancelFiles(files: string[], root: string, projectName: string): void;
|
|
690
770
|
}
|
|
691
771
|
|
|
692
772
|
interface SuiteResultCache {
|
|
@@ -1043,15 +1123,6 @@ type BuiltinReporters = keyof typeof ReportersMap;
|
|
|
1043
1123
|
|
|
1044
1124
|
type ChaiConfig = Omit<Partial<typeof chai.config>, 'useProxy' | 'proxyExcludedKeys'>;
|
|
1045
1125
|
|
|
1046
|
-
// Type definitions for istanbul-lib-report 3.0
|
|
1047
|
-
// Project: https://istanbul.js.org, https://github.com/istanbuljs/istanbuljs
|
|
1048
|
-
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
|
|
1049
|
-
// Zacharias Björngren <https://github.com/zache>
|
|
1050
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
1051
|
-
// TypeScript Version: 2.4
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
1126
|
interface Node {
|
|
1056
1127
|
isRoot(): boolean;
|
|
1057
1128
|
visit(visitor: Visitor, state: any): void;
|
|
@@ -1065,15 +1136,6 @@ interface Visitor<N extends Node = Node> {
|
|
|
1065
1136
|
onEnd(root: N, state: any): void;
|
|
1066
1137
|
}
|
|
1067
1138
|
|
|
1068
|
-
// Type definitions for istanbul-reports 3.0
|
|
1069
|
-
// Project: https://github.com/istanbuljs/istanbuljs, https://istanbul.js.org
|
|
1070
|
-
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
|
|
1071
|
-
// Elena Shcherbakova <https://github.com/not-a-doctor>
|
|
1072
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
1073
|
-
// TypeScript Version: 2.4
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
1139
|
interface FileOptions {
|
|
1078
1140
|
file: string;
|
|
1079
1141
|
}
|
|
@@ -1085,17 +1147,17 @@ interface ProjectOptions {
|
|
|
1085
1147
|
interface ReportOptions {
|
|
1086
1148
|
clover: CloverOptions;
|
|
1087
1149
|
cobertura: CoberturaOptions;
|
|
1088
|
-
|
|
1150
|
+
"html-spa": HtmlSpaOptions;
|
|
1089
1151
|
html: HtmlOptions;
|
|
1090
1152
|
json: JsonOptions;
|
|
1091
|
-
|
|
1153
|
+
"json-summary": JsonSummaryOptions;
|
|
1092
1154
|
lcov: LcovOptions;
|
|
1093
1155
|
lcovonly: LcovOnlyOptions;
|
|
1094
1156
|
none: never;
|
|
1095
1157
|
teamcity: TeamcityOptions;
|
|
1096
1158
|
text: TextOptions;
|
|
1097
|
-
|
|
1098
|
-
|
|
1159
|
+
"text-lcov": TextLcovOptions;
|
|
1160
|
+
"text-summary": TextSummaryOptions;
|
|
1099
1161
|
}
|
|
1100
1162
|
|
|
1101
1163
|
interface CloverOptions extends FileOptions, ProjectOptions {}
|
|
@@ -1103,7 +1165,7 @@ interface CloverOptions extends FileOptions, ProjectOptions {}
|
|
|
1103
1165
|
interface CoberturaOptions extends FileOptions, ProjectOptions {}
|
|
1104
1166
|
|
|
1105
1167
|
interface HtmlSpaOptions extends HtmlOptions {
|
|
1106
|
-
metricsToShow: Array<
|
|
1168
|
+
metricsToShow: Array<"lines" | "branches" | "functions" | "statements">;
|
|
1107
1169
|
}
|
|
1108
1170
|
interface HtmlOptions {
|
|
1109
1171
|
verbose: boolean;
|
|
@@ -1172,9 +1234,9 @@ interface RuntimeRPC {
|
|
|
1172
1234
|
onPathsCollected: (paths: string[]) => void;
|
|
1173
1235
|
onUserConsoleLog: (log: UserConsoleLog) => void;
|
|
1174
1236
|
onUnhandledError: (err: unknown, type: string) => void;
|
|
1175
|
-
onCollected: (files: File[]) => void
|
|
1237
|
+
onCollected: (files: File[]) => Promise<void>;
|
|
1176
1238
|
onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void;
|
|
1177
|
-
onTaskUpdate: (pack: TaskResultPack[]) => void
|
|
1239
|
+
onTaskUpdate: (pack: TaskResultPack[]) => Promise<void>;
|
|
1178
1240
|
onCancel: (reason: CancelReason) => void;
|
|
1179
1241
|
getCountOfFailedTests: () => number;
|
|
1180
1242
|
snapshotSaved: (snapshot: SnapshotResult) => void;
|
|
@@ -1199,6 +1261,7 @@ interface ContextRPC {
|
|
|
1199
1261
|
files: string[];
|
|
1200
1262
|
invalidates?: string[];
|
|
1201
1263
|
environment: ContextTestEnvironment;
|
|
1264
|
+
providedContext: Record<string, any>;
|
|
1202
1265
|
}
|
|
1203
1266
|
|
|
1204
1267
|
interface WorkerContext extends ContextRPC {
|
|
@@ -1223,6 +1286,7 @@ interface WorkerGlobalState {
|
|
|
1223
1286
|
onCancel: Promise<CancelReason>;
|
|
1224
1287
|
moduleCache: ModuleCacheMap;
|
|
1225
1288
|
mockMap: MockMap;
|
|
1289
|
+
providedContext: Record<string, any>;
|
|
1226
1290
|
durations: {
|
|
1227
1291
|
environment: number;
|
|
1228
1292
|
prepare: number;
|
|
@@ -1293,14 +1357,14 @@ interface BaseCoverageOptions {
|
|
|
1293
1357
|
*/
|
|
1294
1358
|
include?: string[];
|
|
1295
1359
|
/**
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1360
|
+
* Extensions for files to be included in coverage
|
|
1361
|
+
*
|
|
1362
|
+
* @default ['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx', '.vue', '.svelte', '.marko']
|
|
1363
|
+
*/
|
|
1300
1364
|
extension?: string | string[];
|
|
1301
1365
|
/**
|
|
1302
|
-
|
|
1303
|
-
|
|
1366
|
+
* List of files excluded from coverage as glob patterns
|
|
1367
|
+
*/
|
|
1304
1368
|
exclude?: string[];
|
|
1305
1369
|
/**
|
|
1306
1370
|
* Whether to include all files, including the untested ones into report
|
|
@@ -1338,36 +1402,29 @@ interface BaseCoverageOptions {
|
|
|
1338
1402
|
*/
|
|
1339
1403
|
skipFull?: boolean;
|
|
1340
1404
|
/**
|
|
1341
|
-
*
|
|
1342
|
-
* See `lines`, `functions`, `branches` and `statements` for the actual thresholds.
|
|
1343
|
-
*
|
|
1344
|
-
* @default false
|
|
1345
|
-
*/
|
|
1346
|
-
perFile?: boolean;
|
|
1347
|
-
/**
|
|
1348
|
-
* Threshold for lines
|
|
1349
|
-
*
|
|
1350
|
-
* @default undefined
|
|
1351
|
-
*/
|
|
1352
|
-
lines?: number;
|
|
1353
|
-
/**
|
|
1354
|
-
* Threshold for functions
|
|
1355
|
-
*
|
|
1356
|
-
* @default undefined
|
|
1357
|
-
*/
|
|
1358
|
-
functions?: number;
|
|
1359
|
-
/**
|
|
1360
|
-
* Threshold for branches
|
|
1405
|
+
* Configurations for thresholds
|
|
1361
1406
|
*
|
|
1362
|
-
* @
|
|
1363
|
-
*/
|
|
1364
|
-
branches?: number;
|
|
1365
|
-
/**
|
|
1366
|
-
* Threshold for statements
|
|
1407
|
+
* @example
|
|
1367
1408
|
*
|
|
1368
|
-
*
|
|
1369
|
-
|
|
1370
|
-
|
|
1409
|
+
* ```ts
|
|
1410
|
+
* {
|
|
1411
|
+
* // Thresholds for all files
|
|
1412
|
+
* functions: 95,
|
|
1413
|
+
* branches: 70,
|
|
1414
|
+
* perFile: true,
|
|
1415
|
+
* autoUpdate: true,
|
|
1416
|
+
*
|
|
1417
|
+
* // Thresholds for utilities
|
|
1418
|
+
* 'src/utils/**.ts': {
|
|
1419
|
+
* lines: 100,
|
|
1420
|
+
* statements: 95,
|
|
1421
|
+
* }
|
|
1422
|
+
* }
|
|
1423
|
+
* ```
|
|
1424
|
+
*/
|
|
1425
|
+
thresholds?: Thresholds | ({
|
|
1426
|
+
[glob: string]: Pick<Thresholds, 'statements' | 'functions' | 'branches' | 'lines'>;
|
|
1427
|
+
} & Thresholds);
|
|
1371
1428
|
/**
|
|
1372
1429
|
* Watermarks for statements, lines, branches and functions.
|
|
1373
1430
|
*
|
|
@@ -1379,12 +1436,6 @@ interface BaseCoverageOptions {
|
|
|
1379
1436
|
branches?: [number, number];
|
|
1380
1437
|
lines?: [number, number];
|
|
1381
1438
|
};
|
|
1382
|
-
/**
|
|
1383
|
-
* Update threshold values automatically when current coverage is higher than earlier thresholds
|
|
1384
|
-
*
|
|
1385
|
-
* @default false
|
|
1386
|
-
*/
|
|
1387
|
-
thresholdAutoUpdate?: boolean;
|
|
1388
1439
|
/**
|
|
1389
1440
|
* Generate coverage report even when tests fail.
|
|
1390
1441
|
*
|
|
@@ -1397,12 +1448,6 @@ interface BaseCoverageOptions {
|
|
|
1397
1448
|
* @default false
|
|
1398
1449
|
*/
|
|
1399
1450
|
allowExternal?: boolean;
|
|
1400
|
-
/**
|
|
1401
|
-
* Shortcut for `{ lines: 100, functions: 100, branches: 100, statements: 100 }`
|
|
1402
|
-
*
|
|
1403
|
-
* @default false
|
|
1404
|
-
*/
|
|
1405
|
-
100?: boolean;
|
|
1406
1451
|
}
|
|
1407
1452
|
interface CoverageIstanbulOptions extends BaseCoverageOptions {
|
|
1408
1453
|
/**
|
|
@@ -1418,6 +1463,26 @@ interface CustomProviderOptions extends Pick<BaseCoverageOptions, FieldsWithDefa
|
|
|
1418
1463
|
/** Name of the module or path to a file to load the custom provider from */
|
|
1419
1464
|
customProviderModule: string;
|
|
1420
1465
|
}
|
|
1466
|
+
interface Thresholds {
|
|
1467
|
+
/** Set global thresholds to `100` */
|
|
1468
|
+
100?: boolean;
|
|
1469
|
+
/** Check thresholds per file. */
|
|
1470
|
+
perFile?: boolean;
|
|
1471
|
+
/**
|
|
1472
|
+
* Update threshold values automatically when current coverage is higher than earlier thresholds
|
|
1473
|
+
*
|
|
1474
|
+
* @default false
|
|
1475
|
+
*/
|
|
1476
|
+
autoUpdate?: boolean;
|
|
1477
|
+
/** Thresholds for statements */
|
|
1478
|
+
statements?: number;
|
|
1479
|
+
/** Thresholds for functions */
|
|
1480
|
+
functions?: number;
|
|
1481
|
+
/** Thresholds for branches */
|
|
1482
|
+
branches?: number;
|
|
1483
|
+
/** Thresholds for lines */
|
|
1484
|
+
lines?: number;
|
|
1485
|
+
}
|
|
1421
1486
|
|
|
1422
1487
|
interface JSDOMOptions {
|
|
1423
1488
|
/**
|
|
@@ -1572,80 +1637,6 @@ type BenchmarkAPI = ChainableFunction<'skip' | 'only' | 'todo', [
|
|
|
1572
1637
|
runIf(condition: any): BenchmarkAPI;
|
|
1573
1638
|
};
|
|
1574
1639
|
|
|
1575
|
-
type Pool = 'browser' | 'threads' | 'forks' | 'vmThreads' | 'typescript';
|
|
1576
|
-
interface PoolOptions {
|
|
1577
|
-
/**
|
|
1578
|
-
* Run tests in `node:worker_threads`.
|
|
1579
|
-
*
|
|
1580
|
-
* Test isolation (when enabled) is done by spawning a new thread for each test file.
|
|
1581
|
-
*
|
|
1582
|
-
* This pool is used by default.
|
|
1583
|
-
*/
|
|
1584
|
-
threads?: ThreadsOptions & WorkerContextOptions;
|
|
1585
|
-
/**
|
|
1586
|
-
* Run tests in `node:child_process` using [`fork()`](https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options)
|
|
1587
|
-
*
|
|
1588
|
-
* Test isolation (when enabled) is done by spawning a new child process for each test file.
|
|
1589
|
-
*/
|
|
1590
|
-
forks?: ForksOptions & WorkerContextOptions;
|
|
1591
|
-
/**
|
|
1592
|
-
* Run tests in isolated `node:vm`.
|
|
1593
|
-
* Test files are run parallel using `node:worker_threads`.
|
|
1594
|
-
*
|
|
1595
|
-
* This makes tests run faster, but VM module is unstable. Your tests might leak memory.
|
|
1596
|
-
*/
|
|
1597
|
-
vmThreads?: ThreadsOptions & VmOptions;
|
|
1598
|
-
}
|
|
1599
|
-
interface ThreadsOptions {
|
|
1600
|
-
/** Minimum amount of threads to use */
|
|
1601
|
-
minThreads?: number;
|
|
1602
|
-
/** Maximum amount of threads to use */
|
|
1603
|
-
maxThreads?: number;
|
|
1604
|
-
/**
|
|
1605
|
-
* Run tests inside a single thread.
|
|
1606
|
-
*
|
|
1607
|
-
* @default false
|
|
1608
|
-
*/
|
|
1609
|
-
singleThread?: boolean;
|
|
1610
|
-
/**
|
|
1611
|
-
* Use Atomics to synchronize threads
|
|
1612
|
-
*
|
|
1613
|
-
* This can improve performance in some cases, but might cause segfault in older Node versions.
|
|
1614
|
-
*
|
|
1615
|
-
* @default false
|
|
1616
|
-
*/
|
|
1617
|
-
useAtomics?: boolean;
|
|
1618
|
-
}
|
|
1619
|
-
interface ForksOptions {
|
|
1620
|
-
/** Minimum amount of child processes to use */
|
|
1621
|
-
minForks?: number;
|
|
1622
|
-
/** Maximum amount of child processes to use */
|
|
1623
|
-
maxForks?: number;
|
|
1624
|
-
/**
|
|
1625
|
-
* Run tests inside a single fork.
|
|
1626
|
-
*
|
|
1627
|
-
* @default false
|
|
1628
|
-
*/
|
|
1629
|
-
singleFork?: boolean;
|
|
1630
|
-
}
|
|
1631
|
-
interface WorkerContextOptions {
|
|
1632
|
-
/**
|
|
1633
|
-
* Isolate test environment by recycling `worker_threads` or `child_process` after each test
|
|
1634
|
-
*
|
|
1635
|
-
* @default true
|
|
1636
|
-
*/
|
|
1637
|
-
isolate?: boolean;
|
|
1638
|
-
}
|
|
1639
|
-
interface VmOptions {
|
|
1640
|
-
/**
|
|
1641
|
-
* Specifies the memory limit for `worker_thread` or `child_process` before they are recycled.
|
|
1642
|
-
* If you see memory leaks, try to tinker this value.
|
|
1643
|
-
*/
|
|
1644
|
-
memoryLimit?: string | number;
|
|
1645
|
-
/** Isolation is always enabled */
|
|
1646
|
-
isolate?: true;
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
1640
|
type BuiltinEnvironment = 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime';
|
|
1650
1641
|
type VitestEnvironment = BuiltinEnvironment | (string & Record<never, never>);
|
|
1651
1642
|
|
|
@@ -1813,7 +1804,7 @@ interface InlineConfig {
|
|
|
1813
1804
|
* Benchmark options.
|
|
1814
1805
|
*
|
|
1815
1806
|
* @default {}
|
|
1816
|
-
|
|
1807
|
+
*/
|
|
1817
1808
|
benchmark?: BenchmarkUserOptions;
|
|
1818
1809
|
/**
|
|
1819
1810
|
* Include globs for test files
|
|
@@ -1848,10 +1839,10 @@ interface InlineConfig {
|
|
|
1848
1839
|
*/
|
|
1849
1840
|
dir?: string;
|
|
1850
1841
|
/**
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1842
|
+
* Register apis globally
|
|
1843
|
+
*
|
|
1844
|
+
* @default false
|
|
1845
|
+
*/
|
|
1855
1846
|
globals?: boolean;
|
|
1856
1847
|
/**
|
|
1857
1848
|
* Running environment
|
|
@@ -2030,7 +2021,7 @@ interface InlineConfig {
|
|
|
2030
2021
|
api?: boolean | number | ApiConfig;
|
|
2031
2022
|
/**
|
|
2032
2023
|
* Enable Vitest UI
|
|
2033
|
-
* @internal
|
|
2024
|
+
* @internal
|
|
2034
2025
|
*/
|
|
2035
2026
|
ui?: boolean;
|
|
2036
2027
|
/**
|
|
@@ -2149,7 +2140,7 @@ interface InlineConfig {
|
|
|
2149
2140
|
* The number of milliseconds after which a test is considered slow and reported as such in the results.
|
|
2150
2141
|
*
|
|
2151
2142
|
* @default 300
|
|
2152
|
-
|
|
2143
|
+
*/
|
|
2153
2144
|
slowTestThreshold?: number;
|
|
2154
2145
|
/**
|
|
2155
2146
|
* Path to a custom test runner.
|
|
@@ -2172,7 +2163,7 @@ interface InlineConfig {
|
|
|
2172
2163
|
/**
|
|
2173
2164
|
* Modify default Chai config. Vitest uses Chai for `expect` and `assert` matches.
|
|
2174
2165
|
* https://github.com/chaijs/chai/blob/4.x.x/lib/chai/config.js
|
|
2175
|
-
|
|
2166
|
+
*/
|
|
2176
2167
|
chaiConfig?: ChaiConfig;
|
|
2177
2168
|
/**
|
|
2178
2169
|
* Stop test execution when given number of tests have failed.
|
|
@@ -2182,8 +2173,12 @@ interface InlineConfig {
|
|
|
2182
2173
|
* Retry the test specific number of times if it fails.
|
|
2183
2174
|
*
|
|
2184
2175
|
* @default 0
|
|
2185
|
-
|
|
2176
|
+
*/
|
|
2186
2177
|
retry?: number;
|
|
2178
|
+
/**
|
|
2179
|
+
* Show full diff when snapshot fails instead of a patch.
|
|
2180
|
+
*/
|
|
2181
|
+
expandSnapshotDiff?: boolean;
|
|
2187
2182
|
}
|
|
2188
2183
|
interface TypecheckConfig {
|
|
2189
2184
|
/**
|
|
@@ -2298,6 +2293,7 @@ type ProjectConfig = Omit<UserConfig, 'sequencer' | 'shard' | 'watch' | 'run' |
|
|
|
2298
2293
|
};
|
|
2299
2294
|
type RuntimeConfig = Pick<UserConfig, 'allowOnly' | 'testTimeout' | 'hookTimeout' | 'clearMocks' | 'mockReset' | 'restoreMocks' | 'fakeTimers' | 'maxConcurrency'> & {
|
|
2300
2295
|
sequence?: {
|
|
2296
|
+
concurrent?: boolean;
|
|
2301
2297
|
hooks?: SequenceHooks;
|
|
2302
2298
|
};
|
|
2303
2299
|
};
|
|
@@ -2394,4 +2390,4 @@ type Context = RootAndTarget & {
|
|
|
2394
2390
|
lastActivePath?: string;
|
|
2395
2391
|
};
|
|
2396
2392
|
|
|
2397
|
-
export { type
|
|
2393
|
+
export { type WorkerContext as $, type AfterSuiteRunMeta as A, type BaseCoverageOptions as B, type CoverageV8Options as C, type BuiltinEnvironment as D, type Environment as E, type FakeTimerInstallOpts as F, type VitestEnvironment as G, type HappyDOMOptions as H, type CSSModuleScopeStrategy as I, type JSDOMOptions as J, type ApiConfig as K, type EnvironmentOptions as L, type MockFactoryWithHelper as M, type DepsOptimizationOptions as N, type TransformModePatterns as O, type ProjectConfig as P, type InlineConfig as Q, type ResolvedConfig as R, type TypecheckConfig as S, type TestSequencer as T, type UserConfig as U, type VitestRunMode as V, WorkspaceProject as W, type RunnerRPC as X, type ContextTestEnvironment as Y, type ResolvedTestEnvironment as Z, type ContextRPC as _, type ResolvedCoverageOptions as a, type ResolveIdFunction as a0, type WorkerRPC as a1, type WorkerGlobalState as a2, type Awaitable as a3, type Nullable as a4, type Arrayable as a5, type ArgumentsType$1 as a6, type MutableArray as a7, type Constructable as a8, type ModuleCache as a9, type BuiltinReporters as aA, BenchmarkReportsMap as aB, type BenchmarkBuiltinReporters as aC, type EnvironmentReturn as aa, type VmEnvironmentReturn as ab, type OnServerRestartHandler as ac, type ReportContext as ad, type CoverageReporter as ae, type CoverageIstanbulOptions as af, type CustomProviderOptions as ag, type BenchmarkUserOptions as ah, type Benchmark as ai, type BenchmarkResult as aj, type BenchFunction as ak, type BenchmarkAPI as al, type PendingSuiteMock as am, type MockFactory as an, type MockMap as ao, DefaultReporter as ap, BasicReporter as aq, DotReporter as ar, JsonReporter$1 as as, VerboseReporter as at, TapReporter as au, JUnitReporter as av, TapFlatReporter as aw, HangingProcessReporter as ax, BaseReporter as ay, ReportersMap as az, type CoverageOptions as b, type CoverageProvider as c, type CoverageProviderModule as d, Vitest as e, type ProvidedContext as f, type RuntimeRPC as g, type WorkspaceSpec as h, type ProcessPool as i, type TestSequencerConstructor as j, type BrowserProviderInitializationOptions as k, type BrowserProvider as l, type BrowserProviderOptions as m, type RuntimeConfig as n, type UserConsoleLog as o, type ModuleGraphData as p, type Reporter as q, type RawErrsMap as r, startVitest as s, type TscErrorInfo as t, type CollectLineNumbers as u, type CollectLines as v, type RootAndTarget as w, type Context as x, type Pool as y, type PoolOptions as z };
|