vitest 0.0.142 → 0.1.14

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 {
@@ -261,6 +266,7 @@ interface C8Options {
261
266
  exclude?: string[];
262
267
  include?: string[];
263
268
  skipFull?: boolean;
269
+ extension?: string | string[];
264
270
  }
265
271
  interface ResolvedC8Options extends Required<C8Options> {
266
272
  tempDirectory: string;
@@ -555,6 +561,10 @@ interface InlineConfig {
555
561
  * Custom reporter for output
556
562
  */
557
563
  reporters?: Arrayable<BuiltinReporters | Reporter>;
564
+ /**
565
+ * Write test results to a file when the --reporter=json option is also specified
566
+ */
567
+ outputFile?: string;
558
568
  /**
559
569
  * Enable multi-threading
560
570
  *
@@ -737,6 +747,8 @@ declare class StateManager {
737
747
  idMap: Map<string, Task>;
738
748
  taskFileMap: WeakMap<Task, File>;
739
749
  getFiles(keys?: string[]): File[];
750
+ getFilepaths(): string[];
751
+ getFailedFilepaths(): string[];
740
752
  collectFiles(files?: File[]): void;
741
753
  updateId(task: Task): void;
742
754
  updateTasks(packs: TaskResultPack[]): void;
@@ -745,6 +757,7 @@ declare class StateManager {
745
757
 
746
758
  declare class Vitest {
747
759
  config: ResolvedConfig;
760
+ configOverride: Partial<ResolvedConfig> | undefined;
748
761
  server: ViteDevServer;
749
762
  state: StateManager;
750
763
  snapshot: SnapshotManager;
@@ -768,10 +781,14 @@ declare class Vitest {
768
781
  private _onRestartListeners;
769
782
  constructor();
770
783
  setServer(options: UserConfig, server: ViteDevServer): Promise<void>;
784
+ getConfig(): any;
771
785
  start(filters?: string[]): Promise<void>;
772
786
  private getTestDependencies;
773
787
  filterTestsBySource(tests: string[]): Promise<string[]>;
774
788
  runFiles(files: string[]): Promise<void>;
789
+ rerunFiles(files?: string[], trigger?: string): Promise<void>;
790
+ returnFailed(): Promise<void>;
791
+ updateSnapshot(files?: string[]): Promise<void>;
775
792
  log(...args: any[]): void;
776
793
  error(...args: any[]): void;
777
794
  private _rerunTimer;
@@ -780,13 +797,15 @@ declare class Vitest {
780
797
  private registerWatcher;
781
798
  private handleFileChanged;
782
799
  close(): Promise<void>;
800
+ exit(): Promise<void>;
783
801
  report<T extends keyof Reporter>(name: T, ...args: ArgumentsType<Reporter[T]>): Promise<void>;
784
802
  globTestFiles(filters?: string[]): Promise<string[]>;
785
803
  isTargetFile(id: string): boolean;
786
804
  onServerRestarted(fn: () => void): void;
787
805
  }
788
806
 
789
- declare function VitestPlugin(options?: UserConfig, viteOverrides?: UserConfig$1, ctx?: Vitest): Promise<Plugin$1[]>;
790
807
  declare function createVitest(options: UserConfig, viteOverrides?: UserConfig$1): Promise<Vitest>;
791
808
 
809
+ declare function VitestPlugin(options?: UserConfig, viteOverrides?: UserConfig$1, ctx?: Vitest): Promise<Plugin$1[]>;
810
+
792
811
  export { Vitest, VitestPlugin, createVitest };
package/dist/node.js CHANGED
@@ -1,26 +1,26 @@
1
- export { V as VitestPlugin, c as createVitest } from './index-fdf40e86.js';
2
- import 'fs';
3
- import './index-1b2eb03b.js';
1
+ export { V as VitestPlugin, c as createVitest } from './create-3bb8fa37.js';
2
+ import './index-1964368a.js';
4
3
  import 'path';
5
4
  import 'vite';
6
5
  import 'process';
6
+ import 'fs';
7
+ import './constants-de5287a6.js';
8
+ import 'url';
7
9
  import 'os';
8
10
  import 'util';
9
11
  import 'stream';
10
12
  import 'events';
11
- import './index-1bb8e174.js';
13
+ import './index-9f6e4d3e.js';
12
14
  import 'tty';
13
15
  import 'local-pkg';
14
- import './index-163994a5.js';
16
+ import './index-46e1d4ad.js';
15
17
  import 'module';
16
- import 'url';
17
18
  import 'assert';
18
- import './constants-124522a1.js';
19
- import './magic-string.es-94000aea.js';
20
19
  import 'perf_hooks';
21
- import './diff-f7af3876.js';
22
- import './index-648e7ab2.js';
20
+ import './diff-5156dce1.js';
21
+ import './index-7975be53.js';
23
22
  import './_commonjsHelpers-c9e3b764.js';
24
23
  import 'worker_threads';
25
24
  import 'tinypool';
25
+ import './magic-string.es-94000aea.js';
26
26
  //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==