vitest 1.0.0-beta.4 → 1.0.0-beta.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 +1 -513
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +4 -4
- package/dist/child.js +13 -17
- package/dist/{chunk-api-setup.6d19ab38.js → chunks/api-setup.jHV5vgr2.js} +97 -39
- package/dist/chunks/install-pkg.ORGzQeqb.js +457 -0
- package/dist/chunks/integrations-globals.eip0xL77.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.hf2msWA9.js} +1 -1
- package/dist/cli-wrapper.js +2 -18
- package/dist/cli.js +19 -24
- package/dist/config.cjs +1 -1
- package/dist/config.d.ts +4 -6
- package/dist/config.js +1 -1
- package/dist/coverage.d.ts +25 -15
- 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 -1
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/execute.js +3 -3
- package/dist/index.d.ts +168 -39
- package/dist/index.js +10 -10
- package/dist/node.d.ts +5 -5
- package/dist/node.js +17 -22
- package/dist/{vendor-paths.84fc7a99.js → paths.js} +1 -1
- package/dist/{reporters-50c2bd49.d.ts → reporters-vMlHjCdM.d.ts} +335 -365
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +7 -8
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +8 -8
- package/dist/{suite-ad69b7cd.d.ts → suite-vfxzpeqE.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/suite.js +3 -3
- package/dist/{vendor-benchmark.b6befc50.js → vendor/benchmark.WVm6DARl.js} +1 -1
- package/dist/{vendor-date.6e993429.js → vendor/date.Ns1pGd_X.js} +1 -0
- package/dist/{vendor-environments.dcc4a34e.js → vendor/environments.ewIbzajW.js} +2 -1
- package/dist/{vendor-execute.157302d6.js → vendor/execute.aMjV5C9u.js} +2 -4
- package/dist/{vendor-index.72df742e.js → vendor/index.VL3WbvjT.js} +4 -4
- package/dist/{vendor-index.2b92937b.js → vendor/index.XU72Rmy8.js} +1 -1
- package/dist/{vendor-index.57925a34.js → vendor/index.h0j9y5vy.js} +5 -5
- package/dist/vendor/index.xL8XjTLv.js +3962 -0
- package/dist/vendor/loader.-JDdZ5RJ.js +39 -0
- package/dist/{vendor-node.65461b16.js → vendor/node.1xm0UoNi.js} +1904 -5957
- package/dist/{vendor-reporters.d24d80a4.js → vendor/reporters.pr8MinP9.js} +429 -377
- package/dist/{vendor-rpc.171f65fb.js → vendor/rpc.Bl-ysZIr.js} +1 -1
- package/dist/{vendor-run-once.fb836747.js → vendor/run-once.X3E7xx3F.js} +1 -1
- package/dist/{vendor-vi.3baa7c4a.js → vendor/vi.JXuS6emb.js} +4 -4
- package/dist/vm.js +13 -18
- package/dist/worker.js +13 -18
- package/import-meta.d.ts +5 -0
- package/index.cjs +5 -0
- package/package.json +52 -53
- package/dist/chunk-install-pkg.e1d6323e.js +0 -1740
- package/dist/chunk-integrations-globals.2b099e04.js +0 -29
- 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-global.c3664e75.js → vendor/global.L7JRz1qU.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';
|
|
@@ -15,116 +15,111 @@ import { MessagePort } from 'node:worker_threads';
|
|
|
15
15
|
import { Stats } from 'node:fs';
|
|
16
16
|
import * as chai from 'chai';
|
|
17
17
|
|
|
18
|
-
declare const
|
|
19
|
-
declare const Hint: unique symbol;
|
|
20
|
-
declare const
|
|
21
|
-
type
|
|
22
|
-
[
|
|
23
|
-
};
|
|
24
|
-
type
|
|
25
|
-
[Modifier]: '
|
|
26
|
-
};
|
|
27
|
-
type
|
|
28
|
-
[Modifier]: '
|
|
29
|
-
};
|
|
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
|
-
interface
|
|
64
|
-
[Kind]: '
|
|
65
|
-
static:
|
|
66
|
-
type: '
|
|
67
|
-
}
|
|
68
|
-
interface
|
|
69
|
-
[Kind]: '
|
|
70
|
-
static:
|
|
71
|
-
type: '
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
[
|
|
75
|
-
|
|
76
|
-
type
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
[
|
|
91
|
-
}
|
|
92
|
-
type
|
|
93
|
-
|
|
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
|
-
type: 'string';
|
|
124
|
-
}
|
|
125
|
-
/** Creates a static type from a TypeBox type */
|
|
126
|
-
type Static<T extends TSchema, P extends unknown[] = []> = (T & {
|
|
127
|
-
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;
|
|
128
123
|
})['static'];
|
|
129
124
|
|
|
130
125
|
/**
|
|
@@ -135,59 +130,51 @@ type Static<T extends TSchema, P extends unknown[] = []> = (T & {
|
|
|
135
130
|
*/
|
|
136
131
|
|
|
137
132
|
|
|
138
|
-
declare const RawSnapshotFormat:
|
|
139
|
-
|
|
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
|
-
prop: TReadonly<TString<string>>;
|
|
184
|
-
tag: TReadonly<TString<string>>;
|
|
185
|
-
value: TReadonly<TString<string>>;
|
|
186
|
-
}>
|
|
187
|
-
>
|
|
188
|
-
>;
|
|
189
|
-
}>
|
|
190
|
-
>;
|
|
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
|
+
}>;
|
|
191
178
|
|
|
192
179
|
declare type SnapshotFormat = Static<typeof RawSnapshotFormat>;
|
|
193
180
|
|
|
@@ -301,16 +288,6 @@ declare type Refs = Array<unknown>;
|
|
|
301
288
|
|
|
302
289
|
declare type Test = (arg0: any) => boolean;
|
|
303
290
|
|
|
304
|
-
// Type definitions for @sinonjs/fake-timers 8.1
|
|
305
|
-
// Project: https://github.com/sinonjs/fake-timers
|
|
306
|
-
// Definitions by: Wim Looman <https://github.com/Nemo157>
|
|
307
|
-
// Rogier Schouten <https://github.com/rogierschouten>
|
|
308
|
-
// Yishai Zehavi <https://github.com/zyishai>
|
|
309
|
-
// Remco Haszing <https://github.com/remcohaszing>
|
|
310
|
-
// Jaden Simon <https://github.com/JadenSimon>
|
|
311
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
312
|
-
// TypeScript Version: 2.3
|
|
313
|
-
|
|
314
291
|
/**
|
|
315
292
|
* Names of clock methods that may be faked by install.
|
|
316
293
|
*/
|
|
@@ -495,7 +472,7 @@ declare class WorkspaceProject {
|
|
|
495
472
|
typechecker?: Typechecker;
|
|
496
473
|
closingPromise: Promise<unknown> | undefined;
|
|
497
474
|
browserProvider: BrowserProvider | undefined;
|
|
498
|
-
testFilesList: string[];
|
|
475
|
+
testFilesList: string[] | null;
|
|
499
476
|
private _globalSetups;
|
|
500
477
|
private _provided;
|
|
501
478
|
constructor(path: string | number, ctx: Vitest);
|
|
@@ -508,12 +485,12 @@ declare class WorkspaceProject {
|
|
|
508
485
|
get logger(): Logger;
|
|
509
486
|
getModulesByFilepath(file: string): Set<vite.ModuleNode>;
|
|
510
487
|
getModuleById(id: string): vite.ModuleNode | undefined;
|
|
511
|
-
getSourceMapModuleById(id: string):
|
|
512
|
-
getBrowserSourceMapModuleById(id: string):
|
|
488
|
+
getSourceMapModuleById(id: string): TransformResult$1['map'] | undefined;
|
|
489
|
+
getBrowserSourceMapModuleById(id: string): TransformResult$1['map'] | undefined;
|
|
513
490
|
get reporters(): Reporter[];
|
|
514
491
|
globTestFiles(filters?: string[]): Promise<string[]>;
|
|
515
|
-
globAllTestFiles(
|
|
516
|
-
isTestFile(id: string): boolean;
|
|
492
|
+
globAllTestFiles(include: string[], exclude: string[], includeSource: string[] | undefined, cwd: string): Promise<string[]>;
|
|
493
|
+
isTestFile(id: string): boolean | null;
|
|
517
494
|
globFiles(include: string[], exclude: string[], cwd: string): Promise<string[]>;
|
|
518
495
|
isTargetFile(id: string, source?: string): Promise<boolean>;
|
|
519
496
|
isInSourceTestFile(code: string): boolean;
|
|
@@ -605,11 +582,111 @@ interface ResolvedBrowserOptions extends BrowserConfigOptions {
|
|
|
605
582
|
api: ApiConfig;
|
|
606
583
|
}
|
|
607
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
|
+
|
|
608
684
|
type WorkspaceSpec = [project: WorkspaceProject, testFile: string];
|
|
609
|
-
type RunWithFiles = (files: WorkspaceSpec[], invalidates?: string[]) =>
|
|
685
|
+
type RunWithFiles = (files: WorkspaceSpec[], invalidates?: string[]) => Awaitable$1<void>;
|
|
610
686
|
interface ProcessPool {
|
|
687
|
+
name: string;
|
|
611
688
|
runTests: RunWithFiles;
|
|
612
|
-
close
|
|
689
|
+
close?: () => Awaitable$1<void>;
|
|
613
690
|
}
|
|
614
691
|
|
|
615
692
|
type Awaitable<T> = T | PromiseLike<T>;
|
|
@@ -689,7 +766,7 @@ declare class StateManager {
|
|
|
689
766
|
updateTasks(packs: TaskResultPack[]): void;
|
|
690
767
|
updateUserLog(log: UserConsoleLog): void;
|
|
691
768
|
getCountOfFailedTests(): number;
|
|
692
|
-
cancelFiles(files: string[], root: string): void;
|
|
769
|
+
cancelFiles(files: string[], root: string, projectName: string): void;
|
|
693
770
|
}
|
|
694
771
|
|
|
695
772
|
interface SuiteResultCache {
|
|
@@ -771,6 +848,7 @@ declare class Vitest {
|
|
|
771
848
|
restartsCount: number;
|
|
772
849
|
runner: ViteNodeRunner;
|
|
773
850
|
private coreWorkspaceProject;
|
|
851
|
+
private resolvedProjects;
|
|
774
852
|
projects: WorkspaceProject[];
|
|
775
853
|
private projectsTestFiles;
|
|
776
854
|
projectFiles: {
|
|
@@ -798,6 +876,7 @@ declare class Vitest {
|
|
|
798
876
|
runFiles(paths: WorkspaceSpec[]): Promise<void>;
|
|
799
877
|
cancelCurrentRun(reason: CancelReason): Promise<void>;
|
|
800
878
|
rerunFiles(files?: string[], trigger?: string): Promise<void>;
|
|
879
|
+
changeProjectName(pattern: string): Promise<void>;
|
|
801
880
|
changeNamePattern(pattern: string, files?: string[], trigger?: string): Promise<void>;
|
|
802
881
|
changeFilenamePattern(pattern: string): Promise<void>;
|
|
803
882
|
rerunFailed(): Promise<void>;
|
|
@@ -1046,15 +1125,6 @@ type BuiltinReporters = keyof typeof ReportersMap;
|
|
|
1046
1125
|
|
|
1047
1126
|
type ChaiConfig = Omit<Partial<typeof chai.config>, 'useProxy' | 'proxyExcludedKeys'>;
|
|
1048
1127
|
|
|
1049
|
-
// Type definitions for istanbul-lib-report 3.0
|
|
1050
|
-
// Project: https://istanbul.js.org, https://github.com/istanbuljs/istanbuljs
|
|
1051
|
-
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
|
|
1052
|
-
// Zacharias Björngren <https://github.com/zache>
|
|
1053
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
1054
|
-
// TypeScript Version: 2.4
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
1128
|
interface Node {
|
|
1059
1129
|
isRoot(): boolean;
|
|
1060
1130
|
visit(visitor: Visitor, state: any): void;
|
|
@@ -1068,15 +1138,6 @@ interface Visitor<N extends Node = Node> {
|
|
|
1068
1138
|
onEnd(root: N, state: any): void;
|
|
1069
1139
|
}
|
|
1070
1140
|
|
|
1071
|
-
// Type definitions for istanbul-reports 3.0
|
|
1072
|
-
// Project: https://github.com/istanbuljs/istanbuljs, https://istanbul.js.org
|
|
1073
|
-
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
|
|
1074
|
-
// Elena Shcherbakova <https://github.com/not-a-doctor>
|
|
1075
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
1076
|
-
// TypeScript Version: 2.4
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
1141
|
interface FileOptions {
|
|
1081
1142
|
file: string;
|
|
1082
1143
|
}
|
|
@@ -1088,17 +1149,17 @@ interface ProjectOptions {
|
|
|
1088
1149
|
interface ReportOptions {
|
|
1089
1150
|
clover: CloverOptions;
|
|
1090
1151
|
cobertura: CoberturaOptions;
|
|
1091
|
-
|
|
1152
|
+
"html-spa": HtmlSpaOptions;
|
|
1092
1153
|
html: HtmlOptions;
|
|
1093
1154
|
json: JsonOptions;
|
|
1094
|
-
|
|
1155
|
+
"json-summary": JsonSummaryOptions;
|
|
1095
1156
|
lcov: LcovOptions;
|
|
1096
1157
|
lcovonly: LcovOnlyOptions;
|
|
1097
1158
|
none: never;
|
|
1098
1159
|
teamcity: TeamcityOptions;
|
|
1099
1160
|
text: TextOptions;
|
|
1100
|
-
|
|
1101
|
-
|
|
1161
|
+
"text-lcov": TextLcovOptions;
|
|
1162
|
+
"text-summary": TextSummaryOptions;
|
|
1102
1163
|
}
|
|
1103
1164
|
|
|
1104
1165
|
interface CloverOptions extends FileOptions, ProjectOptions {}
|
|
@@ -1106,7 +1167,7 @@ interface CloverOptions extends FileOptions, ProjectOptions {}
|
|
|
1106
1167
|
interface CoberturaOptions extends FileOptions, ProjectOptions {}
|
|
1107
1168
|
|
|
1108
1169
|
interface HtmlSpaOptions extends HtmlOptions {
|
|
1109
|
-
metricsToShow: Array<
|
|
1170
|
+
metricsToShow: Array<"lines" | "branches" | "functions" | "statements">;
|
|
1110
1171
|
}
|
|
1111
1172
|
interface HtmlOptions {
|
|
1112
1173
|
verbose: boolean;
|
|
@@ -1175,9 +1236,9 @@ interface RuntimeRPC {
|
|
|
1175
1236
|
onPathsCollected: (paths: string[]) => void;
|
|
1176
1237
|
onUserConsoleLog: (log: UserConsoleLog) => void;
|
|
1177
1238
|
onUnhandledError: (err: unknown, type: string) => void;
|
|
1178
|
-
onCollected: (files: File[]) => void
|
|
1239
|
+
onCollected: (files: File[]) => Promise<void>;
|
|
1179
1240
|
onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void;
|
|
1180
|
-
onTaskUpdate: (pack: TaskResultPack[]) => void
|
|
1241
|
+
onTaskUpdate: (pack: TaskResultPack[]) => Promise<void>;
|
|
1181
1242
|
onCancel: (reason: CancelReason) => void;
|
|
1182
1243
|
getCountOfFailedTests: () => number;
|
|
1183
1244
|
snapshotSaved: (snapshot: SnapshotResult) => void;
|
|
@@ -1298,14 +1359,14 @@ interface BaseCoverageOptions {
|
|
|
1298
1359
|
*/
|
|
1299
1360
|
include?: string[];
|
|
1300
1361
|
/**
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1362
|
+
* Extensions for files to be included in coverage
|
|
1363
|
+
*
|
|
1364
|
+
* @default ['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx', '.vue', '.svelte', '.marko']
|
|
1365
|
+
*/
|
|
1305
1366
|
extension?: string | string[];
|
|
1306
1367
|
/**
|
|
1307
|
-
|
|
1308
|
-
|
|
1368
|
+
* List of files excluded from coverage as glob patterns
|
|
1369
|
+
*/
|
|
1309
1370
|
exclude?: string[];
|
|
1310
1371
|
/**
|
|
1311
1372
|
* Whether to include all files, including the untested ones into report
|
|
@@ -1343,36 +1404,29 @@ interface BaseCoverageOptions {
|
|
|
1343
1404
|
*/
|
|
1344
1405
|
skipFull?: boolean;
|
|
1345
1406
|
/**
|
|
1346
|
-
*
|
|
1347
|
-
* See `lines`, `functions`, `branches` and `statements` for the actual thresholds.
|
|
1407
|
+
* Configurations for thresholds
|
|
1348
1408
|
*
|
|
1349
|
-
* @
|
|
1350
|
-
*/
|
|
1351
|
-
perFile?: boolean;
|
|
1352
|
-
/**
|
|
1353
|
-
* Threshold for lines
|
|
1354
|
-
*
|
|
1355
|
-
* @default undefined
|
|
1356
|
-
*/
|
|
1357
|
-
lines?: number;
|
|
1358
|
-
/**
|
|
1359
|
-
* Threshold for functions
|
|
1360
|
-
*
|
|
1361
|
-
* @default undefined
|
|
1362
|
-
*/
|
|
1363
|
-
functions?: number;
|
|
1364
|
-
/**
|
|
1365
|
-
* Threshold for branches
|
|
1366
|
-
*
|
|
1367
|
-
* @default undefined
|
|
1368
|
-
*/
|
|
1369
|
-
branches?: number;
|
|
1370
|
-
/**
|
|
1371
|
-
* Threshold for statements
|
|
1409
|
+
* @example
|
|
1372
1410
|
*
|
|
1373
|
-
*
|
|
1374
|
-
|
|
1375
|
-
|
|
1411
|
+
* ```ts
|
|
1412
|
+
* {
|
|
1413
|
+
* // Thresholds for all files
|
|
1414
|
+
* functions: 95,
|
|
1415
|
+
* branches: 70,
|
|
1416
|
+
* perFile: true,
|
|
1417
|
+
* autoUpdate: true,
|
|
1418
|
+
*
|
|
1419
|
+
* // Thresholds for utilities
|
|
1420
|
+
* 'src/utils/**.ts': {
|
|
1421
|
+
* lines: 100,
|
|
1422
|
+
* statements: 95,
|
|
1423
|
+
* }
|
|
1424
|
+
* }
|
|
1425
|
+
* ```
|
|
1426
|
+
*/
|
|
1427
|
+
thresholds?: Thresholds | ({
|
|
1428
|
+
[glob: string]: Pick<Thresholds, 'statements' | 'functions' | 'branches' | 'lines'>;
|
|
1429
|
+
} & Thresholds);
|
|
1376
1430
|
/**
|
|
1377
1431
|
* Watermarks for statements, lines, branches and functions.
|
|
1378
1432
|
*
|
|
@@ -1384,12 +1438,6 @@ interface BaseCoverageOptions {
|
|
|
1384
1438
|
branches?: [number, number];
|
|
1385
1439
|
lines?: [number, number];
|
|
1386
1440
|
};
|
|
1387
|
-
/**
|
|
1388
|
-
* Update threshold values automatically when current coverage is higher than earlier thresholds
|
|
1389
|
-
*
|
|
1390
|
-
* @default false
|
|
1391
|
-
*/
|
|
1392
|
-
thresholdAutoUpdate?: boolean;
|
|
1393
1441
|
/**
|
|
1394
1442
|
* Generate coverage report even when tests fail.
|
|
1395
1443
|
*
|
|
@@ -1402,12 +1450,6 @@ interface BaseCoverageOptions {
|
|
|
1402
1450
|
* @default false
|
|
1403
1451
|
*/
|
|
1404
1452
|
allowExternal?: boolean;
|
|
1405
|
-
/**
|
|
1406
|
-
* Shortcut for `{ lines: 100, functions: 100, branches: 100, statements: 100 }`
|
|
1407
|
-
*
|
|
1408
|
-
* @default false
|
|
1409
|
-
*/
|
|
1410
|
-
100?: boolean;
|
|
1411
1453
|
}
|
|
1412
1454
|
interface CoverageIstanbulOptions extends BaseCoverageOptions {
|
|
1413
1455
|
/**
|
|
@@ -1423,6 +1465,26 @@ interface CustomProviderOptions extends Pick<BaseCoverageOptions, FieldsWithDefa
|
|
|
1423
1465
|
/** Name of the module or path to a file to load the custom provider from */
|
|
1424
1466
|
customProviderModule: string;
|
|
1425
1467
|
}
|
|
1468
|
+
interface Thresholds {
|
|
1469
|
+
/** Set global thresholds to `100` */
|
|
1470
|
+
100?: boolean;
|
|
1471
|
+
/** Check thresholds per file. */
|
|
1472
|
+
perFile?: boolean;
|
|
1473
|
+
/**
|
|
1474
|
+
* Update threshold values automatically when current coverage is higher than earlier thresholds
|
|
1475
|
+
*
|
|
1476
|
+
* @default false
|
|
1477
|
+
*/
|
|
1478
|
+
autoUpdate?: boolean;
|
|
1479
|
+
/** Thresholds for statements */
|
|
1480
|
+
statements?: number;
|
|
1481
|
+
/** Thresholds for functions */
|
|
1482
|
+
functions?: number;
|
|
1483
|
+
/** Thresholds for branches */
|
|
1484
|
+
branches?: number;
|
|
1485
|
+
/** Thresholds for lines */
|
|
1486
|
+
lines?: number;
|
|
1487
|
+
}
|
|
1426
1488
|
|
|
1427
1489
|
interface JSDOMOptions {
|
|
1428
1490
|
/**
|
|
@@ -1568,113 +1630,16 @@ interface BenchmarkResult extends TaskResult {
|
|
|
1568
1630
|
rank: number;
|
|
1569
1631
|
}
|
|
1570
1632
|
type BenchFunction = (this: Bench) => Promise<void> | void;
|
|
1571
|
-
type
|
|
1633
|
+
type ChainableBenchmarkAPI = ChainableFunction<'skip' | 'only' | 'todo', [
|
|
1572
1634
|
name: string | Function,
|
|
1573
1635
|
fn?: BenchFunction,
|
|
1574
1636
|
options?: Options
|
|
1575
|
-
], void
|
|
1576
|
-
|
|
1577
|
-
|
|
1637
|
+
], void>;
|
|
1638
|
+
type BenchmarkAPI = ChainableBenchmarkAPI & {
|
|
1639
|
+
skipIf(condition: any): ChainableBenchmarkAPI;
|
|
1640
|
+
runIf(condition: any): ChainableBenchmarkAPI;
|
|
1578
1641
|
};
|
|
1579
1642
|
|
|
1580
|
-
type Pool = 'browser' | 'threads' | 'forks' | 'vmThreads' | 'typescript';
|
|
1581
|
-
interface PoolOptions {
|
|
1582
|
-
/**
|
|
1583
|
-
* Run tests in `node:worker_threads`.
|
|
1584
|
-
*
|
|
1585
|
-
* Test isolation (when enabled) is done by spawning a new thread for each test file.
|
|
1586
|
-
*
|
|
1587
|
-
* This pool is used by default.
|
|
1588
|
-
*/
|
|
1589
|
-
threads?: ThreadsOptions & WorkerContextOptions;
|
|
1590
|
-
/**
|
|
1591
|
-
* Run tests in `node:child_process` using [`fork()`](https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options)
|
|
1592
|
-
*
|
|
1593
|
-
* Test isolation (when enabled) is done by spawning a new child process for each test file.
|
|
1594
|
-
*/
|
|
1595
|
-
forks?: ForksOptions & WorkerContextOptions;
|
|
1596
|
-
/**
|
|
1597
|
-
* Run tests in isolated `node:vm`.
|
|
1598
|
-
* Test files are run parallel using `node:worker_threads`.
|
|
1599
|
-
*
|
|
1600
|
-
* This makes tests run faster, but VM module is unstable. Your tests might leak memory.
|
|
1601
|
-
*/
|
|
1602
|
-
vmThreads?: ThreadsOptions & VmOptions;
|
|
1603
|
-
}
|
|
1604
|
-
interface ThreadsOptions {
|
|
1605
|
-
/** Minimum amount of threads to use */
|
|
1606
|
-
minThreads?: number;
|
|
1607
|
-
/** Maximum amount of threads to use */
|
|
1608
|
-
maxThreads?: number;
|
|
1609
|
-
/**
|
|
1610
|
-
* Run tests inside a single thread.
|
|
1611
|
-
*
|
|
1612
|
-
* @default false
|
|
1613
|
-
*/
|
|
1614
|
-
singleThread?: boolean;
|
|
1615
|
-
/**
|
|
1616
|
-
* Use Atomics to synchronize threads
|
|
1617
|
-
*
|
|
1618
|
-
* This can improve performance in some cases, but might cause segfault in older Node versions.
|
|
1619
|
-
*
|
|
1620
|
-
* @default false
|
|
1621
|
-
*/
|
|
1622
|
-
useAtomics?: boolean;
|
|
1623
|
-
}
|
|
1624
|
-
interface ForksOptions {
|
|
1625
|
-
/** Minimum amount of child processes to use */
|
|
1626
|
-
minForks?: number;
|
|
1627
|
-
/** Maximum amount of child processes to use */
|
|
1628
|
-
maxForks?: number;
|
|
1629
|
-
/**
|
|
1630
|
-
* Run tests inside a single fork.
|
|
1631
|
-
*
|
|
1632
|
-
* @default false
|
|
1633
|
-
*/
|
|
1634
|
-
singleFork?: boolean;
|
|
1635
|
-
}
|
|
1636
|
-
interface WorkerContextOptions {
|
|
1637
|
-
/**
|
|
1638
|
-
* Isolate test environment by recycling `worker_threads` or `child_process` after each test
|
|
1639
|
-
*
|
|
1640
|
-
* @default true
|
|
1641
|
-
*/
|
|
1642
|
-
isolate?: boolean;
|
|
1643
|
-
/**
|
|
1644
|
-
* Pass additional arguments to `node` process when spawning `worker_threads` or `child_process`.
|
|
1645
|
-
*
|
|
1646
|
-
* See [Command-line API | Node.js](https://nodejs.org/docs/latest/api/cli.html) for more information.
|
|
1647
|
-
*
|
|
1648
|
-
* Set to `process.execArgv` to pass all arguments of the current process.
|
|
1649
|
-
*
|
|
1650
|
-
* Be careful when using, it as some options may crash worker, e.g. --prof, --title. See https://github.com/nodejs/node/issues/41103
|
|
1651
|
-
*
|
|
1652
|
-
* @default [] // no execution arguments are passed
|
|
1653
|
-
*/
|
|
1654
|
-
execArgv?: string[];
|
|
1655
|
-
}
|
|
1656
|
-
interface VmOptions {
|
|
1657
|
-
/**
|
|
1658
|
-
* Specifies the memory limit for `worker_thread` or `child_process` before they are recycled.
|
|
1659
|
-
* If you see memory leaks, try to tinker this value.
|
|
1660
|
-
*/
|
|
1661
|
-
memoryLimit?: string | number;
|
|
1662
|
-
/** Isolation is always enabled */
|
|
1663
|
-
isolate?: true;
|
|
1664
|
-
/**
|
|
1665
|
-
* Pass additional arguments to `node` process when spawning `worker_threads` or `child_process`.
|
|
1666
|
-
*
|
|
1667
|
-
* See [Command-line API | Node.js](https://nodejs.org/docs/latest/api/cli.html) for more information.
|
|
1668
|
-
*
|
|
1669
|
-
* Set to `process.execArgv` to pass all arguments of the current process.
|
|
1670
|
-
*
|
|
1671
|
-
* Be careful when using, it as some options may crash worker, e.g. --prof, --title. See https://github.com/nodejs/node/issues/41103
|
|
1672
|
-
*
|
|
1673
|
-
* @default [] // no execution arguments are passed
|
|
1674
|
-
*/
|
|
1675
|
-
execArgv?: string[];
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
1643
|
type BuiltinEnvironment = 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime';
|
|
1679
1644
|
type VitestEnvironment = BuiltinEnvironment | (string & Record<never, never>);
|
|
1680
1645
|
|
|
@@ -1842,7 +1807,7 @@ interface InlineConfig {
|
|
|
1842
1807
|
* Benchmark options.
|
|
1843
1808
|
*
|
|
1844
1809
|
* @default {}
|
|
1845
|
-
|
|
1810
|
+
*/
|
|
1846
1811
|
benchmark?: BenchmarkUserOptions;
|
|
1847
1812
|
/**
|
|
1848
1813
|
* Include globs for test files
|
|
@@ -1877,10 +1842,10 @@ interface InlineConfig {
|
|
|
1877
1842
|
*/
|
|
1878
1843
|
dir?: string;
|
|
1879
1844
|
/**
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1845
|
+
* Register apis globally
|
|
1846
|
+
*
|
|
1847
|
+
* @default false
|
|
1848
|
+
*/
|
|
1884
1849
|
globals?: boolean;
|
|
1885
1850
|
/**
|
|
1886
1851
|
* Running environment
|
|
@@ -2059,7 +2024,7 @@ interface InlineConfig {
|
|
|
2059
2024
|
api?: boolean | number | ApiConfig;
|
|
2060
2025
|
/**
|
|
2061
2026
|
* Enable Vitest UI
|
|
2062
|
-
* @internal
|
|
2027
|
+
* @internal
|
|
2063
2028
|
*/
|
|
2064
2029
|
ui?: boolean;
|
|
2065
2030
|
/**
|
|
@@ -2178,7 +2143,7 @@ interface InlineConfig {
|
|
|
2178
2143
|
* The number of milliseconds after which a test is considered slow and reported as such in the results.
|
|
2179
2144
|
*
|
|
2180
2145
|
* @default 300
|
|
2181
|
-
|
|
2146
|
+
*/
|
|
2182
2147
|
slowTestThreshold?: number;
|
|
2183
2148
|
/**
|
|
2184
2149
|
* Path to a custom test runner.
|
|
@@ -2201,7 +2166,7 @@ interface InlineConfig {
|
|
|
2201
2166
|
/**
|
|
2202
2167
|
* Modify default Chai config. Vitest uses Chai for `expect` and `assert` matches.
|
|
2203
2168
|
* https://github.com/chaijs/chai/blob/4.x.x/lib/chai/config.js
|
|
2204
|
-
|
|
2169
|
+
*/
|
|
2205
2170
|
chaiConfig?: ChaiConfig;
|
|
2206
2171
|
/**
|
|
2207
2172
|
* Stop test execution when given number of tests have failed.
|
|
@@ -2211,7 +2176,7 @@ interface InlineConfig {
|
|
|
2211
2176
|
* Retry the test specific number of times if it fails.
|
|
2212
2177
|
*
|
|
2213
2178
|
* @default 0
|
|
2214
|
-
|
|
2179
|
+
*/
|
|
2215
2180
|
retry?: number;
|
|
2216
2181
|
/**
|
|
2217
2182
|
* Show full diff when snapshot fails instead of a patch.
|
|
@@ -2288,6 +2253,10 @@ interface UserConfig extends InlineConfig {
|
|
|
2288
2253
|
* @example --shard=2/3
|
|
2289
2254
|
*/
|
|
2290
2255
|
shard?: string;
|
|
2256
|
+
/**
|
|
2257
|
+
* Name of the project or projects to run.
|
|
2258
|
+
*/
|
|
2259
|
+
project?: string | string[];
|
|
2291
2260
|
}
|
|
2292
2261
|
interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters' | 'browser' | 'coverage' | 'testNamePattern' | 'related' | 'api' | 'reporters' | 'resolveSnapshotPath' | 'benchmark' | 'shard' | 'cache' | 'sequence' | 'typecheck' | 'runner' | 'poolOptions' | 'pool'> {
|
|
2293
2262
|
mode: VitestRunMode;
|
|
@@ -2331,6 +2300,7 @@ type ProjectConfig = Omit<UserConfig, 'sequencer' | 'shard' | 'watch' | 'run' |
|
|
|
2331
2300
|
};
|
|
2332
2301
|
type RuntimeConfig = Pick<UserConfig, 'allowOnly' | 'testTimeout' | 'hookTimeout' | 'clearMocks' | 'mockReset' | 'restoreMocks' | 'fakeTimers' | 'maxConcurrency'> & {
|
|
2333
2302
|
sequence?: {
|
|
2303
|
+
concurrent?: boolean;
|
|
2334
2304
|
hooks?: SequenceHooks;
|
|
2335
2305
|
};
|
|
2336
2306
|
};
|
|
@@ -2427,4 +2397,4 @@ type Context = RootAndTarget & {
|
|
|
2427
2397
|
lastActivePath?: string;
|
|
2428
2398
|
};
|
|
2429
2399
|
|
|
2430
|
-
export { type
|
|
2400
|
+
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 };
|