vitest 0.0.141 → 0.0.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +3 -3
- package/dist/entry.js +9 -7
- package/dist/{global-be63adce.js → global-23e8ece3.js} +3 -3
- package/dist/{index-c037b40c.js → index-163994a5.js} +5 -2
- package/dist/index-1bb8e174.js +1 -1
- package/dist/{index-9387000b.js → index-8c66c440.js} +2 -2
- package/dist/index-fdf40e86.js +8840 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +2 -2
- package/dist/node.d.ts +12 -0
- package/dist/node.js +2 -2
- package/dist/{setup-61d53207.js → setup-594dd442.js} +9 -3
- package/dist/{vi-8d17efa1.js → vi-5e16dd69.js} +2 -2
- package/dist/worker.js +9 -6
- package/package.json +3 -3
- package/dist/index-9a69ca2e.js +0 -8779
package/dist/index.d.ts
CHANGED
|
@@ -315,6 +315,7 @@ declare class StateManager {
|
|
|
315
315
|
collectFiles(files?: File[]): void;
|
|
316
316
|
updateId(task: Task): void;
|
|
317
317
|
updateTasks(packs: TaskResultPack[]): void;
|
|
318
|
+
updateUserLog(log: UserConsoleLog): void;
|
|
318
319
|
}
|
|
319
320
|
|
|
320
321
|
declare class Vitest {
|
|
@@ -411,6 +412,14 @@ declare class DotReporter extends BaseReporter {
|
|
|
411
412
|
onUserConsoleLog(log: UserConsoleLog): void;
|
|
412
413
|
}
|
|
413
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
|
+
|
|
414
423
|
declare class VerboseReporter extends DefaultReporter {
|
|
415
424
|
constructor();
|
|
416
425
|
}
|
|
@@ -431,6 +440,7 @@ declare const ReportersMap: {
|
|
|
431
440
|
default: typeof DefaultReporter;
|
|
432
441
|
verbose: typeof VerboseReporter;
|
|
433
442
|
dot: typeof DotReporter;
|
|
443
|
+
json: typeof JsonReporter;
|
|
434
444
|
tap: typeof TapReporter;
|
|
435
445
|
'tap-flat': typeof TapFlatReporter;
|
|
436
446
|
};
|
|
@@ -586,6 +596,7 @@ interface UserConsoleLog {
|
|
|
586
596
|
content: string;
|
|
587
597
|
type: 'stdout' | 'stderr';
|
|
588
598
|
taskId?: string;
|
|
599
|
+
time: number;
|
|
589
600
|
}
|
|
590
601
|
interface Position {
|
|
591
602
|
line: number;
|
|
@@ -631,6 +642,7 @@ interface TaskBase {
|
|
|
631
642
|
suite?: Suite;
|
|
632
643
|
file?: File;
|
|
633
644
|
result?: TaskResult;
|
|
645
|
+
logs?: UserConsoleLog[];
|
|
634
646
|
}
|
|
635
647
|
interface TaskResult {
|
|
636
648
|
state: TaskState;
|
|
@@ -1011,7 +1023,7 @@ interface WorkerRPC {
|
|
|
1011
1023
|
fetch: FetchFunction;
|
|
1012
1024
|
getSourceMap: (id: string, force?: boolean) => Promise<RawSourceMap | undefined>;
|
|
1013
1025
|
onWorkerExit: (code?: number) => void;
|
|
1014
|
-
|
|
1026
|
+
onUserConsoleLog: (log: UserConsoleLog) => void;
|
|
1015
1027
|
onCollected: (files: File[]) => void;
|
|
1016
1028
|
onTaskUpdate: (pack: TaskResultPack[]) => void;
|
|
1017
1029
|
snapshotSaved: (snapshot: SnapshotResult) => void;
|
|
@@ -1202,7 +1214,7 @@ interface WebSocketHandlers {
|
|
|
1202
1214
|
writeFile(id: string, content: string): Promise<void>;
|
|
1203
1215
|
rerun(files: string[]): Promise<void>;
|
|
1204
1216
|
}
|
|
1205
|
-
interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onTaskUpdate'> {
|
|
1217
|
+
interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onTaskUpdate' | 'onUserConsoleLog'> {
|
|
1206
1218
|
}
|
|
1207
1219
|
|
|
1208
1220
|
declare type VitestInlineConfig = InlineConfig;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
5
|
import './index-1bb8e174.js';
|
package/dist/node.d.ts
CHANGED
|
@@ -182,6 +182,14 @@ declare class DotReporter extends BaseReporter {
|
|
|
182
182
|
onUserConsoleLog(log: UserConsoleLog): void;
|
|
183
183
|
}
|
|
184
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
|
+
|
|
185
193
|
declare class VerboseReporter extends DefaultReporter {
|
|
186
194
|
constructor();
|
|
187
195
|
}
|
|
@@ -202,6 +210,7 @@ declare const ReportersMap: {
|
|
|
202
210
|
default: typeof DefaultReporter;
|
|
203
211
|
verbose: typeof VerboseReporter;
|
|
204
212
|
dot: typeof DotReporter;
|
|
213
|
+
json: typeof JsonReporter;
|
|
205
214
|
tap: typeof TapReporter;
|
|
206
215
|
'tap-flat': typeof TapFlatReporter;
|
|
207
216
|
};
|
|
@@ -344,6 +353,7 @@ interface UserConsoleLog {
|
|
|
344
353
|
content: string;
|
|
345
354
|
type: 'stdout' | 'stderr';
|
|
346
355
|
taskId?: string;
|
|
356
|
+
time: number;
|
|
347
357
|
}
|
|
348
358
|
interface Position {
|
|
349
359
|
line: number;
|
|
@@ -378,6 +388,7 @@ interface TaskBase {
|
|
|
378
388
|
suite?: Suite;
|
|
379
389
|
file?: File;
|
|
380
390
|
result?: TaskResult;
|
|
391
|
+
logs?: UserConsoleLog[];
|
|
381
392
|
}
|
|
382
393
|
interface TaskResult {
|
|
383
394
|
state: TaskState;
|
|
@@ -729,6 +740,7 @@ declare class StateManager {
|
|
|
729
740
|
collectFiles(files?: File[]): void;
|
|
730
741
|
updateId(task: Task): void;
|
|
731
742
|
updateTasks(packs: TaskResultPack[]): void;
|
|
743
|
+
updateUserLog(log: UserConsoleLog): void;
|
|
732
744
|
}
|
|
733
745
|
|
|
734
746
|
declare class Vitest {
|
package/dist/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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
3
|
import './index-1b2eb03b.js';
|
|
4
4
|
import 'path';
|
|
@@ -11,7 +11,7 @@ import 'events';
|
|
|
11
11
|
import './index-1bb8e174.js';
|
|
12
12
|
import 'tty';
|
|
13
13
|
import 'local-pkg';
|
|
14
|
-
import './index-
|
|
14
|
+
import './index-163994a5.js';
|
|
15
15
|
import 'module';
|
|
16
16
|
import 'url';
|
|
17
17
|
import 'assert';
|