vitest 1.3.0 → 1.3.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 (43) hide show
  1. package/LICENSE.md +1 -2
  2. package/dist/browser.d.ts +1 -1
  3. package/dist/browser.js +1 -1
  4. package/dist/chunks/{integrations-globals.FlQVNhQx.js → integrations-globals.THajbSRg.js} +3 -3
  5. package/dist/chunks/{runtime-runBaseTests.0UwIvo_U.js → runtime-runBaseTests.9RbsHRbU.js} +5 -5
  6. package/dist/cli.js +41 -1373
  7. package/dist/config.d.ts +1 -1
  8. package/dist/coverage.d.ts +6 -6
  9. package/dist/coverage.js +34 -3
  10. package/dist/environments.d.ts +1 -1
  11. package/dist/execute.d.ts +1 -1
  12. package/dist/execute.js +2 -2
  13. package/dist/index.d.ts +4 -3
  14. package/dist/index.js +4 -4
  15. package/dist/node.d.ts +11 -3
  16. package/dist/node.js +20 -12
  17. package/dist/{reporters-QGe8gs4b.d.ts → reporters-MmQN-57K.d.ts} +32 -7
  18. package/dist/reporters.d.ts +1 -1
  19. package/dist/reporters.js +2 -2
  20. package/dist/runners.d.ts +1 -1
  21. package/dist/runners.js +2 -2
  22. package/dist/{suite-xGC-mxBC.d.ts → suite-UrZdHRff.d.ts} +1 -1
  23. package/dist/suite.d.ts +2 -2
  24. package/dist/vendor/{base.knFzp7G3.js → base.N3JkKp7j.js} +1 -1
  25. package/dist/vendor/{base.RpormaJz.js → base.Z38YsPLm.js} +2 -2
  26. package/dist/vendor/{cli-api.RIYLcWhB.js → cac.wWT9ELdg.js} +6209 -74
  27. package/dist/vendor/{execute.aFSzc0Da.js → execute.27Kk4lQF.js} +1 -1
  28. package/dist/vendor/{index.CKbXK54q.js → index.9hqYxJUw.js} +1 -1
  29. package/dist/vendor/{index.n-Ib4UWN.js → index.JZMafwT-.js} +1 -1
  30. package/dist/vendor/{index.QcWmThJv.js → index.c1V_jzyZ.js} +7 -7
  31. package/dist/vendor/{setup-common.NSpEdAQm.js → setup-common.snyQUvE3.js} +1 -1
  32. package/dist/vendor/{vi.-Nr_x6dl.js → vi.C5mroSoP.js} +1 -1
  33. package/dist/vendor/{vm.UmCkcXp-.js → vm.o1IruPAo.js} +1 -1
  34. package/dist/worker.js +1 -1
  35. package/dist/workers/forks.js +3 -3
  36. package/dist/workers/runVmTests.js +5 -5
  37. package/dist/workers/threads.js +3 -3
  38. package/dist/workers/vmForks.js +3 -3
  39. package/dist/workers/vmThreads.js +3 -3
  40. package/dist/workers.d.ts +1 -1
  41. package/dist/workers.js +4 -4
  42. package/package.json +9 -9
  43. package/dist/chunks/api-setup.Xh60JpeM.js +0 -4771
@@ -7,7 +7,7 @@ import { processError } from '@vitest/utils/error';
7
7
  import { distDir } from '../path.js';
8
8
  import { existsSync, readdirSync } from 'node:fs';
9
9
  import { highlight, getType } from '@vitest/utils';
10
- import { g as getAllMockableProperties } from './base.knFzp7G3.js';
10
+ import { g as getAllMockableProperties } from './base.N3JkKp7j.js';
11
11
 
12
12
  const spyModulePath = resolve(distDir, "spy.js");
13
13
  class RefTracker {
@@ -5,7 +5,7 @@ import { distDir } from '../path.js';
5
5
  import { g as getWorkerState } from './global.CkGT_TMy.js';
6
6
  import { r as rpc } from './rpc.joBhAkyK.js';
7
7
  import { t as takeCoverageInsideWorker } from './coverage.E7sG1b3r.js';
8
- import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.NSpEdAQm.js';
8
+ import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.snyQUvE3.js';
9
9
 
10
10
  function setupChaiConfig(config) {
11
11
  Object.assign(chai.config, config);
@@ -1,7 +1,7 @@
1
1
  import { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
2
2
  import { b as bench } from './benchmark.eeqk2rd8.js';
3
3
  import { i as isFirstRun, a as runOnce } from './run-once.Olz_Zkd8.js';
4
- import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.-Nr_x6dl.js';
4
+ import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.C5mroSoP.js';
5
5
  import { g as getWorkerState } from './global.CkGT_TMy.js';
6
6
  import * as chai from 'chai';
7
7
  import { assert, should } from 'chai';
@@ -6,7 +6,7 @@ import c from 'picocolors';
6
6
  import { getSafeTimers, notNullish, inspect, positionToOffset, lineSplitRE, highlight, shuffle } from '@vitest/utils';
7
7
  import { performance } from 'node:perf_hooks';
8
8
  import { UNKNOWN_TEST_ID } from '../chunks/runtime-console.Iloo9fIt.js';
9
- import { b as slash, t as toArray, a as isPrimitive } from './base.knFzp7G3.js';
9
+ import { a as slash, t as toArray, b as isPrimitive } from './base.N3JkKp7j.js';
10
10
  import { g as getFullName, h as hasFailedSnapshot } from './tasks.IknbGB2n.js';
11
11
  import { isCI } from 'std-env';
12
12
  import { TraceMap, generatedPositionFor, parseErrorStacktrace } from '@vitest/utils/source-map';
@@ -24,8 +24,8 @@ import { parseAstAsync } from 'vite';
24
24
  import { ancestor } from 'acorn-walk';
25
25
  import process$2 from 'node:process';
26
26
  import { g as getDefaultExportFromCjs, c as commonjsGlobal } from './_commonjsHelpers.jjO7Zipk.js';
27
- import require$$0$1 from 'assert';
28
- import require$$2 from 'events';
27
+ import require$$0$2 from 'assert';
28
+ import require$$0$1 from 'events';
29
29
  import { createHash } from 'node:crypto';
30
30
  import { slash as slash$1 } from 'vite-node/utils';
31
31
 
@@ -3423,11 +3423,11 @@ if (!processOk(process$1)) {
3423
3423
  return function () {}
3424
3424
  };
3425
3425
  } else {
3426
- var assert = require$$0$1;
3426
+ var assert = require$$0$2;
3427
3427
  var signals = requireSignals();
3428
3428
  var isWin = /^win/i.test(process$1.platform);
3429
3429
 
3430
- var EE = require$$2;
3430
+ var EE = require$$0$1;
3431
3431
  /* istanbul ignore if */
3432
3432
  if (typeof EE !== 'function') {
3433
3433
  EE = EE.EventEmitter;
@@ -4310,7 +4310,7 @@ createLogUpdate(process$2.stdout);
4310
4310
 
4311
4311
  createLogUpdate(process$2.stderr);
4312
4312
 
4313
- var version = "1.3.0";
4313
+ var version = "1.3.1";
4314
4314
 
4315
4315
  const HIGHLIGHT_SUPPORTED_EXTS = new Set(["js", "ts"].flatMap((lang) => [
4316
4316
  `.${lang}`,
@@ -4924,4 +4924,4 @@ const ReportersMap = {
4924
4924
  "github-actions": GithubActionsReporter
4925
4925
  };
4926
4926
 
4927
- export { BaseSequencer as B, DefaultReporter as D, GithubActionsReporter as G, HangingProcessReporter as H, JsonReporter$1 as J, Logger as L, ReportersMap as R, TapReporter as T, VerboseReporter as V, BasicReporter as a, DotReporter as b, JUnitReporter as c, TapFlatReporter as d, BenchmarkReportsMap as e, divider as f, Typechecker as g, RandomSequencer as h, generateCodeFrame as i, highlightCode as j, stripAnsi as s };
4927
+ export { BaseSequencer as B, DefaultReporter as D, GithubActionsReporter as G, HangingProcessReporter as H, JsonReporter$1 as J, Logger as L, ReportersMap as R, TapReporter as T, VerboseReporter as V, BasicReporter as a, DotReporter as b, JUnitReporter as c, TapFlatReporter as d, BenchmarkReportsMap as e, Typechecker as f, RandomSequencer as g, generateCodeFrame as h, highlightCode as i, divider as j, stripAnsi as s };
@@ -11,7 +11,7 @@ async function setupCommonEnv(config) {
11
11
  globalSetup = true;
12
12
  setSafeTimers();
13
13
  if (config.globals)
14
- (await import('../chunks/integrations-globals.FlQVNhQx.js')).registerApiGlobally();
14
+ (await import('../chunks/integrations-globals.THajbSRg.js')).registerApiGlobally();
15
15
  }
16
16
  function setupDefines(defines) {
17
17
  for (const key in defines)
@@ -9,7 +9,7 @@ import { g as getFullName } from './tasks.IknbGB2n.js';
9
9
  import { g as getWorkerState, a as getCurrentEnvironment } from './global.CkGT_TMy.js';
10
10
  import { getSafeTimers, assertTypes, createSimpleStackTrace } from '@vitest/utils';
11
11
  import { parseSingleStack } from '@vitest/utils/source-map';
12
- import { i as isChildProcess } from './base.knFzp7G3.js';
12
+ import { i as isChildProcess } from './base.N3JkKp7j.js';
13
13
  import { R as RealDate, r as resetDate, m as mockDate } from './date.Ns1pGd_X.js';
14
14
  import { spyOn, fn, isMockFunction, mocks } from '@vitest/spy';
15
15
 
@@ -2,7 +2,7 @@ import vm, { isContext } from 'node:vm';
2
2
  import { fileURLToPath, pathToFileURL } from 'node:url';
3
3
  import { dirname, basename, extname, normalize, join, resolve } from 'pathe';
4
4
  import { createCustomConsole } from '../chunks/runtime-console.Iloo9fIt.js';
5
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.aFSzc0Da.js';
5
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.27Kk4lQF.js';
6
6
  import { distDir } from '../path.js';
7
7
  import { dirname as dirname$1 } from 'node:path';
8
8
  import { statSync, existsSync, readFileSync } from 'node:fs';
package/dist/worker.js CHANGED
@@ -3,7 +3,7 @@ import { workerId } from 'tinypool';
3
3
  import { ViteNodeRunner, ModuleCacheMap } from 'vite-node/client';
4
4
  import { resolve, normalize } from 'pathe';
5
5
  import { e as environments } from './vendor/index.GVFv9dZ0.js';
6
- import { i as isChildProcess, s as setProcessTitle } from './vendor/base.knFzp7G3.js';
6
+ import { i as isChildProcess, s as setProcessTitle } from './vendor/base.N3JkKp7j.js';
7
7
  import { createRequire } from 'node:module';
8
8
  import { c as createRuntimeRpc, a as rpcDone } from './vendor/rpc.joBhAkyK.js';
9
9
  import 'node:console';
@@ -1,10 +1,10 @@
1
1
  import v8 from 'node:v8';
2
2
  import { c as createForksRpcOptions, u as unwrapForksConfig } from '../vendor/utils.GbToHGHI.js';
3
- import { r as runBaseTests } from '../vendor/base.RpormaJz.js';
3
+ import { r as runBaseTests } from '../vendor/base.Z38YsPLm.js';
4
4
  import '@vitest/utils';
5
5
  import 'vite-node/client';
6
6
  import '../vendor/global.CkGT_TMy.js';
7
- import '../vendor/execute.aFSzc0Da.js';
7
+ import '../vendor/execute.27Kk4lQF.js';
8
8
  import 'node:vm';
9
9
  import 'node:url';
10
10
  import 'vite-node/utils';
@@ -12,7 +12,7 @@ import 'pathe';
12
12
  import '@vitest/utils/error';
13
13
  import '../path.js';
14
14
  import 'node:fs';
15
- import '../vendor/base.knFzp7G3.js';
15
+ import '../vendor/base.N3JkKp7j.js';
16
16
 
17
17
  class ForksBaseWorker {
18
18
  getRpcOptions() {
@@ -6,11 +6,11 @@ import { performance } from 'node:perf_hooks';
6
6
  import { startTests } from '@vitest/runner';
7
7
  import { setupColors, createColors } from '@vitest/utils';
8
8
  import { installSourcemapsSupport } from 'vite-node/source-map';
9
- import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.CKbXK54q.js';
9
+ import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.9hqYxJUw.js';
10
10
  import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.E7sG1b3r.js';
11
11
  import { g as getWorkerState } from '../vendor/global.CkGT_TMy.js';
12
- import { V as VitestIndex } from '../vendor/index.n-Ib4UWN.js';
13
- import { s as setupCommonEnv } from '../vendor/setup-common.NSpEdAQm.js';
12
+ import { V as VitestIndex } from '../vendor/index.JZMafwT-.js';
13
+ import { s as setupCommonEnv } from '../vendor/setup-common.snyQUvE3.js';
14
14
  import 'chai';
15
15
  import '@vitest/snapshot/environment';
16
16
  import 'pathe';
@@ -23,14 +23,14 @@ import '@vitest/runner/utils';
23
23
  import '../vendor/index.ir9i0ywP.js';
24
24
  import 'std-env';
25
25
  import '../vendor/run-once.Olz_Zkd8.js';
26
- import '../vendor/vi.-Nr_x6dl.js';
26
+ import '../vendor/vi.C5mroSoP.js';
27
27
  import '../vendor/_commonjsHelpers.jjO7Zipk.js';
28
28
  import '@vitest/expect';
29
29
  import '@vitest/snapshot';
30
30
  import '@vitest/utils/error';
31
31
  import '../vendor/tasks.IknbGB2n.js';
32
32
  import '@vitest/utils/source-map';
33
- import '../vendor/base.knFzp7G3.js';
33
+ import '../vendor/base.N3JkKp7j.js';
34
34
  import '../vendor/date.Ns1pGd_X.js';
35
35
  import '@vitest/spy';
36
36
 
@@ -1,8 +1,8 @@
1
- import { r as runBaseTests } from '../vendor/base.RpormaJz.js';
1
+ import { r as runBaseTests } from '../vendor/base.Z38YsPLm.js';
2
2
  import { a as createThreadsRpcOptions } from '../vendor/utils.GbToHGHI.js';
3
3
  import 'vite-node/client';
4
4
  import '../vendor/global.CkGT_TMy.js';
5
- import '../vendor/execute.aFSzc0Da.js';
5
+ import '../vendor/execute.27Kk4lQF.js';
6
6
  import 'node:vm';
7
7
  import 'node:url';
8
8
  import 'vite-node/utils';
@@ -11,7 +11,7 @@ import '@vitest/utils/error';
11
11
  import '../path.js';
12
12
  import 'node:fs';
13
13
  import '@vitest/utils';
14
- import '../vendor/base.knFzp7G3.js';
14
+ import '../vendor/base.N3JkKp7j.js';
15
15
 
16
16
  class ThreadsBaseWorker {
17
17
  getRpcOptions(ctx) {
@@ -1,6 +1,6 @@
1
1
  import v8 from 'node:v8';
2
2
  import { c as createForksRpcOptions, u as unwrapForksConfig } from '../vendor/utils.GbToHGHI.js';
3
- import { r as runVmTests } from '../vendor/vm.UmCkcXp-.js';
3
+ import { r as runVmTests } from '../vendor/vm.o1IruPAo.js';
4
4
  import '@vitest/utils';
5
5
  import 'node:vm';
6
6
  import 'node:url';
@@ -10,13 +10,13 @@ import 'node:stream';
10
10
  import 'node:console';
11
11
  import 'node:path';
12
12
  import '../vendor/date.Ns1pGd_X.js';
13
- import '../vendor/execute.aFSzc0Da.js';
13
+ import '../vendor/execute.27Kk4lQF.js';
14
14
  import 'vite-node/client';
15
15
  import 'vite-node/utils';
16
16
  import '@vitest/utils/error';
17
17
  import '../path.js';
18
18
  import 'node:fs';
19
- import '../vendor/base.knFzp7G3.js';
19
+ import '../vendor/base.N3JkKp7j.js';
20
20
  import 'node:module';
21
21
  import 'vite-node/constants';
22
22
  import '../vendor/index.ir9i0ywP.js';
@@ -1,5 +1,5 @@
1
1
  import { a as createThreadsRpcOptions } from '../vendor/utils.GbToHGHI.js';
2
- import { r as runVmTests } from '../vendor/vm.UmCkcXp-.js';
2
+ import { r as runVmTests } from '../vendor/vm.o1IruPAo.js';
3
3
  import '@vitest/utils';
4
4
  import 'node:vm';
5
5
  import 'node:url';
@@ -9,13 +9,13 @@ import 'node:stream';
9
9
  import 'node:console';
10
10
  import 'node:path';
11
11
  import '../vendor/date.Ns1pGd_X.js';
12
- import '../vendor/execute.aFSzc0Da.js';
12
+ import '../vendor/execute.27Kk4lQF.js';
13
13
  import 'vite-node/client';
14
14
  import 'vite-node/utils';
15
15
  import '@vitest/utils/error';
16
16
  import '../path.js';
17
17
  import 'node:fs';
18
- import '../vendor/base.knFzp7G3.js';
18
+ import '../vendor/base.N3JkKp7j.js';
19
19
  import 'node:module';
20
20
  import 'vite-node/constants';
21
21
  import '../vendor/index.ir9i0ywP.js';
package/dist/workers.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as v8 from 'v8';
2
- import { n as BirpcOptions, f as RuntimeRPC, o as ContextRPC, p as WorkerGlobalState, q as WorkerContext, R as ResolvedConfig } from './reporters-QGe8gs4b.js';
2
+ import { d as BirpcOptions, e as RuntimeRPC, f as ContextRPC, W as WorkerGlobalState, g as WorkerContext, R as ResolvedConfig } from './reporters-MmQN-57K.js';
3
3
  import { Awaitable } from '@vitest/utils';
4
4
  import 'vite';
5
5
  import '@vitest/runner';
package/dist/workers.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapForksConfig } from './vendor/utils.GbToHGHI.js';
2
2
  export { p as provideWorkerState } from './vendor/global.CkGT_TMy.js';
3
3
  export { run as runVitestWorker } from './worker.js';
4
- export { r as runVmTests } from './vendor/vm.UmCkcXp-.js';
5
- export { r as runBaseTests } from './vendor/base.RpormaJz.js';
4
+ export { r as runVmTests } from './vendor/vm.o1IruPAo.js';
5
+ export { r as runBaseTests } from './vendor/base.Z38YsPLm.js';
6
6
  import '@vitest/utils';
7
7
  import 'node:url';
8
8
  import 'tinypool';
@@ -10,7 +10,7 @@ import 'vite-node/client';
10
10
  import 'pathe';
11
11
  import './vendor/index.GVFv9dZ0.js';
12
12
  import 'node:console';
13
- import './vendor/base.knFzp7G3.js';
13
+ import './vendor/base.N3JkKp7j.js';
14
14
  import 'node:module';
15
15
  import './vendor/rpc.joBhAkyK.js';
16
16
  import './vendor/index.8bPxjt7g.js';
@@ -19,7 +19,7 @@ import './chunks/runtime-console.Iloo9fIt.js';
19
19
  import 'node:stream';
20
20
  import 'node:path';
21
21
  import './vendor/date.Ns1pGd_X.js';
22
- import './vendor/execute.aFSzc0Da.js';
22
+ import './vendor/execute.27Kk4lQF.js';
23
23
  import 'vite-node/utils';
24
24
  import '@vitest/utils/error';
25
25
  import './path.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "description": "Next generation testing framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -115,8 +115,8 @@
115
115
  "@types/node": "^18.0.0 || >=20.0.0",
116
116
  "happy-dom": "*",
117
117
  "jsdom": "*",
118
- "@vitest/browser": "1.3.0",
119
- "@vitest/ui": "1.3.0"
118
+ "@vitest/browser": "1.3.1",
119
+ "@vitest/ui": "1.3.1"
120
120
  },
121
121
  "peerDependenciesMeta": {
122
122
  "@edge-runtime/vm": {
@@ -153,12 +153,12 @@
153
153
  "tinypool": "^0.8.2",
154
154
  "vite": "^5.0.0",
155
155
  "why-is-node-running": "^2.2.2",
156
- "@vitest/expect": "1.3.0",
157
- "@vitest/runner": "1.3.0",
158
- "@vitest/spy": "1.3.0",
159
- "@vitest/snapshot": "1.3.0",
160
- "vite-node": "1.3.0",
161
- "@vitest/utils": "1.3.0"
156
+ "@vitest/expect": "1.3.1",
157
+ "@vitest/runner": "1.3.1",
158
+ "@vitest/snapshot": "1.3.1",
159
+ "@vitest/spy": "1.3.1",
160
+ "@vitest/utils": "1.3.1",
161
+ "vite-node": "1.3.1"
162
162
  },
163
163
  "devDependencies": {
164
164
  "@ampproject/remapping": "^2.2.1",