vitest 0.0.129 → 0.0.133

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.
Files changed (40) hide show
  1. package/dist/_commonjsHelpers-c9e3b764.js +1 -0
  2. package/dist/cli.js +10 -9
  3. package/dist/constants-0211a379.js +34 -0
  4. package/dist/diff-18d4a7eb.js +4750 -0
  5. package/dist/entry.js +94 -33
  6. package/dist/externalize-2f63779d.js +1 -0
  7. package/dist/global-5d1fb309.js +21 -0
  8. package/dist/index-26cb6e63.js +1644 -0
  9. package/dist/index-354a6abd.js +40 -0
  10. package/dist/index-4cd25949.js +782 -0
  11. package/dist/index-720a83c6.js +396 -0
  12. package/dist/index-7975be53.js +331 -0
  13. package/dist/index-7f7acd60.js +8548 -0
  14. package/dist/index-e909c175.js +63 -0
  15. package/dist/index-fa899e66.js +5708 -0
  16. package/dist/index.d.ts +142 -27
  17. package/dist/index.js +4 -3
  18. package/dist/jest-mock-30625866.js +1 -0
  19. package/dist/magic-string.es-94000aea.js +1361 -0
  20. package/dist/node.d.ts +111 -4
  21. package/dist/node.js +9 -8
  22. package/dist/rpc-8c7cc374.js +1 -0
  23. package/dist/setup-5aaf533e.js +4365 -0
  24. package/dist/vi-aec007e7.js +3461 -0
  25. package/dist/worker.js +11 -7
  26. package/package.json +9 -9
  27. package/dist/constants-868b9a2e.js +0 -33
  28. package/dist/diff-be830986.js +0 -4751
  29. package/dist/global-0254dd68.js +0 -20
  30. package/dist/index-06712022.js +0 -39
  31. package/dist/index-42a3a132.js +0 -366
  32. package/dist/index-42d44ee5.js +0 -1643
  33. package/dist/index-93dcb598.js +0 -5707
  34. package/dist/index-a73f33e0.js +0 -62
  35. package/dist/index-cb02ee01.js +0 -330
  36. package/dist/index-cce5de77.js +0 -781
  37. package/dist/index-d30b5ed0.js +0 -8579
  38. package/dist/magic-string.es-98a8bfa0.js +0 -1360
  39. package/dist/setup-6e09a65a.js +0 -4364
  40. package/dist/vi-fe26a646.js +0 -3460
package/dist/node.d.ts CHANGED
@@ -1,6 +1,17 @@
1
1
  import { CommonServerOptions, ViteDevServer, UserConfig as UserConfig$1 } from 'vite';
2
- import { RawSourceMap } from 'source-map-js';
3
- import { OptionsReceived } from 'pretty-format';
2
+
3
+ interface StartOfSourceMap {
4
+ file?: string;
5
+ sourceRoot?: string;
6
+ }
7
+
8
+ interface RawSourceMap extends StartOfSourceMap {
9
+ version: string;
10
+ sources: string[];
11
+ names: string[];
12
+ sourcesContent?: string[];
13
+ mappings: string;
14
+ }
4
15
 
5
16
  declare abstract class BaseReporter implements Reporter {
6
17
  start: number;
@@ -57,10 +68,18 @@ declare class VerboseReporter extends DefaultReporter {
57
68
  constructor();
58
69
  }
59
70
 
71
+ declare class TapReporter implements Reporter {
72
+ private ctx;
73
+ onInit(ctx: Vitest): void;
74
+ logTasks(tasks: Task[], currentIdent: string): void;
75
+ onFinished(files?: File[]): Promise<void>;
76
+ }
77
+
60
78
  declare const ReportersMap: {
61
79
  default: typeof DefaultReporter;
62
80
  verbose: typeof VerboseReporter;
63
81
  dot: typeof DotReporter;
82
+ tap: typeof TapReporter;
64
83
  };
65
84
  declare type BuiltinReporters = keyof typeof ReportersMap;
66
85
 
@@ -170,13 +189,13 @@ interface File extends Suite {
170
189
  filepath: string;
171
190
  collectDuration?: number;
172
191
  }
173
- interface Test extends TaskBase {
192
+ interface Test$1 extends TaskBase {
174
193
  type: 'test';
175
194
  suite: Suite;
176
195
  result?: TaskResult;
177
196
  fails?: boolean;
178
197
  }
179
- declare type Task = Test | Suite | File;
198
+ declare type Task = Test$1 | Suite | File;
180
199
 
181
200
  interface Reporter {
182
201
  onInit?(ctx: Vitest): void;
@@ -189,6 +208,93 @@ interface Reporter {
189
208
  onUserConsoleLog?: (log: UserConsoleLog) => Awaitable<void>;
190
209
  }
191
210
 
211
+ /**
212
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
213
+ *
214
+ * This source code is licensed under the MIT license found in the
215
+ * LICENSE file in the root directory of this source tree.
216
+ */
217
+ declare type Colors = {
218
+ comment: {
219
+ close: string;
220
+ open: string;
221
+ };
222
+ content: {
223
+ close: string;
224
+ open: string;
225
+ };
226
+ prop: {
227
+ close: string;
228
+ open: string;
229
+ };
230
+ tag: {
231
+ close: string;
232
+ open: string;
233
+ };
234
+ value: {
235
+ close: string;
236
+ open: string;
237
+ };
238
+ };
239
+ declare type Indent = (arg0: string) => string;
240
+ declare type Refs = Array<unknown>;
241
+ declare type Print = (arg0: unknown) => string;
242
+ declare type ThemeReceived = {
243
+ comment?: string;
244
+ content?: string;
245
+ prop?: string;
246
+ tag?: string;
247
+ value?: string;
248
+ };
249
+ declare type CompareKeys = ((a: string, b: string) => number) | undefined;
250
+ interface PrettyFormatOptions {
251
+ callToJSON?: boolean;
252
+ compareKeys?: CompareKeys;
253
+ escapeRegex?: boolean;
254
+ escapeString?: boolean;
255
+ highlight?: boolean;
256
+ indent?: number;
257
+ maxDepth?: number;
258
+ min?: boolean;
259
+ plugins?: Plugins;
260
+ printBasicPrototype?: boolean;
261
+ printFunctionName?: boolean;
262
+ theme?: ThemeReceived;
263
+ }
264
+ declare type OptionsReceived = PrettyFormatOptions;
265
+ declare type Config = {
266
+ callToJSON: boolean;
267
+ compareKeys: CompareKeys;
268
+ colors: Colors;
269
+ escapeRegex: boolean;
270
+ escapeString: boolean;
271
+ indent: string;
272
+ maxDepth: number;
273
+ min: boolean;
274
+ plugins: Plugins;
275
+ printBasicPrototype: boolean;
276
+ printFunctionName: boolean;
277
+ spacingInner: string;
278
+ spacingOuter: string;
279
+ };
280
+ declare type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;
281
+ declare type Test = (arg0: any) => boolean;
282
+ declare type NewPlugin = {
283
+ serialize: (val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
284
+ test: Test;
285
+ };
286
+ declare type PluginOptions = {
287
+ edgeSpacing: string;
288
+ min: boolean;
289
+ spacing: string;
290
+ };
291
+ declare type OldPlugin = {
292
+ print: (val: unknown, print: Print, indent: Indent, options: PluginOptions, colors: Colors) => string;
293
+ test: Test;
294
+ };
295
+ declare type Plugin = NewPlugin | OldPlugin;
296
+ declare type Plugins = Array<Plugin>;
297
+
192
298
  declare type SnapshotUpdateState = 'all' | 'new' | 'none';
193
299
  declare type SnapshotStateOptions = {
194
300
  updateSnapshot: SnapshotUpdateState;
@@ -426,6 +532,7 @@ interface UserConfig extends InlineConfig {
426
532
  related?: string[] | string;
427
533
  }
428
534
  interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters' | 'coverage' | 'testNamePattern' | 'related' | 'api'> {
535
+ base?: string;
429
536
  config?: string;
430
537
  filters?: string[];
431
538
  testNamePattern?: RegExp;
package/dist/node.js CHANGED
@@ -1,6 +1,6 @@
1
- export { c as createVitest } from './index-d30b5ed0.js';
1
+ export { c as createVitest } from './index-7f7acd60.js';
2
2
  import 'fs';
3
- import './index-42a3a132.js';
3
+ import './index-720a83c6.js';
4
4
  import 'url';
5
5
  import 'tty';
6
6
  import 'local-pkg';
@@ -11,14 +11,15 @@ import 'os';
11
11
  import 'util';
12
12
  import 'stream';
13
13
  import 'events';
14
- import './_commonjsHelpers-c9e3b764.js';
15
- import './constants-868b9a2e.js';
16
- import './magic-string.es-98a8bfa0.js';
14
+ import './constants-0211a379.js';
15
+ import './magic-string.es-94000aea.js';
17
16
  import 'perf_hooks';
18
- import './diff-be830986.js';
19
- import './index-cb02ee01.js';
17
+ import './diff-18d4a7eb.js';
18
+ import './index-7975be53.js';
19
+ import './_commonjsHelpers-c9e3b764.js';
20
20
  import 'assert';
21
21
  import 'module';
22
22
  import 'worker_threads';
23
23
  import 'tinypool';
24
- import './index-a73f33e0.js';
24
+ import './index-e909c175.js';
25
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9
@@ -3,3 +3,4 @@ const rpc = () => {
3
3
  };
4
4
 
5
5
  export { rpc as r };
6
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnBjLThjN2NjMzc0LmpzIiwic291cmNlcyI6WyIuLi9zcmMvcnVudGltZS9ycGMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IHJwYyA9ICgpID0+IHtcbiAgcmV0dXJuIHByb2Nlc3MuX192aXRlc3Rfd29ya2VyX18hLnJwY1xufVxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFZLE1BQUMsR0FBRyxHQUFHLE1BQU07QUFDekIsRUFBRSxPQUFPLE9BQU8sQ0FBQyxpQkFBaUIsQ0FBQyxHQUFHLENBQUM7QUFDdkM7OyJ9