vitest 0.0.139 → 0.1.0
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 +24 -0
- package/dist/cli.js +10 -9
- package/dist/{constants-d24b670d.js → constants-124522a1.js} +2 -2
- package/dist/{diff-5dfc7eb4.js → diff-f7af3876.js} +3 -2
- package/dist/entry.js +196 -47
- package/dist/{global-f971f18f.js → global-23e8ece3.js} +7 -6
- package/dist/index-163994a5.js +9275 -0
- package/dist/index-1b2eb03b.js +187 -0
- package/dist/index-1bb8e174.js +267 -0
- package/dist/{index-314cb4d9.js → index-8c66c440.js} +2 -2
- package/dist/index-fdf40e86.js +8840 -0
- package/dist/index.d.ts +55 -9
- package/dist/index.js +4 -6
- package/dist/node.d.ts +142 -96
- package/dist/node.js +12 -11
- package/dist/{setup-7a362fbc.js → setup-594dd442.js} +72 -80
- package/dist/{vi-567ba572.js → vi-5e16dd69.js} +3 -3
- package/dist/worker.js +214 -191
- package/package.json +9 -7
- package/dist/index-21eabd8a.js +0 -8727
- package/dist/index-64aafe4b.js +0 -396
- package/dist/index-8cb72062.js +0 -9255
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ViteDevServer,
|
|
1
|
+
import { ViteDevServer, TransformResult, CommonServerOptions } from 'vite';
|
|
2
2
|
import { MessagePort } from 'worker_threads';
|
|
3
3
|
import { SpyImpl } from 'tinyspy';
|
|
4
4
|
export { Spy, SpyFn } from 'tinyspy';
|
|
@@ -261,6 +261,37 @@ interface RawSourceMap extends StartOfSourceMap {
|
|
|
261
261
|
mappings: string;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
interface ExternalizeOptions {
|
|
265
|
+
external?: (string | RegExp)[];
|
|
266
|
+
inline?: (string | RegExp)[];
|
|
267
|
+
fallbackCJS?: boolean;
|
|
268
|
+
}
|
|
269
|
+
interface ViteNodeServerOptions {
|
|
270
|
+
deps?: ExternalizeOptions;
|
|
271
|
+
transformMode?: {
|
|
272
|
+
ssr?: RegExp[];
|
|
273
|
+
web?: RegExp[];
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare class ViteNodeServer {
|
|
278
|
+
server: ViteDevServer;
|
|
279
|
+
options: ViteNodeServerOptions;
|
|
280
|
+
promiseMap: Map<string, Promise<TransformResult | null | undefined>>;
|
|
281
|
+
constructor(server: ViteDevServer, options?: ViteNodeServerOptions);
|
|
282
|
+
shouldExternalize(id: string): Promise<string | false>;
|
|
283
|
+
fetchModule(id: string): Promise<{
|
|
284
|
+
externalize: string;
|
|
285
|
+
code?: undefined;
|
|
286
|
+
} | {
|
|
287
|
+
code: string | undefined;
|
|
288
|
+
externalize?: undefined;
|
|
289
|
+
}>;
|
|
290
|
+
transformRequest(id: string): Promise<TransformResult | null | undefined>;
|
|
291
|
+
private getTransformMode;
|
|
292
|
+
private _transformRequest;
|
|
293
|
+
}
|
|
294
|
+
|
|
264
295
|
declare class SnapshotManager {
|
|
265
296
|
config: ResolvedConfig;
|
|
266
297
|
summary: SnapshotSummary;
|
|
@@ -284,6 +315,7 @@ declare class StateManager {
|
|
|
284
315
|
collectFiles(files?: File[]): void;
|
|
285
316
|
updateId(task: Task): void;
|
|
286
317
|
updateTasks(packs: TaskResultPack[]): void;
|
|
318
|
+
updateUserLog(log: UserConsoleLog): void;
|
|
287
319
|
}
|
|
288
320
|
|
|
289
321
|
declare class Vitest {
|
|
@@ -300,12 +332,12 @@ declare class Vitest {
|
|
|
300
332
|
errorStream: NodeJS.WriteStream & {
|
|
301
333
|
fd: 2;
|
|
302
334
|
};
|
|
335
|
+
vitenode: ViteNodeServer;
|
|
303
336
|
invalidates: Set<string>;
|
|
304
337
|
changedTests: Set<string>;
|
|
305
338
|
visitedFilesMap: Map<string, RawSourceMap>;
|
|
306
339
|
runningPromise?: Promise<void>;
|
|
307
340
|
closingPromise?: Promise<void>;
|
|
308
|
-
externalizeCache: Map<string, Promise<string | false>>;
|
|
309
341
|
isFirstRun: boolean;
|
|
310
342
|
restartsCount: number;
|
|
311
343
|
private _onRestartListeners;
|
|
@@ -326,7 +358,6 @@ declare class Vitest {
|
|
|
326
358
|
report<T extends keyof Reporter>(name: T, ...args: ArgumentsType<Reporter[T]>): Promise<void>;
|
|
327
359
|
globTestFiles(filters?: string[]): Promise<string[]>;
|
|
328
360
|
isTargetFile(id: string): boolean;
|
|
329
|
-
shouldExternalize(id: string): Promise<string | false>;
|
|
330
361
|
onServerRestarted(fn: () => void): void;
|
|
331
362
|
}
|
|
332
363
|
|
|
@@ -381,6 +412,14 @@ declare class DotReporter extends BaseReporter {
|
|
|
381
412
|
onUserConsoleLog(log: UserConsoleLog): void;
|
|
382
413
|
}
|
|
383
414
|
|
|
415
|
+
declare class JsonReporter implements Reporter {
|
|
416
|
+
start: number;
|
|
417
|
+
ctx: Vitest;
|
|
418
|
+
onInit(ctx: Vitest): void;
|
|
419
|
+
protected logTasks(files: File[]): void;
|
|
420
|
+
onFinished(files?: File[]): Promise<void>;
|
|
421
|
+
}
|
|
422
|
+
|
|
384
423
|
declare class VerboseReporter extends DefaultReporter {
|
|
385
424
|
constructor();
|
|
386
425
|
}
|
|
@@ -401,6 +440,7 @@ declare const ReportersMap: {
|
|
|
401
440
|
default: typeof DefaultReporter;
|
|
402
441
|
verbose: typeof VerboseReporter;
|
|
403
442
|
dot: typeof DotReporter;
|
|
443
|
+
json: typeof JsonReporter;
|
|
404
444
|
tap: typeof TapReporter;
|
|
405
445
|
'tap-flat': typeof TapFlatReporter;
|
|
406
446
|
};
|
|
@@ -556,6 +596,7 @@ interface UserConsoleLog {
|
|
|
556
596
|
content: string;
|
|
557
597
|
type: 'stdout' | 'stderr';
|
|
558
598
|
taskId?: string;
|
|
599
|
+
time: number;
|
|
559
600
|
}
|
|
560
601
|
interface Position {
|
|
561
602
|
line: number;
|
|
@@ -601,6 +642,7 @@ interface TaskBase {
|
|
|
601
642
|
suite?: Suite;
|
|
602
643
|
file?: File;
|
|
603
644
|
result?: TaskResult;
|
|
645
|
+
logs?: UserConsoleLog[];
|
|
604
646
|
}
|
|
605
647
|
interface TaskResult {
|
|
606
648
|
state: TaskState;
|
|
@@ -845,6 +887,10 @@ interface InlineConfig {
|
|
|
845
887
|
* Path to setup files
|
|
846
888
|
*/
|
|
847
889
|
setupFiles?: string | string[];
|
|
890
|
+
/**
|
|
891
|
+
* Path to global setup files
|
|
892
|
+
*/
|
|
893
|
+
globalSetup?: string | string[];
|
|
848
894
|
/**
|
|
849
895
|
* Pattern of file paths to be ignore from triggering watch rerun
|
|
850
896
|
*
|
|
@@ -919,6 +965,10 @@ interface InlineConfig {
|
|
|
919
965
|
*/
|
|
920
966
|
web?: RegExp[];
|
|
921
967
|
};
|
|
968
|
+
/**
|
|
969
|
+
* Format options for snapshot testing.
|
|
970
|
+
*/
|
|
971
|
+
snapshotFormat?: PrettyFormatOptions;
|
|
922
972
|
}
|
|
923
973
|
interface UserConfig extends InlineConfig {
|
|
924
974
|
/**
|
|
@@ -954,10 +1004,6 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'
|
|
|
954
1004
|
filters?: string[];
|
|
955
1005
|
testNamePattern?: RegExp;
|
|
956
1006
|
related?: string[];
|
|
957
|
-
depsInline: (string | RegExp)[];
|
|
958
|
-
depsExternal: (string | RegExp)[];
|
|
959
|
-
fallbackCJS: boolean;
|
|
960
|
-
interpretDefault: boolean;
|
|
961
1007
|
coverage: ResolvedC8Options;
|
|
962
1008
|
snapshotOptions: SnapshotStateOptions;
|
|
963
1009
|
api?: ApiConfig;
|
|
@@ -977,7 +1023,7 @@ interface WorkerRPC {
|
|
|
977
1023
|
fetch: FetchFunction;
|
|
978
1024
|
getSourceMap: (id: string, force?: boolean) => Promise<RawSourceMap | undefined>;
|
|
979
1025
|
onWorkerExit: (code?: number) => void;
|
|
980
|
-
|
|
1026
|
+
onUserConsoleLog: (log: UserConsoleLog) => void;
|
|
981
1027
|
onCollected: (files: File[]) => void;
|
|
982
1028
|
onTaskUpdate: (pack: TaskResultPack[]) => void;
|
|
983
1029
|
snapshotSaved: (snapshot: SnapshotResult) => void;
|
|
@@ -1168,7 +1214,7 @@ interface WebSocketHandlers {
|
|
|
1168
1214
|
writeFile(id: string, content: string): Promise<void>;
|
|
1169
1215
|
rerun(files: string[]): Promise<void>;
|
|
1170
1216
|
}
|
|
1171
|
-
interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onTaskUpdate'> {
|
|
1217
|
+
interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onTaskUpdate' | 'onUserConsoleLog'> {
|
|
1172
1218
|
}
|
|
1173
1219
|
|
|
1174
1220
|
declare type VitestInlineConfig = InlineConfig;
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
export { d as describe, i as it, c as suite, t as test, e as vi, v as vitest } from './vi-
|
|
2
|
-
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, e as expect } from './index-
|
|
1
|
+
export { d as describe, i as it, c as suite, t as test, e as vi, v as vitest } from './vi-5e16dd69.js';
|
|
2
|
+
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, e as expect } from './index-8c66c440.js';
|
|
3
3
|
export { f as fn, i as isMockFunction, s as spies, a as spyOn } from './jest-mock-6c629944.js';
|
|
4
4
|
export { assert, default as chai, should } from 'chai';
|
|
5
|
-
import './index-
|
|
6
|
-
import 'url';
|
|
5
|
+
import './index-1bb8e174.js';
|
|
7
6
|
import 'tty';
|
|
8
7
|
import 'local-pkg';
|
|
9
|
-
import 'path';
|
|
10
8
|
import './_commonjsHelpers-c9e3b764.js';
|
|
11
9
|
import 'tinyspy';
|
|
12
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OzsifQ==
|
package/dist/node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ViteDevServer, TransformResult, CommonServerOptions, UserConfig as UserConfig$1, Plugin as Plugin$1 } from 'vite';
|
|
2
2
|
|
|
3
3
|
interface StartOfSourceMap {
|
|
4
4
|
file?: string;
|
|
@@ -13,6 +13,124 @@ interface RawSourceMap extends StartOfSourceMap {
|
|
|
13
13
|
mappings: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
interface ExternalizeOptions {
|
|
17
|
+
external?: (string | RegExp)[];
|
|
18
|
+
inline?: (string | RegExp)[];
|
|
19
|
+
fallbackCJS?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface ViteNodeServerOptions {
|
|
22
|
+
deps?: ExternalizeOptions;
|
|
23
|
+
transformMode?: {
|
|
24
|
+
ssr?: RegExp[];
|
|
25
|
+
web?: RegExp[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare class ViteNodeServer {
|
|
30
|
+
server: ViteDevServer;
|
|
31
|
+
options: ViteNodeServerOptions;
|
|
32
|
+
promiseMap: Map<string, Promise<TransformResult | null | undefined>>;
|
|
33
|
+
constructor(server: ViteDevServer, options?: ViteNodeServerOptions);
|
|
34
|
+
shouldExternalize(id: string): Promise<string | false>;
|
|
35
|
+
fetchModule(id: string): Promise<{
|
|
36
|
+
externalize: string;
|
|
37
|
+
code?: undefined;
|
|
38
|
+
} | {
|
|
39
|
+
code: string | undefined;
|
|
40
|
+
externalize?: undefined;
|
|
41
|
+
}>;
|
|
42
|
+
transformRequest(id: string): Promise<TransformResult | null | undefined>;
|
|
43
|
+
private getTransformMode;
|
|
44
|
+
private _transformRequest;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
49
|
+
*
|
|
50
|
+
* This source code is licensed under the MIT license found in the
|
|
51
|
+
* LICENSE file in the root directory of this source tree.
|
|
52
|
+
*/
|
|
53
|
+
declare type Colors = {
|
|
54
|
+
comment: {
|
|
55
|
+
close: string;
|
|
56
|
+
open: string;
|
|
57
|
+
};
|
|
58
|
+
content: {
|
|
59
|
+
close: string;
|
|
60
|
+
open: string;
|
|
61
|
+
};
|
|
62
|
+
prop: {
|
|
63
|
+
close: string;
|
|
64
|
+
open: string;
|
|
65
|
+
};
|
|
66
|
+
tag: {
|
|
67
|
+
close: string;
|
|
68
|
+
open: string;
|
|
69
|
+
};
|
|
70
|
+
value: {
|
|
71
|
+
close: string;
|
|
72
|
+
open: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
declare type Indent = (arg0: string) => string;
|
|
76
|
+
declare type Refs = Array<unknown>;
|
|
77
|
+
declare type Print = (arg0: unknown) => string;
|
|
78
|
+
declare type ThemeReceived = {
|
|
79
|
+
comment?: string;
|
|
80
|
+
content?: string;
|
|
81
|
+
prop?: string;
|
|
82
|
+
tag?: string;
|
|
83
|
+
value?: string;
|
|
84
|
+
};
|
|
85
|
+
declare type CompareKeys = ((a: string, b: string) => number) | undefined;
|
|
86
|
+
interface PrettyFormatOptions {
|
|
87
|
+
callToJSON?: boolean;
|
|
88
|
+
compareKeys?: CompareKeys;
|
|
89
|
+
escapeRegex?: boolean;
|
|
90
|
+
escapeString?: boolean;
|
|
91
|
+
highlight?: boolean;
|
|
92
|
+
indent?: number;
|
|
93
|
+
maxDepth?: number;
|
|
94
|
+
min?: boolean;
|
|
95
|
+
plugins?: Plugins;
|
|
96
|
+
printBasicPrototype?: boolean;
|
|
97
|
+
printFunctionName?: boolean;
|
|
98
|
+
theme?: ThemeReceived;
|
|
99
|
+
}
|
|
100
|
+
declare type OptionsReceived = PrettyFormatOptions;
|
|
101
|
+
declare type Config = {
|
|
102
|
+
callToJSON: boolean;
|
|
103
|
+
compareKeys: CompareKeys;
|
|
104
|
+
colors: Colors;
|
|
105
|
+
escapeRegex: boolean;
|
|
106
|
+
escapeString: boolean;
|
|
107
|
+
indent: string;
|
|
108
|
+
maxDepth: number;
|
|
109
|
+
min: boolean;
|
|
110
|
+
plugins: Plugins;
|
|
111
|
+
printBasicPrototype: boolean;
|
|
112
|
+
printFunctionName: boolean;
|
|
113
|
+
spacingInner: string;
|
|
114
|
+
spacingOuter: string;
|
|
115
|
+
};
|
|
116
|
+
declare type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;
|
|
117
|
+
declare type Test$1 = (arg0: any) => boolean;
|
|
118
|
+
declare type NewPlugin = {
|
|
119
|
+
serialize: (val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
|
|
120
|
+
test: Test$1;
|
|
121
|
+
};
|
|
122
|
+
declare type PluginOptions = {
|
|
123
|
+
edgeSpacing: string;
|
|
124
|
+
min: boolean;
|
|
125
|
+
spacing: string;
|
|
126
|
+
};
|
|
127
|
+
declare type OldPlugin = {
|
|
128
|
+
print: (val: unknown, print: Print, indent: Indent, options: PluginOptions, colors: Colors) => string;
|
|
129
|
+
test: Test$1;
|
|
130
|
+
};
|
|
131
|
+
declare type Plugin = NewPlugin | OldPlugin;
|
|
132
|
+
declare type Plugins = Array<Plugin>;
|
|
133
|
+
|
|
16
134
|
declare abstract class BaseReporter implements Reporter {
|
|
17
135
|
start: number;
|
|
18
136
|
end: number;
|
|
@@ -64,6 +182,14 @@ declare class DotReporter extends BaseReporter {
|
|
|
64
182
|
onUserConsoleLog(log: UserConsoleLog): void;
|
|
65
183
|
}
|
|
66
184
|
|
|
185
|
+
declare class JsonReporter implements Reporter {
|
|
186
|
+
start: number;
|
|
187
|
+
ctx: Vitest;
|
|
188
|
+
onInit(ctx: Vitest): void;
|
|
189
|
+
protected logTasks(files: File[]): void;
|
|
190
|
+
onFinished(files?: File[]): Promise<void>;
|
|
191
|
+
}
|
|
192
|
+
|
|
67
193
|
declare class VerboseReporter extends DefaultReporter {
|
|
68
194
|
constructor();
|
|
69
195
|
}
|
|
@@ -84,6 +210,7 @@ declare const ReportersMap: {
|
|
|
84
210
|
default: typeof DefaultReporter;
|
|
85
211
|
verbose: typeof VerboseReporter;
|
|
86
212
|
dot: typeof DotReporter;
|
|
213
|
+
json: typeof JsonReporter;
|
|
87
214
|
tap: typeof TapReporter;
|
|
88
215
|
'tap-flat': typeof TapFlatReporter;
|
|
89
216
|
};
|
|
@@ -226,6 +353,7 @@ interface UserConsoleLog {
|
|
|
226
353
|
content: string;
|
|
227
354
|
type: 'stdout' | 'stderr';
|
|
228
355
|
taskId?: string;
|
|
356
|
+
time: number;
|
|
229
357
|
}
|
|
230
358
|
interface Position {
|
|
231
359
|
line: number;
|
|
@@ -260,6 +388,7 @@ interface TaskBase {
|
|
|
260
388
|
suite?: Suite;
|
|
261
389
|
file?: File;
|
|
262
390
|
result?: TaskResult;
|
|
391
|
+
logs?: UserConsoleLog[];
|
|
263
392
|
}
|
|
264
393
|
interface TaskResult {
|
|
265
394
|
state: TaskState;
|
|
@@ -275,13 +404,13 @@ interface File extends Suite {
|
|
|
275
404
|
filepath: string;
|
|
276
405
|
collectDuration?: number;
|
|
277
406
|
}
|
|
278
|
-
interface Test
|
|
407
|
+
interface Test extends TaskBase {
|
|
279
408
|
type: 'test';
|
|
280
409
|
suite: Suite;
|
|
281
410
|
result?: TaskResult;
|
|
282
411
|
fails?: boolean;
|
|
283
412
|
}
|
|
284
|
-
declare type Task = Test
|
|
413
|
+
declare type Task = Test | Suite | File;
|
|
285
414
|
|
|
286
415
|
interface Reporter {
|
|
287
416
|
onInit?(ctx: Vitest): void;
|
|
@@ -294,93 +423,6 @@ interface Reporter {
|
|
|
294
423
|
onUserConsoleLog?: (log: UserConsoleLog) => Awaitable<void>;
|
|
295
424
|
}
|
|
296
425
|
|
|
297
|
-
/**
|
|
298
|
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the MIT license found in the
|
|
301
|
-
* LICENSE file in the root directory of this source tree.
|
|
302
|
-
*/
|
|
303
|
-
declare type Colors = {
|
|
304
|
-
comment: {
|
|
305
|
-
close: string;
|
|
306
|
-
open: string;
|
|
307
|
-
};
|
|
308
|
-
content: {
|
|
309
|
-
close: string;
|
|
310
|
-
open: string;
|
|
311
|
-
};
|
|
312
|
-
prop: {
|
|
313
|
-
close: string;
|
|
314
|
-
open: string;
|
|
315
|
-
};
|
|
316
|
-
tag: {
|
|
317
|
-
close: string;
|
|
318
|
-
open: string;
|
|
319
|
-
};
|
|
320
|
-
value: {
|
|
321
|
-
close: string;
|
|
322
|
-
open: string;
|
|
323
|
-
};
|
|
324
|
-
};
|
|
325
|
-
declare type Indent = (arg0: string) => string;
|
|
326
|
-
declare type Refs = Array<unknown>;
|
|
327
|
-
declare type Print = (arg0: unknown) => string;
|
|
328
|
-
declare type ThemeReceived = {
|
|
329
|
-
comment?: string;
|
|
330
|
-
content?: string;
|
|
331
|
-
prop?: string;
|
|
332
|
-
tag?: string;
|
|
333
|
-
value?: string;
|
|
334
|
-
};
|
|
335
|
-
declare type CompareKeys = ((a: string, b: string) => number) | undefined;
|
|
336
|
-
interface PrettyFormatOptions {
|
|
337
|
-
callToJSON?: boolean;
|
|
338
|
-
compareKeys?: CompareKeys;
|
|
339
|
-
escapeRegex?: boolean;
|
|
340
|
-
escapeString?: boolean;
|
|
341
|
-
highlight?: boolean;
|
|
342
|
-
indent?: number;
|
|
343
|
-
maxDepth?: number;
|
|
344
|
-
min?: boolean;
|
|
345
|
-
plugins?: Plugins;
|
|
346
|
-
printBasicPrototype?: boolean;
|
|
347
|
-
printFunctionName?: boolean;
|
|
348
|
-
theme?: ThemeReceived;
|
|
349
|
-
}
|
|
350
|
-
declare type OptionsReceived = PrettyFormatOptions;
|
|
351
|
-
declare type Config = {
|
|
352
|
-
callToJSON: boolean;
|
|
353
|
-
compareKeys: CompareKeys;
|
|
354
|
-
colors: Colors;
|
|
355
|
-
escapeRegex: boolean;
|
|
356
|
-
escapeString: boolean;
|
|
357
|
-
indent: string;
|
|
358
|
-
maxDepth: number;
|
|
359
|
-
min: boolean;
|
|
360
|
-
plugins: Plugins;
|
|
361
|
-
printBasicPrototype: boolean;
|
|
362
|
-
printFunctionName: boolean;
|
|
363
|
-
spacingInner: string;
|
|
364
|
-
spacingOuter: string;
|
|
365
|
-
};
|
|
366
|
-
declare type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;
|
|
367
|
-
declare type Test = (arg0: any) => boolean;
|
|
368
|
-
declare type NewPlugin = {
|
|
369
|
-
serialize: (val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
|
|
370
|
-
test: Test;
|
|
371
|
-
};
|
|
372
|
-
declare type PluginOptions = {
|
|
373
|
-
edgeSpacing: string;
|
|
374
|
-
min: boolean;
|
|
375
|
-
spacing: string;
|
|
376
|
-
};
|
|
377
|
-
declare type OldPlugin = {
|
|
378
|
-
print: (val: unknown, print: Print, indent: Indent, options: PluginOptions, colors: Colors) => string;
|
|
379
|
-
test: Test;
|
|
380
|
-
};
|
|
381
|
-
declare type Plugin = NewPlugin | OldPlugin;
|
|
382
|
-
declare type Plugins = Array<Plugin>;
|
|
383
|
-
|
|
384
426
|
declare type SnapshotUpdateState = 'all' | 'new' | 'none';
|
|
385
427
|
interface SnapshotStateOptions {
|
|
386
428
|
updateSnapshot: SnapshotUpdateState;
|
|
@@ -553,6 +595,10 @@ interface InlineConfig {
|
|
|
553
595
|
* Path to setup files
|
|
554
596
|
*/
|
|
555
597
|
setupFiles?: string | string[];
|
|
598
|
+
/**
|
|
599
|
+
* Path to global setup files
|
|
600
|
+
*/
|
|
601
|
+
globalSetup?: string | string[];
|
|
556
602
|
/**
|
|
557
603
|
* Pattern of file paths to be ignore from triggering watch rerun
|
|
558
604
|
*
|
|
@@ -627,6 +673,10 @@ interface InlineConfig {
|
|
|
627
673
|
*/
|
|
628
674
|
web?: RegExp[];
|
|
629
675
|
};
|
|
676
|
+
/**
|
|
677
|
+
* Format options for snapshot testing.
|
|
678
|
+
*/
|
|
679
|
+
snapshotFormat?: PrettyFormatOptions;
|
|
630
680
|
}
|
|
631
681
|
interface UserConfig extends InlineConfig {
|
|
632
682
|
/**
|
|
@@ -662,10 +712,6 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'
|
|
|
662
712
|
filters?: string[];
|
|
663
713
|
testNamePattern?: RegExp;
|
|
664
714
|
related?: string[];
|
|
665
|
-
depsInline: (string | RegExp)[];
|
|
666
|
-
depsExternal: (string | RegExp)[];
|
|
667
|
-
fallbackCJS: boolean;
|
|
668
|
-
interpretDefault: boolean;
|
|
669
715
|
coverage: ResolvedC8Options;
|
|
670
716
|
snapshotOptions: SnapshotStateOptions;
|
|
671
717
|
api?: ApiConfig;
|
|
@@ -694,6 +740,7 @@ declare class StateManager {
|
|
|
694
740
|
collectFiles(files?: File[]): void;
|
|
695
741
|
updateId(task: Task): void;
|
|
696
742
|
updateTasks(packs: TaskResultPack[]): void;
|
|
743
|
+
updateUserLog(log: UserConsoleLog): void;
|
|
697
744
|
}
|
|
698
745
|
|
|
699
746
|
declare class Vitest {
|
|
@@ -710,12 +757,12 @@ declare class Vitest {
|
|
|
710
757
|
errorStream: NodeJS.WriteStream & {
|
|
711
758
|
fd: 2;
|
|
712
759
|
};
|
|
760
|
+
vitenode: ViteNodeServer;
|
|
713
761
|
invalidates: Set<string>;
|
|
714
762
|
changedTests: Set<string>;
|
|
715
763
|
visitedFilesMap: Map<string, RawSourceMap>;
|
|
716
764
|
runningPromise?: Promise<void>;
|
|
717
765
|
closingPromise?: Promise<void>;
|
|
718
|
-
externalizeCache: Map<string, Promise<string | false>>;
|
|
719
766
|
isFirstRun: boolean;
|
|
720
767
|
restartsCount: number;
|
|
721
768
|
private _onRestartListeners;
|
|
@@ -736,7 +783,6 @@ declare class Vitest {
|
|
|
736
783
|
report<T extends keyof Reporter>(name: T, ...args: ArgumentsType<Reporter[T]>): Promise<void>;
|
|
737
784
|
globTestFiles(filters?: string[]): Promise<string[]>;
|
|
738
785
|
isTargetFile(id: string): boolean;
|
|
739
|
-
shouldExternalize(id: string): Promise<string | false>;
|
|
740
786
|
onServerRestarted(fn: () => void): void;
|
|
741
787
|
}
|
|
742
788
|
|
package/dist/node.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
export { V as VitestPlugin, c as createVitest } from './index-
|
|
1
|
+
export { V as VitestPlugin, c as createVitest } from './index-fdf40e86.js';
|
|
2
2
|
import 'fs';
|
|
3
|
-
import './index-
|
|
4
|
-
import 'url';
|
|
5
|
-
import 'tty';
|
|
6
|
-
import 'local-pkg';
|
|
3
|
+
import './index-1b2eb03b.js';
|
|
7
4
|
import 'path';
|
|
8
5
|
import 'vite';
|
|
9
6
|
import 'process';
|
|
@@ -11,15 +8,19 @@ import 'os';
|
|
|
11
8
|
import 'util';
|
|
12
9
|
import 'stream';
|
|
13
10
|
import 'events';
|
|
14
|
-
import './
|
|
11
|
+
import './index-1bb8e174.js';
|
|
12
|
+
import 'tty';
|
|
13
|
+
import 'local-pkg';
|
|
14
|
+
import './index-163994a5.js';
|
|
15
|
+
import 'module';
|
|
16
|
+
import 'url';
|
|
17
|
+
import 'assert';
|
|
18
|
+
import './constants-124522a1.js';
|
|
15
19
|
import './magic-string.es-94000aea.js';
|
|
16
20
|
import 'perf_hooks';
|
|
17
|
-
import './diff-
|
|
21
|
+
import './diff-f7af3876.js';
|
|
18
22
|
import './index-648e7ab2.js';
|
|
19
23
|
import './_commonjsHelpers-c9e3b764.js';
|
|
20
|
-
import 'assert';
|
|
21
|
-
import 'module';
|
|
22
|
-
import './index-8cb72062.js';
|
|
23
24
|
import 'worker_threads';
|
|
24
25
|
import 'tinypool';
|
|
25
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
|