vitest 0.23.2 → 0.23.4

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.
@@ -20,7 +20,9 @@ const ENTRY = new URL("./cli.mjs", import.meta.url);
20
20
  const NODE_ARGS = [
21
21
  "--inspect",
22
22
  "--inspect-brk",
23
- "--trace-deprecation"
23
+ "--trace-deprecation",
24
+ "--experimental-wasm-threads",
25
+ "--wasm-atomics-on-non-shared-memory"
24
26
  ];
25
27
  const SegfaultErrors = [
26
28
  {
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'events';
2
2
  import { p as picocolors } from './chunk-constants.71e8a211.mjs';
3
- import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.f55c4577.mjs';
3
+ import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.8d8032d0.mjs';
4
4
  import 'tty';
5
5
  import 'url';
6
6
  import 'path';
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-d05ffb3f.js';
3
+ import { U as UserConfig$1, ad as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './global-e98f203b.js';
4
4
  import 'tinybench';
5
5
  import 'fs';
6
6
  import 'worker_threads';
package/dist/entry.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { promises } from 'fs';
2
2
  import { g as getWorkerState, a as resetModules } from './chunk-mock-date.2917be60.mjs';
3
3
  import { a as envs } from './chunk-env-node.ceb43f1c.mjs';
4
- import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-error.2723946b.mjs';
4
+ import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-error.f5506f40.mjs';
5
5
  import 'path';
6
6
  import './chunk-constants.71e8a211.mjs';
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.99c020eb.mjs';
13
- import './chunk-runtime-hooks.1a0bc3fd.mjs';
14
- import './chunk-runtime-chain.7a7f3c3b.mjs';
13
+ import './chunk-runtime-hooks.e4219ed5.mjs';
14
+ import './chunk-runtime-chain.0ab05798.mjs';
15
15
  import 'util';
16
16
  import 'chai';
17
17
  import './vendor-_commonjsHelpers.4da45ef5.mjs';
@@ -1,4 +1,4 @@
1
- import { a3 as Environment } from './global-d05ffb3f.js';
1
+ import { a3 as Environment } from './global-e98f203b.js';
2
2
  import 'vite';
3
3
  import 'tinybench';
4
4
  import 'fs';
@@ -166,6 +166,10 @@ interface Update {
166
166
  path: string
167
167
  acceptedPath: string
168
168
  timestamp: number
169
+ /**
170
+ * @experimental internal
171
+ */
172
+ explicitImportRequired?: boolean | undefined
169
173
  }
170
174
 
171
175
  interface PrunePayload {
@@ -1054,6 +1058,11 @@ interface BenchmarkUserOptions {
1054
1058
  * and/or paths to custom reporters
1055
1059
  */
1056
1060
  reporters?: Arrayable<BenchmarkBuiltinReporters | Reporter>;
1061
+ /**
1062
+ * Write test results to a file when the `--reporter=json` option is also specified.
1063
+ * Also definable individually per reporter by using an object instead.
1064
+ */
1065
+ outputFile?: string | (Partial<Record<BenchmarkBuiltinReporters, string>> & Record<string, string>);
1057
1066
  }
1058
1067
  interface Benchmark extends TaskBase {
1059
1068
  type: 'benchmark';
@@ -1068,7 +1077,7 @@ interface BenchmarkResult extends TaskResult$1 {
1068
1077
  rank: number;
1069
1078
  }
1070
1079
  declare type BenchFunction = (this: Bench) => Promise<void> | void;
1071
- declare type BenchmarkAPI = ChainableFunction<'skip', [
1080
+ declare type BenchmarkAPI = ChainableFunction<'skip' | 'only', [
1072
1081
  name: string,
1073
1082
  fn: BenchFunction,
1074
1083
  options?: Options
@@ -1175,7 +1184,8 @@ declare type TestAPI<ExtraContext = {}> = ChainableTestAPI<ExtraContext> & {
1175
1184
  };
1176
1185
  declare type ChainableSuiteAPI<ExtraContext = {}> = ChainableFunction<'concurrent' | 'only' | 'skip' | 'todo' | 'shuffle', [
1177
1186
  name: string,
1178
- factory?: SuiteFactory<ExtraContext>
1187
+ factory?: SuiteFactory<ExtraContext>,
1188
+ options?: number | TestOptions
1179
1189
  ], SuiteCollector<ExtraContext>, {
1180
1190
  each: TestEachFunction;
1181
1191
  <T extends ExtraContext>(name: string, factory?: SuiteFactory<T>): SuiteCollector<T>;
@@ -1954,7 +1964,9 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'
1954
1964
  reporters: (Reporter | BuiltinReporters)[];
1955
1965
  defines: Record<string, any>;
1956
1966
  api?: ApiConfig;
1957
- benchmark?: Required<BenchmarkUserOptions>;
1967
+ benchmark?: Required<Omit<BenchmarkUserOptions, 'outputFile'>> & {
1968
+ outputFile?: BenchmarkUserOptions['outputFile'];
1969
+ };
1958
1970
  shard?: {
1959
1971
  index: number;
1960
1972
  count: number;
@@ -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-d05ffb3f.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-e98f203b.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-60e2a8e1.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-60e2a8e1.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-d05ffb3f.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-d05ffb3f.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-6e18a03a.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-6e18a03a.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-e98f203b.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-e98f203b.js';
5
5
  import { TransformResult } from 'vite';
6
6
  import * as chai from 'chai';
7
7
  export { chai };
package/dist/index.mjs 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.7a7f3c3b.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.1a0bc3fd.mjs';
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.0ab05798.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.e4219ed5.mjs';
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-d05ffb3f.js';
2
- export { aq as TestSequencer, as as TestSequencerConstructor, t as Vitest, ar as startVitest } from './global-d05ffb3f.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-e98f203b.js';
2
+ export { aq as TestSequencer, as as TestSequencerConstructor, t as Vitest, ar as startVitest } from './global-e98f203b.js';
3
3
  import { UserConfig as UserConfig$1, Plugin } from 'vite';
4
4
  import 'tinybench';
5
5
  import 'fs';
package/dist/node.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.f55c4577.mjs';
2
- export { V as VitestRunner } from './chunk-runtime-mocker.8d4a2494.mjs';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.8d8032d0.mjs';
2
+ export { V as VitestRunner } from './chunk-runtime-mocker.4bbb070f.mjs';
3
3
  import './chunk-constants.71e8a211.mjs';
4
4
  import 'tty';
5
5
  import 'url';
package/dist/suite.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'util';
2
2
  import './chunk-mock-date.2917be60.mjs';
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.7a7f3c3b.mjs';
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.0ab05798.mjs';
4
4
  import 'path';
5
5
  import './chunk-constants.71e8a211.mjs';
6
6
  import 'tty';
package/dist/worker.mjs CHANGED
@@ -2,7 +2,7 @@ import { a as resolve, c as distDir } from './chunk-constants.71e8a211.mjs';
2
2
  import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.da0a17ff.mjs';
3
3
  import { workerId } from 'tinypool';
4
4
  import { g as getWorkerState } from './chunk-mock-date.2917be60.mjs';
5
- import { e as executeInViteNode } from './chunk-runtime-mocker.8d4a2494.mjs';
5
+ import { e as executeInViteNode } from './chunk-runtime-mocker.4bbb070f.mjs';
6
6
  import { r as rpc } from './chunk-runtime-rpc.00a890d2.mjs';
7
7
  import 'tty';
8
8
  import 'url';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest",
3
- "version": "0.23.2",
3
+ "version": "0.23.4",
4
4
  "description": "A blazing fast unit test framework powered by Vite",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -97,7 +97,7 @@
97
97
  "chai": "^4.3.6",
98
98
  "debug": "^4.3.4",
99
99
  "local-pkg": "^0.4.2",
100
- "strip-literal": "^0.4.0",
100
+ "strip-literal": "^0.4.1",
101
101
  "tinybench": "^2.1.5",
102
102
  "tinypool": "^0.3.0",
103
103
  "tinyspy": "^1.0.2",
@@ -113,7 +113,7 @@
113
113
  "@types/natural-compare": "^1.4.1",
114
114
  "@types/prompts": "^2.4.0",
115
115
  "@types/sinonjs__fake-timers": "^8.1.2",
116
- "@vitest/ui": "0.23.2",
116
+ "@vitest/ui": "0.23.4",
117
117
  "birpc": "^0.2.3",
118
118
  "cac": "^6.7.14",
119
119
  "chai-subset": "^1.6.0",
@@ -121,7 +121,7 @@
121
121
  "diff": "^5.1.0",
122
122
  "event-target-polyfill": "^0.0.3",
123
123
  "execa": "^6.1.0",
124
- "fast-glob": "^3.2.11",
124
+ "fast-glob": "^3.2.12",
125
125
  "find-up": "^6.3.0",
126
126
  "flatted": "^3.2.7",
127
127
  "happy-dom": "^6.0.4",
@@ -134,14 +134,14 @@
134
134
  "p-limit": "^4.0.0",
135
135
  "pathe": "^0.2.0",
136
136
  "picocolors": "^1.0.0",
137
- "pkg-types": "^0.3.4",
137
+ "pkg-types": "^0.3.5",
138
138
  "pretty-format": "^27.5.1",
139
139
  "prompts": "^2.4.2",
140
140
  "rollup": "^2.79.0",
141
141
  "source-map-js": "^1.0.2",
142
142
  "strip-ansi": "^7.0.1",
143
- "typescript": "^4.8.2",
144
- "vite-node": "0.23.2",
143
+ "typescript": "^4.8.3",
144
+ "vite-node": "0.23.4",
145
145
  "ws": "^8.8.1"
146
146
  },
147
147
  "scripts": {