vitest 0.24.0 → 0.24.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.
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-e0804ba8.js';
2
- import { R as ResolvedConfig } from './global-6d79484b.js';
3
- export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-6d79484b.js';
1
+ export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-40e0cb97.js';
2
+ import { R as ResolvedConfig } from './global-732f9b14.js';
3
+ export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-732f9b14.js';
4
4
  import * as chai from 'chai';
5
5
  export { chai };
6
6
  export { assert, should } from 'chai';
package/dist/browser.js CHANGED
@@ -1,6 +1,6 @@
1
- export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.4dd0a07a.js';
2
- export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.72f95cdb.js';
3
- export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.38d92035.js';
1
+ export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.ca293c72.js';
2
+ export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.1260cc21.js';
3
+ export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.c53389c7.js';
4
4
  import * as chai from 'chai';
5
5
  export { chai };
6
6
  export { assert, should } from 'chai';
@@ -1,9 +1,9 @@
1
1
  import { k as globalApis } from './chunk-constants.22640ce4.js';
2
- import { i as index } from './chunk-runtime-hooks.72f95cdb.js';
2
+ import { i as index } from './chunk-runtime-hooks.1260cc21.js';
3
3
  import 'tty';
4
4
  import 'url';
5
5
  import 'path';
6
- import './chunk-runtime-chain.4dd0a07a.js';
6
+ import './chunk-runtime-chain.ca293c72.js';
7
7
  import 'util';
8
8
  import './chunk-mock-date.b1b404e8.js';
9
9
  import 'local-pkg';
@@ -723,6 +723,11 @@ class MagicString {
723
723
  }
724
724
 
725
725
  overwrite(start, end, content, options) {
726
+ options = options || {};
727
+ return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
728
+ }
729
+
730
+ update(start, end, content, options) {
726
731
  if (typeof content !== 'string') throw new TypeError('replacement content must be a string');
727
732
 
728
733
  while (start < 0) start += this.original.length;
@@ -748,7 +753,7 @@ class MagicString {
748
753
  options = { storeName: true };
749
754
  }
750
755
  const storeName = options !== undefined ? options.storeName : false;
751
- const contentOnly = options !== undefined ? options.contentOnly : false;
756
+ const overwrite = options !== undefined ? options.overwrite : false;
752
757
 
753
758
  if (storeName) {
754
759
  const original = this.original.slice(start, end);
@@ -772,7 +777,7 @@ class MagicString {
772
777
  chunk.edit('', false);
773
778
  }
774
779
 
775
- first.edit(content, storeName, contentOnly);
780
+ first.edit(content, storeName, !overwrite);
776
781
  } else {
777
782
  // must be inserting at the end
778
783
  const newChunk = new Chunk(start, end, '').edit(content, storeName);
@@ -600,7 +600,7 @@ function deepMergeSnapshot(target, source) {
600
600
  }
601
601
 
602
602
  async function saveInlineSnapshots(snapshots) {
603
- const MagicString = (await import('./chunk-magic-string.cacfbf9d.js')).default;
603
+ const MagicString = (await import('./chunk-magic-string.ffe2b171.js')).default;
604
604
  const files = new Set(snapshots.map((i) => i.file));
605
605
  await Promise.all(Array.from(files).map(async (file) => {
606
606
  const map = await rpc().getSourceMap(file);
@@ -1,8 +1,8 @@
1
1
  import { performance } from 'perf_hooks';
2
2
  import { t as takeCoverageInsideWorker, p as pLimit } from './chunk-integrations-coverage.cca09977.js';
3
- import { r as resetRunOnceCounter, i as index, v as vi } from './chunk-runtime-hooks.72f95cdb.js';
3
+ import { r as resetRunOnceCounter, i as index, v as vi } from './chunk-runtime-hooks.1260cc21.js';
4
4
  import { k as deepClone, l as getType, o as isNode, g as getWorkerState, R as RealDate, t as toArray, p as relativePath, q as isBrowser, h as isRunningInBenchmark, u as partitionSuiteChildren, v as shuffle, w as hasTests, x as hasFailed, y as createDefer, d as assertTypes, e as getFullName } from './chunk-mock-date.b1b404e8.js';
5
- import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getFn, n as setState, G as GLOBAL_EXPECT, o as getState } from './chunk-runtime-chain.4dd0a07a.js';
5
+ import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getFn, n as setState, G as GLOBAL_EXPECT, o as getState } from './chunk-runtime-chain.ca293c72.js';
6
6
  import { r as rpc } from './chunk-runtime-rpc.4f6f88e8.js';
7
7
  import util$1 from 'util';
8
8
  import { util } from 'chai';
@@ -154,7 +154,7 @@ async function setupGlobalEnv(config) {
154
154
  if (isNode)
155
155
  await setupConsoleLogSpy();
156
156
  if (config.globals)
157
- (await import('./chunk-integrations-globals.f50b2307.js')).registerApiGlobally();
157
+ (await import('./chunk-integrations-globals.56d5b05b.js')).registerApiGlobally();
158
158
  }
159
159
  function setupDefines(defines) {
160
160
  for (const key in defines)
@@ -498,7 +498,7 @@ const callCleanupHooks = async (cleanups) => {
498
498
  async function runTest(test) {
499
499
  var _a, _b;
500
500
  if (test.mode !== "run") {
501
- const { getSnapshotClient } = await import('./chunk-runtime-chain.4dd0a07a.js').then(function (n) { return n.q; });
501
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.ca293c72.js').then(function (n) { return n.q; });
502
502
  getSnapshotClient().skipTestSnapshots(test);
503
503
  return;
504
504
  }
@@ -514,7 +514,7 @@ async function runTest(test) {
514
514
  updateTask(test);
515
515
  clearModuleMocks();
516
516
  if (isNode) {
517
- const { getSnapshotClient } = await import('./chunk-runtime-chain.4dd0a07a.js').then(function (n) { return n.q; });
517
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.ca293c72.js').then(function (n) { return n.q; });
518
518
  await getSnapshotClient().setTest(test);
519
519
  }
520
520
  const workerState = getWorkerState();
@@ -574,7 +574,7 @@ async function runTest(test) {
574
574
  if (isBrowser && test.result.error)
575
575
  console.error(test.result.error.message, test.result.error.stackStr);
576
576
  if (isNode) {
577
- const { getSnapshotClient } = await import('./chunk-runtime-chain.4dd0a07a.js').then(function (n) { return n.q; });
577
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.ca293c72.js').then(function (n) { return n.q; });
578
578
  getSnapshotClient().clearTest();
579
579
  }
580
580
  test.result.duration = now() - start;
@@ -777,7 +777,7 @@ async function startTestsBrowser(paths, config) {
777
777
  async function startTestsNode(paths, config) {
778
778
  const files = await collectTests(paths, config);
779
779
  rpc().onCollected(files);
780
- const { getSnapshotClient } = await import('./chunk-runtime-chain.4dd0a07a.js').then(function (n) { return n.q; });
780
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.ca293c72.js').then(function (n) { return n.q; });
781
781
  getSnapshotClient().clear();
782
782
  await runFiles(files, config);
783
783
  const coverage = await takeCoverageInsideWorker(config.coverage);
@@ -1,4 +1,4 @@
1
- import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, b as bench, c as createExpect, e as globalExpect } from './chunk-runtime-chain.4dd0a07a.js';
1
+ import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, b as bench, c as createExpect, e as globalExpect } from './chunk-runtime-chain.ca293c72.js';
2
2
  import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules } from './chunk-mock-date.b1b404e8.js';
3
3
  import { p as parseStacktrace } from './chunk-utils-source-map.175ffa40.js';
4
4
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
@@ -24,12 +24,12 @@ import { resolveModule } from 'local-pkg';
24
24
  import { createHash } from 'crypto';
25
25
  import { o as onetime } from './vendor-index.c902d578.js';
26
26
  import { s as signalExit } from './vendor-index.8919d83a.js';
27
- import MagicString from './chunk-magic-string.cacfbf9d.js';
27
+ import MagicString from './chunk-magic-string.ffe2b171.js';
28
28
  import { stripLiteral } from 'strip-literal';
29
29
  import require$$0$2 from 'readline';
30
30
  import { p as prompts } from './vendor-index.9f20a9be.js';
31
31
 
32
- var version$1 = "0.24.0";
32
+ var version$1 = "0.24.1";
33
33
 
34
34
  class EndError extends Error {
35
35
  constructor(value) {
@@ -9464,7 +9464,7 @@ createLogUpdate(process$1.stdout);
9464
9464
 
9465
9465
  createLogUpdate(process$1.stderr);
9466
9466
 
9467
- var version = "0.24.0";
9467
+ var version = "0.24.1";
9468
9468
 
9469
9469
  function fileFromParsedStack(stack) {
9470
9470
  var _a, _b;
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'events';
2
2
  import { p as picocolors } from './chunk-constants.22640ce4.js';
3
- import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.a2e9daf4.js';
3
+ import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.94f78ce5.js';
4
4
  import 'tty';
5
5
  import 'url';
6
6
  import 'path';
@@ -30,7 +30,7 @@ import './chunk-utils-timers.ab764c0c.js';
30
30
  import 'crypto';
31
31
  import './vendor-index.c902d578.js';
32
32
  import './vendor-index.8919d83a.js';
33
- import './chunk-magic-string.cacfbf9d.js';
33
+ import './chunk-magic-string.ffe2b171.js';
34
34
  import 'strip-literal';
35
35
  import 'readline';
36
36
  import './vendor-index.9f20a9be.js';
package/dist/config.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { UserConfig as UserConfig$2, ConfigEnv } from 'vite';
2
2
  export { ConfigEnv } from 'vite';
3
- import { U as UserConfig$1, ad as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './global-6d79484b.js';
3
+ import { U as UserConfig$1, ad as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './global-732f9b14.js';
4
4
  import 'tinybench';
5
5
  import 'fs';
6
6
  import 'worker_threads';
package/dist/entry.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { promises } from 'fs';
2
2
  import { g as getWorkerState, a as resetModules } from './chunk-mock-date.b1b404e8.js';
3
3
  import { a as envs } from './chunk-env-node.700b7e95.js';
4
- import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-error.38d92035.js';
4
+ import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-error.c53389c7.js';
5
5
  import 'path';
6
6
  import './chunk-constants.22640ce4.js';
7
7
  import 'tty';
@@ -10,8 +10,8 @@ import 'local-pkg';
10
10
  import 'console';
11
11
  import 'perf_hooks';
12
12
  import './chunk-integrations-coverage.cca09977.js';
13
- import './chunk-runtime-hooks.72f95cdb.js';
14
- import './chunk-runtime-chain.4dd0a07a.js';
13
+ import './chunk-runtime-hooks.1260cc21.js';
14
+ import './chunk-runtime-chain.ca293c72.js';
15
15
  import 'util';
16
16
  import 'chai';
17
17
  import './vendor-_commonjsHelpers.addc3445.js';
@@ -21,6 +21,14 @@ import './chunk-utils-source-map.175ffa40.js';
21
21
  import './spy.js';
22
22
  import 'tinyspy';
23
23
 
24
+ function groupBy(collection, iteratee) {
25
+ return collection.reduce((acc, item) => {
26
+ const key = iteratee(item);
27
+ acc[key] || (acc[key] = []);
28
+ acc[key].push(item);
29
+ return acc;
30
+ }, {});
31
+ }
24
32
  async function run(files, config) {
25
33
  await setupGlobalEnv(config);
26
34
  const workerState = getWorkerState();
@@ -30,19 +38,17 @@ async function run(files, config) {
30
38
  return;
31
39
  }
32
40
  const filesWithEnv = await Promise.all(files.map(async (file) => {
33
- var _a;
41
+ var _a, _b;
34
42
  const code = await promises.readFile(file, "utf-8");
35
43
  const env = ((_a = code.match(/@(?:vitest|jest)-environment\s+?([\w-]+)\b/)) == null ? void 0 : _a[1]) || config.environment || "node";
44
+ const envOptions = JSON.parse(((_b = code.match(/@(?:vitest|jest)-environment-options\s+?(.+)/)) == null ? void 0 : _b[1]) || "null");
36
45
  return {
37
46
  file,
38
- env
47
+ env,
48
+ envOptions: envOptions ? { [env]: envOptions } : null
39
49
  };
40
50
  }));
41
- const filesByEnv = filesWithEnv.reduce((acc, { file, env }) => {
42
- acc[env] || (acc[env] = []);
43
- acc[env].push(file);
44
- return acc;
45
- }, {});
51
+ const filesByEnv = groupBy(filesWithEnv, ({ env }) => env);
46
52
  const orderedEnvs = envs.concat(
47
53
  Object.keys(filesByEnv).filter((env) => !envs.includes(env))
48
54
  );
@@ -51,17 +57,23 @@ async function run(files, config) {
51
57
  const files2 = filesByEnv[environment];
52
58
  if (!files2 || !files2.length)
53
59
  continue;
54
- await withEnv(environment, config.environmentOptions || {}, async () => {
55
- for (const file of files2) {
56
- if (config.isolate) {
57
- workerState.mockMap.clear();
58
- resetModules(workerState.moduleCache, true);
60
+ const filesByOptions = groupBy(files2, ({ envOptions }) => JSON.stringify(envOptions));
61
+ for (const options of Object.keys(filesByOptions)) {
62
+ const files3 = filesByOptions[options];
63
+ if (!files3 || !files3.length)
64
+ continue;
65
+ await withEnv(environment, files3[0].envOptions || config.environmentOptions || {}, async () => {
66
+ for (const { file } of files3) {
67
+ if (config.isolate) {
68
+ workerState.mockMap.clear();
69
+ resetModules(workerState.moduleCache, true);
70
+ }
71
+ workerState.filepath = file;
72
+ await startTests([file], config);
73
+ workerState.filepath = void 0;
59
74
  }
60
- workerState.filepath = file;
61
- await startTests([file], config);
62
- workerState.filepath = void 0;
63
- }
64
- });
75
+ });
76
+ }
65
77
  }
66
78
  }
67
79
 
@@ -1,4 +1,4 @@
1
- import { a3 as Environment } from './global-6d79484b.js';
1
+ import { a3 as Environment } from './global-732f9b14.js';
2
2
  import 'vite';
3
3
  import 'tinybench';
4
4
  import 'fs';
@@ -1220,10 +1220,6 @@ interface RuntimeContext {
1220
1220
  currentSuite: SuiteCollector | null;
1221
1221
  }
1222
1222
  interface TestContext {
1223
- /**
1224
- * @deprecated Use promise instead
1225
- */
1226
- (error?: any): void;
1227
1223
  /**
1228
1224
  * Metadata of the current test
1229
1225
  */
@@ -1,5 +1,5 @@
1
1
  import { SpyImpl } from 'tinyspy';
2
- import { m as SuiteAPI, l as TestAPI, al as BenchmarkAPI, o as SuiteHooks, H as HookListener, s as TestContext, S as Suite, n as HookCleanupCallback, h as Test } from './global-6d79484b.js';
2
+ import { m as SuiteAPI, l as TestAPI, al as BenchmarkAPI, o as SuiteHooks, H as HookListener, s as TestContext, S as Suite, n as HookCleanupCallback, h as Test } from './global-732f9b14.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-e0804ba8.js';
2
- export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-e0804ba8.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-6d79484b.js';
4
- export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-6d79484b.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-40e0cb97.js';
2
+ export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-40e0cb97.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-732f9b14.js';
4
+ export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-732f9b14.js';
5
5
  import { TransformResult } from 'vite';
6
6
  import * as chai from 'chai';
7
7
  export { chai };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { b as bench, c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.4dd0a07a.js';
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.72f95cdb.js';
1
+ export { b as bench, c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.ca293c72.js';
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.1260cc21.js';
3
3
  import * as chai from 'chai';
4
4
  export { chai };
5
5
  export { assert, should } from 'chai';
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as VitestRunMode, U as UserConfig, t as Vitest, am as ModuleCacheMap, an as ViteNodeRunnerOptions, ao as MockMap, ap as ViteNodeRunner, aq as TestSequencer } from './global-6d79484b.js';
2
- export { aq as TestSequencer, as as TestSequencerConstructor, t as Vitest, ar as startVitest } from './global-6d79484b.js';
1
+ import { c as VitestRunMode, U as UserConfig, t as Vitest, am as ModuleCacheMap, an as ViteNodeRunnerOptions, ao as MockMap, ap as ViteNodeRunner, aq as TestSequencer } from './global-732f9b14.js';
2
+ export { aq as TestSequencer, as as TestSequencerConstructor, t as Vitest, ar as startVitest } from './global-732f9b14.js';
3
3
  import { UserConfig as UserConfig$1, Plugin } from 'vite';
4
4
  import 'tinybench';
5
5
  import 'fs';
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.a2e9daf4.js';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.94f78ce5.js';
2
2
  export { V as VitestRunner } from './chunk-runtime-mocker.623b90b6.js';
3
3
  import './chunk-constants.22640ce4.js';
4
4
  import 'tty';
@@ -31,7 +31,7 @@ import './chunk-utils-timers.ab764c0c.js';
31
31
  import 'crypto';
32
32
  import './vendor-index.c902d578.js';
33
33
  import './vendor-index.8919d83a.js';
34
- import './chunk-magic-string.cacfbf9d.js';
34
+ import './chunk-magic-string.ffe2b171.js';
35
35
  import 'strip-literal';
36
36
  import 'readline';
37
37
  import './vendor-index.9f20a9be.js';
package/dist/suite.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'util';
2
2
  import './chunk-mock-date.b1b404e8.js';
3
- export { b as bench, f as clearCollectorContext, p as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.4dd0a07a.js';
3
+ export { b as bench, f as clearCollectorContext, p as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.ca293c72.js';
4
4
  import 'path';
5
5
  import './chunk-constants.22640ce4.js';
6
6
  import 'tty';
package/index.d.cts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/index.js'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.24.0",
4
+ "version": "0.24.1",
5
5
  "description": "A blazing fast unit test framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -67,6 +67,7 @@
67
67
  "dist",
68
68
  "bin",
69
69
  "*.d.ts",
70
+ "*.d.cts",
70
71
  "*.mjs",
71
72
  "*.cjs"
72
73
  ],
@@ -105,7 +106,7 @@
105
106
  "debug": "^4.3.4",
106
107
  "local-pkg": "^0.4.2",
107
108
  "strip-literal": "^0.4.2",
108
- "tinybench": "^2.2.1",
109
+ "tinybench": "^2.3.0",
109
110
  "tinypool": "^0.3.0",
110
111
  "tinyspy": "^1.0.2",
111
112
  "vite": "^3.0.0"
@@ -118,9 +119,9 @@
118
119
  "@types/jsdom": "^20.0.0",
119
120
  "@types/micromatch": "^4.0.2",
120
121
  "@types/natural-compare": "^1.4.1",
121
- "@types/prompts": "^2.4.0",
122
+ "@types/prompts": "^2.4.1",
122
123
  "@types/sinonjs__fake-timers": "^8.1.2",
123
- "@vitest/ui": "0.24.0",
124
+ "@vitest/ui": "0.24.1",
124
125
  "birpc": "^0.2.3",
125
126
  "cac": "^6.7.14",
126
127
  "chai-subset": "^1.6.0",
@@ -134,7 +135,7 @@
134
135
  "happy-dom": "^6.0.4",
135
136
  "jsdom": "^20.0.1",
136
137
  "log-update": "^5.0.1",
137
- "magic-string": "^0.26.5",
138
+ "magic-string": "^0.26.7",
138
139
  "micromatch": "^4.0.5",
139
140
  "mlly": "^0.5.16",
140
141
  "natural-compare": "^1.4.0",
@@ -148,7 +149,7 @@
148
149
  "source-map-js": "^1.0.2",
149
150
  "strip-ansi": "^7.0.1",
150
151
  "typescript": "^4.8.4",
151
- "vite-node": "0.24.0",
152
+ "vite-node": "0.24.1",
152
153
  "ws": "^8.9.0"
153
154
  },
154
155
  "scripts": {