vitest 0.25.1 → 0.25.2

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.js CHANGED
@@ -1,7 +1,7 @@
1
- export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.e387e274.js';
2
- import { e as dist } from './chunk-runtime-test-state.4ed42543.js';
3
- export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-runtime-test-state.4ed42543.js';
4
- export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.5c4e0f49.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.a0b441dc.js';
2
+ import { e as dist } from './chunk-runtime-test-state.3cbc4575.js';
3
+ export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-runtime-test-state.3cbc4575.js';
4
+ export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.419ccdd8.js';
5
5
  import * as chai from 'chai';
6
6
  export { chai };
7
7
  export { assert, should } from 'chai';
@@ -1,5 +1,5 @@
1
1
  import { promises } from 'fs';
2
- import { c as createBirpc } from './chunk-vite-node-client.b2ab6dcf.js';
2
+ import { c as createBirpc } from './chunk-vite-node-client.85cc7113.js';
3
3
  import require$$0$1 from 'stream';
4
4
  import require$$0 from 'zlib';
5
5
  import require$$3 from 'net';
@@ -1,9 +1,9 @@
1
1
  import { m as globalApis } from './chunk-utils-env.03f840f2.js';
2
- import { i as index } from './chunk-runtime-test-state.4ed42543.js';
2
+ import { i as index } from './chunk-runtime-test-state.3cbc4575.js';
3
3
  import 'tty';
4
4
  import 'url';
5
5
  import 'path';
6
- import './chunk-runtime-chain.e387e274.js';
6
+ import './chunk-runtime-chain.a0b441dc.js';
7
7
  import 'util';
8
8
  import './chunk-typecheck-constants.4891f22f.js';
9
9
  import 'local-pkg';
@@ -168,7 +168,7 @@ function eq(a, b, aStack, bStack, customTesters, hasKey2) {
168
168
  return Object.is(a.valueOf(), b.valueOf());
169
169
  }
170
170
  case "[object Date]":
171
- return +a === +b;
171
+ return isNaN(a) && isNaN(b) || +a === +b;
172
172
  case "[object RegExp]":
173
173
  return a.source === b.source && a.flags === b.flags;
174
174
  }
@@ -1,4 +1,4 @@
1
- import { V as ViteNodeRunner } from './chunk-vite-node-client.b2ab6dcf.js';
1
+ import { V as ViteNodeRunner } from './chunk-vite-node-client.85cc7113.js';
2
2
  import { normalizePath } from 'vite';
3
3
  import { g as getWorkerState, H as mergeSlashes, s as slash, w as getType, I as getAllMockableProperties } from './chunk-typecheck-constants.4891f22f.js';
4
4
  import { existsSync, readdirSync } from 'fs';
@@ -1,8 +1,8 @@
1
1
  import { performance } from 'perf_hooks';
2
2
  import { s as someTasksAreOnly, i as interpretTaskModes, t as takeCoverageInsideWorker, p as pLimit } from './chunk-integrations-coverage.befed097.js';
3
- import { r as resetRunOnceCounter, i as index, v as vi, s as setCurrentTest } from './chunk-runtime-test-state.4ed42543.js';
3
+ import { r as resetRunOnceCounter, i as index, v as vi, s as setCurrentTest } from './chunk-runtime-test-state.3cbc4575.js';
4
4
  import { g as getWorkerState, R as RealDate, t as toArray, k as relativePath, h as isRunningInBenchmark, p as partitionSuiteChildren, l as shuffle, o as hasTests, q as hasFailed, u as createDefer, e as getFullName } from './chunk-typecheck-constants.4891f22f.js';
5
- import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getBenchOptions, n as getFn, o as setState, G as GLOBAL_EXPECT, p as getState } from './chunk-runtime-chain.e387e274.js';
5
+ import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getBenchOptions, n as getFn, o as setState, G as GLOBAL_EXPECT, p as getState } from './chunk-runtime-chain.a0b441dc.js';
6
6
  import { r as rpc } from './chunk-runtime-rpc.1e7530d3.js';
7
7
  import { p as processError } from './chunk-runtime-error.6287172c.js';
8
8
  import require$$0 from 'source-map';
@@ -750,7 +750,7 @@ async function setupGlobalEnv(config) {
750
750
  await setupConsoleLogSpy();
751
751
  }
752
752
  if (config.globals)
753
- (await import('./chunk-integrations-globals.796fe181.js')).registerApiGlobally();
753
+ (await import('./chunk-integrations-globals.06c8d418.js')).registerApiGlobally();
754
754
  }
755
755
  function setupDefines(defines) {
756
756
  for (const key in defines)
@@ -1050,7 +1050,7 @@ const callCleanupHooks = async (cleanups) => {
1050
1050
  async function runTest(test) {
1051
1051
  var _a, _b, _c;
1052
1052
  if (test.mode !== "run") {
1053
- const { getSnapshotClient } = await import('./chunk-runtime-chain.e387e274.js').then(function (n) { return n.r; });
1053
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.a0b441dc.js').then(function (n) { return n.r; });
1054
1054
  getSnapshotClient().skipTestSnapshots(test);
1055
1055
  return;
1056
1056
  }
@@ -1067,7 +1067,7 @@ async function runTest(test) {
1067
1067
  clearModuleMocks();
1068
1068
  setCurrentTest(test);
1069
1069
  if (isNode) {
1070
- const { getSnapshotClient } = await import('./chunk-runtime-chain.e387e274.js').then(function (n) { return n.r; });
1070
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.a0b441dc.js').then(function (n) { return n.r; });
1071
1071
  await getSnapshotClient().setTest(test);
1072
1072
  }
1073
1073
  const workerState = getWorkerState();
@@ -1130,7 +1130,7 @@ async function runTest(test) {
1130
1130
  console.error(test.result.error.message, test.result.error.stackStr);
1131
1131
  setCurrentTest(void 0);
1132
1132
  if (isNode) {
1133
- const { getSnapshotClient } = await import('./chunk-runtime-chain.e387e274.js').then(function (n) { return n.r; });
1133
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.a0b441dc.js').then(function (n) { return n.r; });
1134
1134
  getSnapshotClient().clearTest();
1135
1135
  }
1136
1136
  test.result.duration = now() - start;
@@ -1336,7 +1336,7 @@ async function startTestsBrowser(paths, config) {
1336
1336
  async function startTestsNode(paths, config) {
1337
1337
  const files = await collectTests(paths, config);
1338
1338
  rpc().onCollected(files);
1339
- const { getSnapshotClient } = await import('./chunk-runtime-chain.e387e274.js').then(function (n) { return n.r; });
1339
+ const { getSnapshotClient } = await import('./chunk-runtime-chain.a0b441dc.js').then(function (n) { return n.r; });
1340
1340
  getSnapshotClient().clear();
1341
1341
  await runFiles(files, config);
1342
1342
  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.e387e274.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.a0b441dc.js';
2
2
  import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules } from './chunk-typecheck-constants.4891f22f.js';
3
3
  import { p as parseStacktrace } from './chunk-utils-source-map.c6dfbbc1.js';
4
4
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
@@ -2,7 +2,7 @@ import { createRequire } from 'module';
2
2
  import { pathToFileURL, fileURLToPath } from 'url';
3
3
  import vm from 'vm';
4
4
  import { b as resolve, d as dirname, g as isAbsolute, l as extname } from './chunk-utils-env.03f840f2.js';
5
- import { s as slash, n as normalizeRequestId, b as toFilePath, i as isNodeBuiltin, c as isPrimitive, d as normalizeModuleId, m as mergeSlashes } from './chunk-vite-node-utils.8f0b4a12.js';
5
+ import { s as slash, n as normalizeRequestId, b as toFilePath, c as isPrimitive, i as isNodeBuiltin, d as normalizeModuleId, m as mergeSlashes } from './chunk-vite-node-utils.8f0b4a12.js';
6
6
  import createDebug from 'debug';
7
7
 
8
8
  const debugExecute = createDebug("vite-node:client:execute");
@@ -209,7 +209,7 @@ ${getStack()}`), 2e3);
209
209
  set(_, p, value) {
210
210
  if (!Reflect.has(exports, "default"))
211
211
  exports.default = {};
212
- if (exports.default === null || typeof exports.default !== "object") {
212
+ if (isPrimitive(exports.default)) {
213
213
  defineExport(exports, p, () => void 0);
214
214
  return true;
215
215
  }
@@ -12,7 +12,7 @@ import util$2 from 'util';
12
12
  import require$$0$1 from 'stream';
13
13
  import require$$2 from 'events';
14
14
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
15
- import { c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-client.b2ab6dcf.js';
15
+ import { c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-client.85cc7113.js';
16
16
  import { performance } from 'perf_hooks';
17
17
  import createDebug from 'debug';
18
18
  import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap } from './chunk-vite-node-utils.8f0b4a12.js';
@@ -35,7 +35,7 @@ import { stripLiteral } from 'strip-literal';
35
35
  import require$$0$2 from 'readline';
36
36
  import { p as prompts } from './vendor-index.9f20a9be.js';
37
37
 
38
- var version$1 = "0.25.1";
38
+ var version$1 = "0.25.2";
39
39
 
40
40
  class EndError extends Error {
41
41
  constructor(value) {
@@ -10188,7 +10188,7 @@ createLogUpdate(process$1.stdout);
10188
10188
 
10189
10189
  createLogUpdate(process$1.stderr);
10190
10190
 
10191
- var version = "0.25.1";
10191
+ var version = "0.25.2";
10192
10192
 
10193
10193
  function fileFromParsedStack(stack) {
10194
10194
  var _a, _b;
@@ -11357,7 +11357,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
11357
11357
  try {
11358
11358
  await ctx.setServer(options, server);
11359
11359
  if (options.api && options.watch)
11360
- (await import('./chunk-api-setup.f40616e2.js')).setup(ctx);
11360
+ (await import('./chunk-api-setup.c5a9009c.js')).setup(ctx);
11361
11361
  } catch (err) {
11362
11362
  ctx.logger.printError(err, true);
11363
11363
  process.exit(1);
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { p as picocolors, n as normalize } from './chunk-utils-env.03f840f2.js';
2
2
  import { EventEmitter } from 'events';
3
- import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.477f36a4.js';
3
+ import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.72a4d20b.js';
4
4
  import 'tty';
5
5
  import 'url';
6
6
  import 'path';
@@ -16,7 +16,7 @@ import 'os';
16
16
  import 'util';
17
17
  import 'stream';
18
18
  import './vendor-_commonjsHelpers.addc3445.js';
19
- import './chunk-vite-node-client.b2ab6dcf.js';
19
+ import './chunk-vite-node-client.85cc7113.js';
20
20
  import 'module';
21
21
  import 'vm';
22
22
  import './chunk-vite-node-utils.8f0b4a12.js';
package/dist/entry.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { promises } from 'fs';
2
2
  import { g as getWorkerState, a as resetModules } from './chunk-typecheck-constants.4891f22f.js';
3
- import { v as vi } from './chunk-runtime-test-state.4ed42543.js';
3
+ import { v as vi } from './chunk-runtime-test-state.3cbc4575.js';
4
4
  import { a as envs } from './chunk-env-node.67948209.js';
5
- import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.5c4e0f49.js';
5
+ import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.419ccdd8.js';
6
6
  import 'path';
7
7
  import './chunk-utils-env.03f840f2.js';
8
8
  import 'tty';
9
9
  import 'url';
10
10
  import 'local-pkg';
11
- import './chunk-runtime-chain.e387e274.js';
11
+ import './chunk-runtime-chain.a0b441dc.js';
12
12
  import 'util';
13
13
  import 'chai';
14
14
  import './vendor-_commonjsHelpers.addc3445.js';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
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.e387e274.js';
2
- import { e as dist } from './chunk-runtime-test-state.4ed42543.js';
3
- export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, k as getRunningMode, h as isFirstRun, l as isWatchMode, o as onTestFailed, g as runOnce, v as vi, j as vitest, w as withCallback } from './chunk-runtime-test-state.4ed42543.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.a0b441dc.js';
2
+ import { e as dist } from './chunk-runtime-test-state.3cbc4575.js';
3
+ export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, k as getRunningMode, h as isFirstRun, l as isWatchMode, o as onTestFailed, g as runOnce, v as vi, j as vitest, w as withCallback } from './chunk-runtime-test-state.3cbc4575.js';
4
4
  import * as chai from 'chai';
5
5
  export { chai };
6
6
  export { assert, should } from 'chai';
package/dist/node.js CHANGED
@@ -1,5 +1,5 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.477f36a4.js';
2
- export { V as VitestRunner } from './chunk-runtime-mocker.503a4f67.js';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.72a4d20b.js';
2
+ export { V as VitestRunner } from './chunk-runtime-mocker.a5151f99.js';
3
3
  import './chunk-utils-env.03f840f2.js';
4
4
  import 'tty';
5
5
  import 'url';
@@ -17,7 +17,7 @@ import 'util';
17
17
  import 'stream';
18
18
  import 'events';
19
19
  import './vendor-_commonjsHelpers.addc3445.js';
20
- import './chunk-vite-node-client.b2ab6dcf.js';
20
+ import './chunk-vite-node-client.85cc7113.js';
21
21
  import 'module';
22
22
  import 'vm';
23
23
  import './chunk-vite-node-utils.8f0b4a12.js';
package/dist/suite.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'util';
2
2
  import './chunk-typecheck-constants.4891f22f.js';
3
- export { b as bench, f as clearCollectorContext, q as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.e387e274.js';
3
+ export { b as bench, f as clearCollectorContext, q as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.a0b441dc.js';
4
4
  import 'path';
5
5
  import './chunk-utils-env.03f840f2.js';
6
6
  import 'tty';
package/dist/worker.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { b as resolve, e as distDir } from './chunk-utils-env.03f840f2.js';
2
- import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.b2ab6dcf.js';
2
+ import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.85cc7113.js';
3
3
  import { workerId } from 'tinypool';
4
4
  import { g as getWorkerState } from './chunk-typecheck-constants.4891f22f.js';
5
- import { e as executeInViteNode } from './chunk-runtime-mocker.503a4f67.js';
5
+ import { e as executeInViteNode } from './chunk-runtime-mocker.a5151f99.js';
6
6
  import { r as rpc } from './chunk-runtime-rpc.1e7530d3.js';
7
7
  import { p as processError } from './chunk-runtime-error.6287172c.js';
8
8
  import 'tty';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.25.1",
4
+ "version": "0.25.2",
5
5
  "description": "A blazing fast unit test framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -118,14 +118,14 @@
118
118
  "devDependencies": {
119
119
  "@antfu/install-pkg": "^0.1.1",
120
120
  "@edge-runtime/vm": "2.0.1",
121
- "@sinonjs/fake-timers": "^9.1.2",
121
+ "@sinonjs/fake-timers": "^10.0.0",
122
122
  "@types/diff": "^5.0.2",
123
123
  "@types/jsdom": "^20.0.0",
124
124
  "@types/micromatch": "^4.0.2",
125
125
  "@types/natural-compare": "^1.4.1",
126
126
  "@types/prompts": "^2.4.1",
127
127
  "@types/sinonjs__fake-timers": "^8.1.2",
128
- "@vitest/ui": "0.25.1",
128
+ "@vitest/ui": "0.25.2",
129
129
  "birpc": "^0.2.3",
130
130
  "cac": "^6.7.14",
131
131
  "chai-subset": "^1.6.0",
@@ -154,7 +154,7 @@
154
154
  "rollup": "^2.79.1",
155
155
  "strip-ansi": "^7.0.1",
156
156
  "typescript": "^4.8.4",
157
- "vite-node": "0.25.1",
157
+ "vite-node": "0.25.2",
158
158
  "ws": "^8.11.0"
159
159
  },
160
160
  "scripts": {