vitest 0.22.0 → 0.22.1

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 (33) hide show
  1. package/dist/browser.d.ts +3 -3
  2. package/dist/browser.mjs +8 -7
  3. package/dist/{chunk-api-setup.ecd02c18.mjs → chunk-api-setup.377c28aa.mjs} +7 -8
  4. package/dist/chunk-constants.71e8a211.mjs +284 -0
  5. package/dist/{chunk-integrations-globals.e81d2091.mjs → chunk-integrations-globals.60af7da3.mjs} +8 -9
  6. package/dist/{chunk-mock-date.debe9954.mjs → chunk-mock-date.304e29b1.mjs} +6 -189
  7. package/dist/{chunk-node-git.71b74da4.mjs → chunk-node-git.9a7e3153.mjs} +3 -5
  8. package/dist/{chunk-runtime-chain.6e363ba2.mjs → chunk-runtime-chain.be610650.mjs} +4 -4
  9. package/dist/{chunk-runtime-error.975bd80a.mjs → chunk-runtime-error.1104e45a.mjs} +10 -10
  10. package/dist/{chunk-runtime-hooks.4789e99d.mjs → chunk-runtime-hooks.5d7073db.mjs} +3 -3
  11. package/dist/{chunk-runtime-mocker.c91d29ce.mjs → chunk-runtime-mocker.49d21aa6.mjs} +4 -4
  12. package/dist/{chunk-runtime-rpc.29488183.mjs → chunk-runtime-rpc.57586b73.mjs} +1 -1
  13. package/dist/{chunk-utils-source-map.2a082ffd.mjs → chunk-utils-source-map.bbf3ad19.mjs} +2 -2
  14. package/dist/{chunk-vite-node-client.d1ead698.mjs → chunk-vite-node-client.cddda63d.mjs} +44 -20
  15. package/dist/{chunk-vite-node-debug.ff1d2a9f.mjs → chunk-vite-node-debug.536c4c5b.mjs} +3 -4
  16. package/dist/{chunk-vite-node-externalize.3a38c8af.mjs → chunk-vite-node-externalize.c843f497.mjs} +42 -24
  17. package/dist/{chunk-vite-node-utils.d8e5ff7b.mjs → chunk-vite-node-utils.b432150c.mjs} +1 -1
  18. package/dist/cli-wrapper.mjs +43 -26
  19. package/dist/cli.mjs +9 -10
  20. package/dist/config.d.ts +1 -1
  21. package/dist/entry.mjs +8 -7
  22. package/dist/{global-74489cc9.d.ts → global-fe52f84b.d.ts} +20 -6
  23. package/dist/{index-9eded9ec.d.ts → index-ea17aa0c.d.ts} +1 -1
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.mjs +7 -6
  26. package/dist/loader.mjs +3 -3
  27. package/dist/node.d.ts +2 -2
  28. package/dist/node.mjs +11 -12
  29. package/dist/suite.mjs +6 -5
  30. package/dist/worker.mjs +9 -10
  31. package/package.json +5 -5
  32. package/dist/chunk-constants.d3f8437b.mjs +0 -38
  33. package/dist/vendor-picocolors.807856aa.mjs +0 -64
@@ -238,9 +238,17 @@ interface ViteHotContext {
238
238
  }
239
239
  declare class ModuleCacheMap extends Map<string, ModuleCache$1> {
240
240
  normalizePath(fsPath: string): string;
241
- set(fsPath: string, mod: Partial<ModuleCache$1>): this;
242
- get(fsPath: string): ModuleCache$1 | undefined;
241
+ /**
242
+ * Assign partial data to the map
243
+ */
244
+ update(fsPath: string, mod: Partial<ModuleCache$1>): this;
245
+ set(fsPath: string, mod: ModuleCache$1): this;
246
+ get(fsPath: string): ModuleCache$1;
243
247
  delete(fsPath: string): boolean;
248
+ /**
249
+ * Invalidate modules that dependent on the given modules, up to the main entry
250
+ */
251
+ invalidateDepTree(ids: string[] | Set<string>, invalidated?: Set<string>): Set<string>;
244
252
  }
245
253
  declare class ViteNodeRunner {
246
254
  options: ViteNodeRunnerOptions;
@@ -304,6 +312,10 @@ interface ModuleCache$1 {
304
312
  promise?: Promise<any>;
305
313
  exports?: any;
306
314
  code?: string;
315
+ /**
316
+ * Module ids that imports this module
317
+ */
318
+ importers?: Set<string>;
307
319
  }
308
320
  interface ViteNodeRunnerOptions {
309
321
  root: string;
@@ -375,6 +387,7 @@ declare class ViteNodeServer {
375
387
  private fetchPromiseMap;
376
388
  private transformPromiseMap;
377
389
  fetchCache: Map<string, {
390
+ duration?: number | undefined;
378
391
  timestamp: number;
379
392
  result: FetchResult;
380
393
  }>;
@@ -554,7 +567,7 @@ declare class Vitest {
554
567
  globTestFiles(filters?: string[]): Promise<string[]>;
555
568
  isTargetFile(id: string, source?: string): Promise<boolean>;
556
569
  isInSourceTestFile(code: string): boolean;
557
- onServerRestarted(fn: () => void): void;
570
+ onServerRestart(fn: OnServerRestartHandler): void;
558
571
  }
559
572
 
560
573
  declare type MockMap = Map<string, Record<string, string | null | (() => unknown)>>;
@@ -592,7 +605,7 @@ declare abstract class BaseReporter implements Reporter {
592
605
  onWatcherRerun(files: string[], trigger?: string): Promise<void>;
593
606
  onUserConsoleLog(log: UserConsoleLog): void;
594
607
  shouldLog(log: UserConsoleLog): boolean;
595
- onServerRestart(): void;
608
+ onServerRestart(reason?: string): void;
596
609
  reportSummary(files: File[]): Promise<void>;
597
610
  private printTaskErrors;
598
611
  registerUnhandledRejection(): void;
@@ -964,6 +977,7 @@ interface ModuleGraphData {
964
977
  externalized: string[];
965
978
  inlined: string[];
966
979
  }
980
+ declare type OnServerRestartHandler = (reason?: string) => Promise<void> | void;
967
981
 
968
982
  declare type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never;
969
983
  declare type ReturnType$1<T> = T extends (...args: any) => infer R ? R : never;
@@ -1409,7 +1423,7 @@ interface Reporter {
1409
1423
  onTestRemoved?: (trigger?: string) => Awaitable<void>;
1410
1424
  onWatcherStart?: () => Awaitable<void>;
1411
1425
  onWatcherRerun?: (files: string[], trigger?: string) => Awaitable<void>;
1412
- onServerRestart?: () => Awaitable<void>;
1426
+ onServerRestart?: (reason?: string) => Awaitable<void>;
1413
1427
  onUserConsoleLog?: (log: UserConsoleLog) => Awaitable<void>;
1414
1428
  }
1415
1429
 
@@ -2095,4 +2109,4 @@ declare global {
2095
2109
  }
2096
2110
  }
2097
2111
 
2098
- export { Environment as $, ApiConfig as A, BuiltinEnvironment as B, WorkerRPC as C, DoneCallback as D, EnvironmentOptions as E, FakeTimerInstallOpts as F, WorkerGlobalState as G, HookListener as H, InlineConfig as I, JSDOMOptions as J, Awaitable as K, Arrayable as L, ModuleGraphData as M, Nullable as N, ArgumentsType$1 as O, MergeInsertions as P, DeepMerge as Q, ResolvedConfig as R, Suite as S, TaskResultPack as T, UserConfig as U, Vitest as V, WorkerContext as W, MutableArray as X, Constructable as Y, ModuleCache as Z, EnvironmentReturn as _, File as a, UserConsoleLog as a0, Position as a1, ParsedStack as a2, ErrorWithDiff as a3, CoverageProvider as a4, CoverageProviderModule as a5, CoverageReporter as a6, CoverageOptions as a7, ResolvedCoverageOptions as a8, BaseCoverageOptions as a9, CoverageIstanbulOptions as aa, CoverageC8Options as ab, ModuleCacheMap as ac, ViteNodeRunnerOptions as ad, MockMap as ae, ViteNodeRunner as af, TestSequencer as ag, startVitest as ah, TestSequencerConstructor as ai, Reporter as b, RunMode as c, TaskState as d, TaskBase as e, TaskResult as f, Test as g, Task as h, TestFunction as i, TestAPI as j, SuiteAPI as k, HookCleanupCallback as l, SuiteHooks as m, SuiteCollector as n, SuiteFactory as o, RuntimeContext as p, TestContext as q, SnapshotData as r, SnapshotUpdateState as s, SnapshotStateOptions as t, SnapshotMatchOptions as u, SnapshotResult as v, UncheckedSnapshot as w, SnapshotSummary as x, ResolveIdFunction as y, AfterSuiteRunMeta as z };
2112
+ export { Environment as $, ApiConfig as A, BuiltinEnvironment as B, WorkerRPC as C, DoneCallback as D, EnvironmentOptions as E, FakeTimerInstallOpts as F, WorkerGlobalState as G, HookListener as H, InlineConfig as I, JSDOMOptions as J, Awaitable as K, Arrayable as L, ModuleGraphData as M, Nullable as N, ArgumentsType$1 as O, MergeInsertions as P, DeepMerge as Q, ResolvedConfig as R, Suite as S, TaskResultPack as T, UserConfig as U, Vitest as V, WorkerContext as W, MutableArray as X, Constructable as Y, ModuleCache as Z, EnvironmentReturn as _, File as a, UserConsoleLog as a0, Position as a1, ParsedStack as a2, ErrorWithDiff as a3, OnServerRestartHandler as a4, CoverageProvider as a5, CoverageProviderModule as a6, CoverageReporter as a7, CoverageOptions as a8, ResolvedCoverageOptions as a9, BaseCoverageOptions as aa, CoverageIstanbulOptions as ab, CoverageC8Options as ac, ModuleCacheMap as ad, ViteNodeRunnerOptions as ae, MockMap as af, ViteNodeRunner as ag, TestSequencer as ah, startVitest as ai, TestSequencerConstructor as aj, Reporter as b, RunMode as c, TaskState as d, TaskBase as e, TaskResult as f, Test as g, Task as h, TestFunction as i, TestAPI as j, SuiteAPI as k, HookCleanupCallback as l, SuiteHooks as m, SuiteCollector as n, SuiteFactory as o, RuntimeContext as p, TestContext as q, SnapshotData as r, SnapshotUpdateState as s, SnapshotStateOptions as t, SnapshotMatchOptions as u, SnapshotResult as v, UncheckedSnapshot as w, SnapshotSummary as x, ResolveIdFunction as y, AfterSuiteRunMeta as z };
@@ -1,5 +1,5 @@
1
1
  import { SpyImpl } from 'tinyspy';
2
- import { k as SuiteAPI, j as TestAPI, m as SuiteHooks, H as HookListener, q as TestContext, S as Suite, l as HookCleanupCallback, g as Test } from './global-74489cc9.js';
2
+ import { k as SuiteAPI, j as TestAPI, m as SuiteHooks, H as HookListener, q as TestContext, S as Suite, l as HookCleanupCallback, g as Test } from './global-fe52f84b.js';
3
3
 
4
4
  interface MockResultReturn<T> {
5
5
  type: 'return';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { s as spyOn, f as fn, M as MaybeMockedDeep, a as MaybeMocked, b as MaybePartiallyMocked, c as MaybePartiallyMockedDeep, E as EnhancedSpy } from './index-9eded9ec.js';
2
- export { E as EnhancedSpy, q as Mock, r as MockContext, p as MockInstance, u as Mocked, v as MockedClass, n as MockedFunction, o as MockedObject, S as SpyInstance, h as afterAll, k as afterEach, g as beforeAll, j as beforeEach, m as createExpect, e as describe, l as expect, i as it, d as suite, t as test } from './index-9eded9ec.js';
3
- import { D as DoneCallback, F as FakeTimerInstallOpts, a as File, T as TaskResultPack, R as ResolvedConfig, M as ModuleGraphData, b as Reporter } from './global-74489cc9.js';
4
- export { z as AfterSuiteRunMeta, A as ApiConfig, O as ArgumentsType, L as Arrayable, K as Awaitable, a9 as BaseCoverageOptions, B as BuiltinEnvironment, Y as Constructable, ab as CoverageC8Options, aa as CoverageIstanbulOptions, a7 as CoverageOptions, a4 as CoverageProvider, a5 as CoverageProviderModule, a6 as CoverageReporter, Q as DeepMerge, D as DoneCallback, $ as Environment, E as EnvironmentOptions, _ as EnvironmentReturn, a3 as ErrorWithDiff, a as File, l as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, P as MergeInsertions, Z as ModuleCache, M as ModuleGraphData, X as MutableArray, N as Nullable, a2 as ParsedStack, a1 as Position, b as Reporter, y as ResolveIdFunction, R as ResolvedConfig, a8 as ResolvedCoverageOptions, c as RunMode, p as RuntimeContext, r as SnapshotData, u as SnapshotMatchOptions, v as SnapshotResult, t as SnapshotStateOptions, x as SnapshotSummary, s as SnapshotUpdateState, S as Suite, k as SuiteAPI, n as SuiteCollector, o as SuiteFactory, m as SuiteHooks, h as Task, e as TaskBase, f as TaskResult, T as TaskResultPack, d as TaskState, g as Test, j as TestAPI, q as TestContext, i as TestFunction, w as UncheckedSnapshot, U as UserConfig, a0 as UserConsoleLog, V as Vitest, W as WorkerContext, G as WorkerGlobalState, C as WorkerRPC } from './global-74489cc9.js';
1
+ import { s as spyOn, f as fn, M as MaybeMockedDeep, a as MaybeMocked, b as MaybePartiallyMocked, c as MaybePartiallyMockedDeep, E as EnhancedSpy } from './index-ea17aa0c.js';
2
+ export { E as EnhancedSpy, q as Mock, r as MockContext, p as MockInstance, u as Mocked, v as MockedClass, n as MockedFunction, o as MockedObject, S as SpyInstance, h as afterAll, k as afterEach, g as beforeAll, j as beforeEach, m as createExpect, e as describe, l as expect, i as it, d as suite, t as test } from './index-ea17aa0c.js';
3
+ import { D as DoneCallback, F as FakeTimerInstallOpts, a as File, T as TaskResultPack, R as ResolvedConfig, M as ModuleGraphData, b as Reporter } from './global-fe52f84b.js';
4
+ export { z as AfterSuiteRunMeta, A as ApiConfig, O as ArgumentsType, L as Arrayable, K as Awaitable, aa as BaseCoverageOptions, B as BuiltinEnvironment, Y as Constructable, ac as CoverageC8Options, ab as CoverageIstanbulOptions, a8 as CoverageOptions, a5 as CoverageProvider, a6 as CoverageProviderModule, a7 as CoverageReporter, Q as DeepMerge, D as DoneCallback, $ as Environment, E as EnvironmentOptions, _ as EnvironmentReturn, a3 as ErrorWithDiff, a as File, l as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, P as MergeInsertions, Z as ModuleCache, M as ModuleGraphData, X as MutableArray, N as Nullable, a4 as OnServerRestartHandler, a2 as ParsedStack, a1 as Position, b as Reporter, y as ResolveIdFunction, R as ResolvedConfig, a9 as ResolvedCoverageOptions, c as RunMode, p as RuntimeContext, r as SnapshotData, u as SnapshotMatchOptions, v as SnapshotResult, t as SnapshotStateOptions, x as SnapshotSummary, s as SnapshotUpdateState, S as Suite, k as SuiteAPI, n as SuiteCollector, o as SuiteFactory, m as SuiteHooks, h as Task, e as TaskBase, f as TaskResult, T as TaskResultPack, d as TaskState, g as Test, j as TestAPI, q as TestContext, i as TestFunction, w as UncheckedSnapshot, U as UserConfig, a0 as UserConsoleLog, V as Vitest, W as WorkerContext, G as WorkerGlobalState, C as WorkerRPC } from './global-fe52f84b.js';
5
5
  import { TransformResult } from 'vite';
6
6
  import * as chai from 'chai';
7
7
  export { chai };
package/dist/index.mjs CHANGED
@@ -1,19 +1,20 @@
1
- export { c as createExpect, d as describe, b as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.6e363ba2.mjs';
2
- export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, h as getRunningMode, f as isFirstRun, j as isWatchMode, e as runOnce, v as vi, g as vitest, w as withCallback } from './chunk-runtime-hooks.4789e99d.mjs';
1
+ export { c as createExpect, d as describe, b as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.be610650.mjs';
2
+ export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, h as getRunningMode, f as isFirstRun, j as isWatchMode, e as runOnce, v as vi, g as vitest, w as withCallback } from './chunk-runtime-hooks.5d7073db.mjs';
3
3
  import * as chai from 'chai';
4
4
  export { chai };
5
5
  export { assert, should } from 'chai';
6
6
  import 'util';
7
- import './chunk-mock-date.debe9954.mjs';
7
+ import './chunk-mock-date.304e29b1.mjs';
8
8
  import 'path';
9
- import './vendor-picocolors.807856aa.mjs';
9
+ import './chunk-constants.71e8a211.mjs';
10
10
  import 'tty';
11
+ import 'url';
11
12
  import 'local-pkg';
12
13
  import './vendor-_commonjsHelpers.4da45ef5.mjs';
13
- import './chunk-runtime-rpc.29488183.mjs';
14
+ import './chunk-runtime-rpc.57586b73.mjs';
14
15
  import './chunk-utils-global.fa20c2f6.mjs';
15
16
  import './chunk-utils-timers.b48455ed.mjs';
16
17
  import 'fs';
17
- import './chunk-utils-source-map.2a082ffd.mjs';
18
+ import './chunk-utils-source-map.bbf3ad19.mjs';
18
19
  import './spy.mjs';
19
20
  import 'tinyspy';
package/dist/loader.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import { pathToFileURL } from 'url';
2
2
  import { readFile } from 'fs/promises';
3
- import { i as isNodeBuiltin, d as normalizeModuleId, h as hasCJSSyntax } from './chunk-vite-node-utils.d8e5ff7b.mjs';
4
- import './chunk-mock-date.debe9954.mjs';
3
+ import { i as isNodeBuiltin, d as normalizeModuleId, h as hasCJSSyntax } from './chunk-vite-node-utils.b432150c.mjs';
4
+ import './chunk-mock-date.304e29b1.mjs';
5
5
  import { g as getWorkerState } from './chunk-utils-global.fa20c2f6.mjs';
6
6
  import 'module';
7
7
  import 'fs';
8
8
  import 'path';
9
9
  import 'assert';
10
10
  import 'util';
11
- import './vendor-picocolors.807856aa.mjs';
11
+ import './chunk-constants.71e8a211.mjs';
12
12
  import 'tty';
13
13
  import 'local-pkg';
14
14
 
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { U as UserConfig, V as Vitest, ac as ModuleCacheMap, ad as ViteNodeRunnerOptions, ae as MockMap, af as ViteNodeRunner, ag as TestSequencer } from './global-74489cc9.js';
2
- export { ag as TestSequencer, ai as TestSequencerConstructor, V as Vitest, ah as startVitest } from './global-74489cc9.js';
1
+ import { U as UserConfig, V as Vitest, ad as ModuleCacheMap, ae as ViteNodeRunnerOptions, af as MockMap, ag as ViteNodeRunner, ah as TestSequencer } from './global-fe52f84b.js';
2
+ export { ah as TestSequencer, aj as TestSequencerConstructor, V as Vitest, ai as startVitest } from './global-fe52f84b.js';
3
3
  import { UserConfig as UserConfig$1, Plugin } from 'vite';
4
4
  import 'worker_threads';
5
5
  import 'fs';
package/dist/node.mjs CHANGED
@@ -1,31 +1,30 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.3a38c8af.mjs';
2
- export { V as VitestRunner } from './chunk-runtime-mocker.c91d29ce.mjs';
3
- import './chunk-mock-date.debe9954.mjs';
4
- import 'path';
5
- import './vendor-picocolors.807856aa.mjs';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.c843f497.mjs';
2
+ export { V as VitestRunner } from './chunk-runtime-mocker.49d21aa6.mjs';
3
+ import './chunk-constants.71e8a211.mjs';
6
4
  import 'tty';
7
- import 'local-pkg';
5
+ import 'url';
6
+ import 'path';
8
7
  import './chunk-integrations-coverage.d205bd87.mjs';
8
+ import 'local-pkg';
9
+ import './chunk-mock-date.304e29b1.mjs';
9
10
  import 'vite';
10
- import 'url';
11
11
  import 'process';
12
12
  import 'fs';
13
- import './chunk-constants.d3f8437b.mjs';
14
13
  import 'os';
15
14
  import 'util';
16
15
  import 'stream';
17
16
  import 'events';
18
17
  import './vendor-_commonjsHelpers.4da45ef5.mjs';
19
- import './chunk-vite-node-client.d1ead698.mjs';
18
+ import './chunk-vite-node-client.cddda63d.mjs';
20
19
  import 'module';
21
20
  import 'vm';
22
- import './chunk-vite-node-utils.d8e5ff7b.mjs';
21
+ import './chunk-vite-node-utils.b432150c.mjs';
23
22
  import 'assert';
24
23
  import 'debug';
24
+ import 'perf_hooks';
25
25
  import 'worker_threads';
26
26
  import 'tinypool';
27
- import 'perf_hooks';
28
- import './chunk-utils-source-map.2a082ffd.mjs';
27
+ import './chunk-utils-source-map.bbf3ad19.mjs';
29
28
  import './chunk-utils-timers.b48455ed.mjs';
30
29
  import 'crypto';
31
30
  import './vendor-index.9d9196cc.mjs';
package/dist/suite.mjs CHANGED
@@ -1,16 +1,17 @@
1
1
  import 'util';
2
- import './chunk-mock-date.debe9954.mjs';
3
- export { e as clearCollectorContext, o as createSuiteHooks, f as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.6e363ba2.mjs';
2
+ import './chunk-mock-date.304e29b1.mjs';
3
+ export { e as clearCollectorContext, o as createSuiteHooks, f as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.be610650.mjs';
4
4
  import './chunk-utils-global.fa20c2f6.mjs';
5
5
  import 'path';
6
- import './vendor-picocolors.807856aa.mjs';
6
+ import './chunk-constants.71e8a211.mjs';
7
7
  import 'tty';
8
+ import 'url';
8
9
  import 'local-pkg';
9
10
  import 'chai';
10
11
  import './vendor-_commonjsHelpers.4da45ef5.mjs';
11
- import './chunk-runtime-rpc.29488183.mjs';
12
+ import './chunk-runtime-rpc.57586b73.mjs';
12
13
  import './chunk-utils-timers.b48455ed.mjs';
13
14
  import 'fs';
14
- import './chunk-utils-source-map.2a082ffd.mjs';
15
+ import './chunk-utils-source-map.bbf3ad19.mjs';
15
16
  import './spy.mjs';
16
17
  import 'tinyspy';
package/dist/worker.mjs CHANGED
@@ -1,22 +1,21 @@
1
- import { x as resolve } from './chunk-mock-date.debe9954.mjs';
2
- import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.d1ead698.mjs';
1
+ import { a as resolve, c as distDir } from './chunk-constants.71e8a211.mjs';
2
+ import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.cddda63d.mjs';
3
3
  import { workerId } from 'tinypool';
4
- import { d as distDir } from './chunk-constants.d3f8437b.mjs';
5
- import { e as executeInViteNode } from './chunk-runtime-mocker.c91d29ce.mjs';
6
- import { r as rpc } from './chunk-runtime-rpc.29488183.mjs';
4
+ import './chunk-mock-date.304e29b1.mjs';
5
+ import { e as executeInViteNode } from './chunk-runtime-mocker.49d21aa6.mjs';
6
+ import { r as rpc } from './chunk-runtime-rpc.57586b73.mjs';
7
7
  import { g as getWorkerState } from './chunk-utils-global.fa20c2f6.mjs';
8
- import 'path';
9
- import './vendor-picocolors.807856aa.mjs';
10
8
  import 'tty';
11
- import 'local-pkg';
12
- import 'module';
13
9
  import 'url';
10
+ import 'path';
11
+ import 'module';
14
12
  import 'vm';
15
- import './chunk-vite-node-utils.d8e5ff7b.mjs';
13
+ import './chunk-vite-node-utils.b432150c.mjs';
16
14
  import 'fs';
17
15
  import 'assert';
18
16
  import 'util';
19
17
  import 'debug';
18
+ import 'local-pkg';
20
19
  import 'vite';
21
20
  import './chunk-utils-timers.b48455ed.mjs';
22
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "A blazing fast unit test framework powered by Vite",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -94,7 +94,7 @@
94
94
  "debug": "^4.3.4",
95
95
  "local-pkg": "^0.4.2",
96
96
  "tinypool": "^0.2.4",
97
- "tinyspy": "^1.0.0",
97
+ "tinyspy": "^1.0.2",
98
98
  "vite": "^2.9.12 || ^3.0.0-0"
99
99
  },
100
100
  "devDependencies": {
@@ -107,7 +107,7 @@
107
107
  "@types/natural-compare": "^1.4.1",
108
108
  "@types/prompts": "^2.4.0",
109
109
  "@types/sinonjs__fake-timers": "^8.1.2",
110
- "@vitest/ui": "0.22.0",
110
+ "@vitest/ui": "0.22.1",
111
111
  "birpc": "^0.2.3",
112
112
  "cac": "^6.7.12",
113
113
  "chai-subset": "^1.6.0",
@@ -130,11 +130,11 @@
130
130
  "pkg-types": "^0.3.3",
131
131
  "pretty-format": "^27.5.1",
132
132
  "prompts": "^2.4.2",
133
- "rollup": "^2.77.3",
133
+ "rollup": "^2.78.0",
134
134
  "source-map-js": "^1.0.2",
135
135
  "strip-ansi": "^7.0.1",
136
136
  "typescript": "^4.7.4",
137
- "vite-node": "0.22.0",
137
+ "vite-node": "0.22.1",
138
138
  "ws": "^8.8.1"
139
139
  },
140
140
  "scripts": {
@@ -1,38 +0,0 @@
1
- import url from 'url';
2
- import { x as resolve } from './chunk-mock-date.debe9954.mjs';
3
-
4
- const rootDir = resolve(url.fileURLToPath(import.meta.url), "../../");
5
- const distDir = resolve(url.fileURLToPath(import.meta.url), "../../dist");
6
- const defaultPort = 51204;
7
- const API_PATH = "/__vitest_api__";
8
- const configFiles = [
9
- "vitest.config.ts",
10
- "vitest.config.mts",
11
- "vitest.config.cts",
12
- "vitest.config.js",
13
- "vitest.config.mjs",
14
- "vitest.config.cjs",
15
- "vite.config.ts",
16
- "vite.config.mts",
17
- "vite.config.cts",
18
- "vite.config.js",
19
- "vite.config.mjs",
20
- "vite.config.cjs"
21
- ];
22
- const globalApis = [
23
- "suite",
24
- "test",
25
- "describe",
26
- "it",
27
- "chai",
28
- "expect",
29
- "assert",
30
- "vitest",
31
- "vi",
32
- "beforeAll",
33
- "afterAll",
34
- "beforeEach",
35
- "afterEach"
36
- ];
37
-
38
- export { API_PATH as A, defaultPort as a, configFiles as c, distDir as d, globalApis as g, rootDir as r };
@@ -1,64 +0,0 @@
1
- import require$$0 from 'tty';
2
-
3
- var picocolors = {exports: {}};
4
-
5
- let tty = require$$0;
6
-
7
- let isColorSupported =
8
- !("NO_COLOR" in process.env || process.argv.includes("--no-color")) &&
9
- ("FORCE_COLOR" in process.env ||
10
- process.argv.includes("--color") ||
11
- process.platform === "win32" ||
12
- (tty.isatty(1) && process.env.TERM !== "dumb") ||
13
- "CI" in process.env);
14
-
15
- let formatter =
16
- (open, close, replace = open) =>
17
- input => {
18
- let string = "" + input;
19
- let index = string.indexOf(close, open.length);
20
- return ~index
21
- ? open + replaceClose(string, close, replace, index) + close
22
- : open + string + close
23
- };
24
-
25
- let replaceClose = (string, close, replace, index) => {
26
- let start = string.substring(0, index) + replace;
27
- let end = string.substring(index + close.length);
28
- let nextIndex = end.indexOf(close);
29
- return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end
30
- };
31
-
32
- let createColors = (enabled = isColorSupported) => ({
33
- isColorSupported: enabled,
34
- reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String,
35
- bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String,
36
- dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String,
37
- italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String,
38
- underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String,
39
- inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String,
40
- hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String,
41
- strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String,
42
- black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String,
43
- red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String,
44
- green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String,
45
- yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String,
46
- blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String,
47
- magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String,
48
- cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String,
49
- white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String,
50
- gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String,
51
- bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String,
52
- bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String,
53
- bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String,
54
- bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String,
55
- bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String,
56
- bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String,
57
- bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String,
58
- bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String,
59
- });
60
-
61
- picocolors.exports = createColors();
62
- picocolors.exports.createColors = createColors;
63
-
64
- export { picocolors as p };