vitest 0.2.5 → 0.2.6

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
@@ -1,11 +1,5 @@
1
- import { Profiler } from 'inspector';
2
1
  import { ViteDevServer, TransformResult, CommonServerOptions, UserConfig as UserConfig$1, Plugin as Plugin$1 } from 'vite';
3
2
 
4
- interface FetchResult {
5
- code?: string;
6
- externalize?: string;
7
- }
8
-
9
3
  interface DepsHandlingOptions {
10
4
  external?: (string | RegExp)[];
11
5
  inline?: (string | RegExp)[];
@@ -15,6 +9,22 @@ interface DepsHandlingOptions {
15
9
  */
16
10
  fallbackCJS?: boolean;
17
11
  }
12
+ interface StartOfSourceMap {
13
+ file?: string;
14
+ sourceRoot?: string;
15
+ }
16
+ interface RawSourceMap extends StartOfSourceMap {
17
+ version: string;
18
+ sources: string[];
19
+ names: string[];
20
+ sourcesContent?: string[];
21
+ mappings: string;
22
+ }
23
+ interface FetchResult {
24
+ code?: string;
25
+ externalize?: string;
26
+ map?: RawSourceMap;
27
+ }
18
28
  interface ViteNodeResolveId {
19
29
  external?: boolean | 'absolute' | 'relative';
20
30
  id: string;
@@ -25,9 +35,9 @@ interface ViteNodeResolveId {
25
35
  interface ViteNodeServerOptions {
26
36
  /**
27
37
  * Inject inline sourcemap to modules
28
- * @default true
38
+ * @default 'inline'
29
39
  */
30
- sourcemap?: boolean;
40
+ sourcemap?: 'inline' | boolean;
31
41
  /**
32
42
  * Deps handling
33
43
  */
@@ -46,7 +56,10 @@ declare class ViteNodeServer {
46
56
  options: ViteNodeServerOptions;
47
57
  private fetchPromiseMap;
48
58
  private transformPromiseMap;
49
- private fetchCache;
59
+ fetchCache: Map<string, {
60
+ timestamp: number;
61
+ result: FetchResult;
62
+ }>;
50
63
  constructor(server: ViteDevServer, options?: ViteNodeServerOptions);
51
64
  shouldExternalize(id: string): Promise<string | false>;
52
65
  resolveId(id: string, importer?: string): Promise<ViteNodeResolveId | null>;
@@ -251,6 +264,38 @@ declare const ReportersMap: {
251
264
  };
252
265
  declare type BuiltinReporters = keyof typeof ReportersMap;
253
266
 
267
+ declare type Awaitable<T> = T | PromiseLike<T>;
268
+ declare type Arrayable<T> = T | Array<T>;
269
+ declare type ArgumentsType<T> = T extends (...args: infer U) => any ? U : never;
270
+ interface UserConsoleLog {
271
+ content: string;
272
+ type: 'stdout' | 'stderr';
273
+ taskId?: string;
274
+ time: number;
275
+ }
276
+ interface Position {
277
+ line: number;
278
+ column: number;
279
+ }
280
+ interface ParsedStack {
281
+ method: string;
282
+ file: string;
283
+ line: number;
284
+ column: number;
285
+ sourcePos?: Position;
286
+ }
287
+ interface ErrorWithDiff extends Error {
288
+ name: string;
289
+ nameStr?: string;
290
+ stack?: string;
291
+ stackStr?: string;
292
+ stacks?: ParsedStack[];
293
+ showDiff?: boolean;
294
+ actual?: any;
295
+ expected?: any;
296
+ operator?: string;
297
+ }
298
+
254
299
  declare type CoverageReporter = 'clover' | 'cobertura' | 'html-spa' | 'html' | 'json-summary' | 'json' | 'lcov' | 'lcovonly' | 'none' | 'teamcity' | 'text-lcov' | 'text-summary' | 'text';
255
300
  interface C8Options {
256
301
  /**
@@ -300,6 +345,7 @@ interface C8Options {
300
345
  all?: boolean;
301
346
  }
302
347
  interface ResolvedC8Options extends Required<C8Options> {
348
+ tempDirectory: string;
303
349
  }
304
350
 
305
351
  interface JSDOMOptions {
@@ -382,49 +428,6 @@ interface JSDOMOptions {
382
428
  resources?: 'usable' | any;
383
429
  }
384
430
 
385
- declare type Awaitable<T> = T | PromiseLike<T>;
386
- declare type Arrayable<T> = T | Array<T>;
387
- declare type ArgumentsType<T> = T extends (...args: infer U) => any ? U : never;
388
- interface UserConsoleLog {
389
- content: string;
390
- type: 'stdout' | 'stderr';
391
- taskId?: string;
392
- time: number;
393
- }
394
- interface Position {
395
- line: number;
396
- column: number;
397
- }
398
- interface ParsedStack {
399
- method: string;
400
- file: string;
401
- line: number;
402
- column: number;
403
- sourcePos?: Position;
404
- }
405
- interface ErrorWithDiff extends Error {
406
- name: string;
407
- nameStr?: string;
408
- stack?: string;
409
- stackStr?: string;
410
- stacks?: ParsedStack[];
411
- showDiff?: boolean;
412
- actual?: any;
413
- expected?: any;
414
- operator?: string;
415
- }
416
- interface StartOfSourceMap {
417
- file?: string;
418
- sourceRoot?: string;
419
- }
420
- interface RawSourceMap extends StartOfSourceMap {
421
- version: string;
422
- sources: string[];
423
- names: string[];
424
- sourcesContent?: string[];
425
- mappings: string;
426
- }
427
-
428
431
  declare type RunMode = 'run' | 'skip' | 'only' | 'todo';
429
432
  declare type TaskState = RunMode | 'pass' | 'fail';
430
433
  interface TaskBase {
@@ -762,6 +765,10 @@ interface UserConfig extends InlineConfig {
762
765
  * Pass with no tests
763
766
  */
764
767
  passWithNoTests?: boolean;
768
+ /**
769
+ * Allow tests and suites that are marked as only
770
+ */
771
+ allowOnly?: boolean;
765
772
  /**
766
773
  * Run tests that cover a list of source files
767
774
  */
@@ -812,7 +819,6 @@ declare class Vitest {
812
819
  server: ViteDevServer;
813
820
  state: StateManager;
814
821
  snapshot: SnapshotManager;
815
- coverage: Profiler.TakePreciseCoverageReturnType[];
816
822
  reporters: Reporter[];
817
823
  console: Console;
818
824
  pool: WorkerPool | undefined;
@@ -825,7 +831,6 @@ declare class Vitest {
825
831
  vitenode: ViteNodeServer;
826
832
  invalidates: Set<string>;
827
833
  changedTests: Set<string>;
828
- visitedFilesMap: Map<string, RawSourceMap>;
829
834
  runningPromise?: Promise<void>;
830
835
  closingPromise?: Promise<void>;
831
836
  isFirstRun: boolean;
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- export { V as VitestPlugin, c as createVitest } from './create-48243480.js';
1
+ export { V as VitestPlugin, c as createVitest } from './create-a1bc541a.js';
2
2
  import './index-1964368a.js';
3
3
  import 'path';
4
4
  import 'vite';
@@ -10,19 +10,20 @@ import 'os';
10
10
  import 'util';
11
11
  import 'stream';
12
12
  import 'events';
13
- import './index-043440ae.js';
13
+ import './index-fcd4a465.js';
14
14
  import 'tty';
15
15
  import 'local-pkg';
16
16
  import './client-f15310bf.js';
17
17
  import 'module';
18
18
  import 'assert';
19
19
  import 'vm';
20
+ import 'v8';
20
21
  import 'perf_hooks';
21
- import './diff-6be0541d.js';
22
- import './source-map-1132e742.js';
23
- import './index-61c8686f.js';
22
+ import './diff-192d8dc6.js';
23
+ import './source-map-a9204b39.js';
24
+ import './index-648e7ab2.js';
24
25
  import './_commonjsHelpers-c9e3b764.js';
25
26
  import 'worker_threads';
26
27
  import 'tinypool';
27
28
  import './magic-string.es-94000aea.js';
28
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9
29
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==