vitest 0.1.16 → 0.1.20

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
@@ -13,13 +13,35 @@ interface RawSourceMap extends StartOfSourceMap {
13
13
  mappings: string;
14
14
  }
15
15
 
16
- interface ExternalizeOptions {
16
+ interface DepsHandlingOptions {
17
17
  external?: (string | RegExp)[];
18
18
  inline?: (string | RegExp)[];
19
+ /**
20
+ * Try to guess the CJS version of a package when it's invalid ESM
21
+ * @default true
22
+ */
19
23
  fallbackCJS?: boolean;
20
24
  }
25
+ interface ViteNodeResolveId {
26
+ external?: boolean | 'absolute' | 'relative';
27
+ id: string;
28
+ meta?: Record<string, any> | null;
29
+ moduleSideEffects?: boolean | 'no-treeshake' | null;
30
+ syntheticNamedExports?: boolean | string | null;
31
+ }
21
32
  interface ViteNodeServerOptions {
22
- deps?: ExternalizeOptions;
33
+ /**
34
+ * Inject inline sourcemap to modules
35
+ * @default true
36
+ */
37
+ sourcemap?: boolean;
38
+ /**
39
+ * Deps handling
40
+ */
41
+ deps?: DepsHandlingOptions;
42
+ /**
43
+ * Tranform method for modules
44
+ */
23
45
  transformMode?: {
24
46
  ssr?: RegExp[];
25
47
  web?: RegExp[];
@@ -39,6 +61,7 @@ declare class ViteNodeServer {
39
61
  code: string | undefined;
40
62
  externalize?: undefined;
41
63
  }>;
64
+ resolveId(id: string, importer?: string): Promise<ViteNodeResolveId | null>;
42
65
  transformRequest(id: string): Promise<TransformResult | null | undefined>;
43
66
  private getTransformMode;
44
67
  private _transformRequest;
@@ -209,6 +232,19 @@ declare class TapReporter implements Reporter {
209
232
  onFinished(files?: File[]): Promise<void>;
210
233
  }
211
234
 
235
+ declare class JUnitReporter implements Reporter {
236
+ private ctx;
237
+ private reportFile?;
238
+ private baseLog;
239
+ private logger;
240
+ onInit(ctx: Vitest): Promise<void>;
241
+ writeElement(name: string, attrs: Record<string, any>, children: () => Promise<void>): Promise<void>;
242
+ writeErrorDetails(error: ErrorWithDiff): Promise<void>;
243
+ writeLogs(task: Task, type: 'err' | 'out'): Promise<void>;
244
+ writeTasks(tasks: Task[], filename: string): Promise<void>;
245
+ onFinished(files?: File[]): Promise<void>;
246
+ }
247
+
212
248
  declare class TapFlatReporter extends TapReporter {
213
249
  onInit(ctx: Vitest): void;
214
250
  onFinished(files?: File[]): Promise<void>;
@@ -221,6 +257,7 @@ declare const ReportersMap: {
221
257
  json: typeof JsonReporter;
222
258
  tap: typeof TapReporter;
223
259
  'tap-flat': typeof TapFlatReporter;
260
+ junit: typeof JUnitReporter;
224
261
  };
225
262
  declare type BuiltinReporters = keyof typeof ReportersMap;
226
263
 
@@ -270,6 +307,7 @@ interface C8Options {
270
307
  include?: string[];
271
308
  skipFull?: boolean;
272
309
  extension?: string | string[];
310
+ all?: boolean;
273
311
  }
274
312
  interface ResolvedC8Options extends Required<C8Options> {
275
313
  tempDirectory: string;
@@ -525,9 +563,13 @@ interface InlineConfig {
525
563
  fallbackCJS?: boolean;
526
564
  };
527
565
  /**
528
- * Register apis globally
529
- *
530
- * @default false
566
+ * Register apis globally
567
+ *
568
+ * @default false
569
+ */
570
+ globals?: boolean;
571
+ /**
572
+ * @deprecated
531
573
  */
532
574
  global?: boolean;
533
575
  /**
@@ -784,7 +826,7 @@ declare class Vitest {
784
826
  private _onRestartListeners;
785
827
  constructor();
786
828
  setServer(options: UserConfig, server: ViteDevServer): Promise<void>;
787
- getConfig(): any;
829
+ getConfig(): ResolvedConfig;
788
830
  start(filters?: string[]): Promise<void>;
789
831
  private getTestDependencies;
790
832
  filterTestsBySource(tests: string[]): Promise<string[]>;
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- export { V as VitestPlugin, c as createVitest } from './create-19f5d4a3.js';
1
+ export { V as VitestPlugin, c as createVitest } from './create-3bc3fb6a.js';
2
2
  import './index-1964368a.js';
3
3
  import 'path';
4
4
  import 'vite';
@@ -10,14 +10,14 @@ import 'os';
10
10
  import 'util';
11
11
  import 'stream';
12
12
  import 'events';
13
- import './index-f2daefb8.js';
13
+ import './index-34e48ae9.js';
14
14
  import 'tty';
15
15
  import 'local-pkg';
16
- import './index-46e1d4ad.js';
16
+ import './index-058a289b.js';
17
17
  import 'module';
18
18
  import 'assert';
19
19
  import 'perf_hooks';
20
- import './diff-0d077da9.js';
20
+ import './diff-cec3bc6d.js';
21
21
  import './index-648e7ab2.js';
22
22
  import './_commonjsHelpers-c9e3b764.js';
23
23
  import 'worker_threads';