vitest 0.1.12 → 0.1.16

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/node.d.ts CHANGED
@@ -141,7 +141,6 @@ declare abstract class BaseReporter implements Reporter {
141
141
  relative(path: string): string;
142
142
  onFinished(files?: File[]): Promise<void>;
143
143
  onTaskUpdate(packs: TaskResultPack[]): void;
144
- isFirstWatchRun: boolean;
145
144
  onWatcherStart(): Promise<void>;
146
145
  onWatcherRerun(files: string[], trigger?: string): Promise<void>;
147
146
  onUserConsoleLog(log: UserConsoleLog): void;
@@ -186,8 +185,14 @@ declare class JsonReporter implements Reporter {
186
185
  start: number;
187
186
  ctx: Vitest;
188
187
  onInit(ctx: Vitest): void;
189
- protected logTasks(files: File[]): void;
188
+ protected logTasks(files: File[]): Promise<void>;
190
189
  onFinished(files?: File[]): Promise<void>;
190
+ /**
191
+ * Writes the report to an output file if specified in the config,
192
+ * or logs it to the console otherwise.
193
+ * @param report
194
+ */
195
+ writeReport(report: string): Promise<void>;
191
196
  }
192
197
 
193
198
  declare class VerboseReporter extends DefaultReporter {
@@ -196,8 +201,11 @@ declare class VerboseReporter extends DefaultReporter {
196
201
 
197
202
  declare class TapReporter implements Reporter {
198
203
  protected ctx: Vitest;
204
+ private logger;
199
205
  onInit(ctx: Vitest): void;
200
- protected logTasks(tasks: Task[], currentIdent: string): void;
206
+ static getComment(task: Task): string;
207
+ private logErrorDetails;
208
+ protected logTasks(tasks: Task[]): void;
201
209
  onFinished(files?: File[]): Promise<void>;
202
210
  }
203
211
 
@@ -261,6 +269,7 @@ interface C8Options {
261
269
  exclude?: string[];
262
270
  include?: string[];
263
271
  skipFull?: boolean;
272
+ extension?: string | string[];
264
273
  }
265
274
  interface ResolvedC8Options extends Required<C8Options> {
266
275
  tempDirectory: string;
@@ -555,6 +564,10 @@ interface InlineConfig {
555
564
  * Custom reporter for output
556
565
  */
557
566
  reporters?: Arrayable<BuiltinReporters | Reporter>;
567
+ /**
568
+ * Write test results to a file when the --reporter=json option is also specified
569
+ */
570
+ outputFile?: string;
558
571
  /**
559
572
  * Enable multi-threading
560
573
  *
@@ -737,6 +750,8 @@ declare class StateManager {
737
750
  idMap: Map<string, Task>;
738
751
  taskFileMap: WeakMap<Task, File>;
739
752
  getFiles(keys?: string[]): File[];
753
+ getFilepaths(): string[];
754
+ getFailedFilepaths(): string[];
740
755
  collectFiles(files?: File[]): void;
741
756
  updateId(task: Task): void;
742
757
  updateTasks(packs: TaskResultPack[]): void;
@@ -745,6 +760,7 @@ declare class StateManager {
745
760
 
746
761
  declare class Vitest {
747
762
  config: ResolvedConfig;
763
+ configOverride: Partial<ResolvedConfig> | undefined;
748
764
  server: ViteDevServer;
749
765
  state: StateManager;
750
766
  snapshot: SnapshotManager;
@@ -768,10 +784,14 @@ declare class Vitest {
768
784
  private _onRestartListeners;
769
785
  constructor();
770
786
  setServer(options: UserConfig, server: ViteDevServer): Promise<void>;
787
+ getConfig(): any;
771
788
  start(filters?: string[]): Promise<void>;
772
789
  private getTestDependencies;
773
790
  filterTestsBySource(tests: string[]): Promise<string[]>;
774
791
  runFiles(files: string[]): Promise<void>;
792
+ rerunFiles(files?: string[], trigger?: string): Promise<void>;
793
+ returnFailed(): Promise<void>;
794
+ updateSnapshot(files?: string[]): Promise<void>;
775
795
  log(...args: any[]): void;
776
796
  error(...args: any[]): void;
777
797
  private _rerunTimer;
@@ -780,6 +800,7 @@ declare class Vitest {
780
800
  private registerWatcher;
781
801
  private handleFileChanged;
782
802
  close(): Promise<void>;
803
+ exit(): Promise<void>;
783
804
  report<T extends keyof Reporter>(name: T, ...args: ArgumentsType<Reporter[T]>): Promise<void>;
784
805
  globTestFiles(filters?: string[]): Promise<string[]>;
785
806
  isTargetFile(id: string): boolean;
package/dist/node.js CHANGED
@@ -1,23 +1,23 @@
1
- export { V as VitestPlugin, c as createVitest } from './create-100980e7.js';
2
- import './index-1b2eb03b.js';
1
+ export { V as VitestPlugin, c as createVitest } from './create-19f5d4a3.js';
2
+ import './index-1964368a.js';
3
3
  import 'path';
4
4
  import 'vite';
5
5
  import 'process';
6
6
  import 'fs';
7
- import './constants-d46e121b.js';
7
+ import './constants-de5287a6.js';
8
8
  import 'url';
9
9
  import 'os';
10
10
  import 'util';
11
11
  import 'stream';
12
12
  import 'events';
13
- import './index-266ef041.js';
13
+ import './index-f2daefb8.js';
14
14
  import 'tty';
15
15
  import 'local-pkg';
16
- import './index-163994a5.js';
16
+ import './index-46e1d4ad.js';
17
17
  import 'module';
18
18
  import 'assert';
19
19
  import 'perf_hooks';
20
- import './diff-dadcf3bb.js';
20
+ import './diff-0d077da9.js';
21
21
  import './index-648e7ab2.js';
22
22
  import './_commonjsHelpers-c9e3b764.js';
23
23
  import 'worker_threads';