vitest 2.0.0-beta.1 → 2.0.0-beta.10

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 (52) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/browser.d.ts +22 -2
  3. package/dist/browser.js +3 -1
  4. package/dist/chunks/{integrations-globals.B5Jl0grA.js → integrations-globals.C6Ah-pUW.js} +3 -3
  5. package/dist/chunks/{runtime-console.CUES-L8X.js → runtime-console.DiVMr5d4.js} +54 -24
  6. package/dist/chunks/{runtime-runBaseTests._dXkRAZc.js → runtime-runBaseTests.Cukyr5-I.js} +5 -5
  7. package/dist/cli.js +2 -2
  8. package/dist/config.cjs +3 -3
  9. package/dist/config.d.ts +2 -2
  10. package/dist/config.js +3 -3
  11. package/dist/coverage.d.ts +1 -1
  12. package/dist/coverage.js +33 -7
  13. package/dist/environments.d.ts +1 -1
  14. package/dist/environments.js +1 -1
  15. package/dist/execute.d.ts +2 -2
  16. package/dist/execute.js +1 -1
  17. package/dist/index.d.ts +11 -47
  18. package/dist/index.js +3 -3
  19. package/dist/node.d.ts +7 -7
  20. package/dist/node.js +12 -10
  21. package/dist/{reporters-MGvT5U9f.d.ts → reporters-CYVC6LOl.d.ts} +424 -201
  22. package/dist/reporters.d.ts +1 -1
  23. package/dist/reporters.js +4 -4
  24. package/dist/runners.d.ts +4 -2
  25. package/dist/runners.js +9 -1
  26. package/dist/{suite-8WAe-urM.d.ts → suite-Dpu9EC_k.d.ts} +1 -1
  27. package/dist/suite.d.ts +2 -2
  28. package/dist/vendor/{base.VFkIJ66g.js → base.Dln9yllP.js} +2 -2
  29. package/dist/vendor/{cac.DzKZaJu2.js → cac.CtYFkoSJ.js} +65 -23
  30. package/dist/vendor/{cli-api.DTeni0Qq.js → cli-api.CUtJc4r3.js} +2425 -549
  31. package/dist/vendor/{constants.5SOfHUj0.js → constants.TCjCaw2D.js} +4 -3
  32. package/dist/vendor/{execute.CLLNVNnK.js → execute.BHj6OMh4.js} +3 -3
  33. package/dist/vendor/{index.BfoZyXD1.js → index.B5SKBLvV.js} +1 -1
  34. package/dist/vendor/{index.CRxYS9H3.js → index.BOMEjpjj.js} +271 -52
  35. package/dist/vendor/{index.DP-km6lF.js → index.CThipSqB.js} +2537 -2524
  36. package/dist/vendor/{index.CmILuxzC.js → index.D3hs2WiI.js} +1 -1
  37. package/dist/vendor/{index.DeR1hhfY.js → index.kpsSqFiz.js} +2 -1
  38. package/dist/vendor/{setup-common.XeoZAW8t.js → setup-common.DAu7t7mY.js} +1 -1
  39. package/dist/vendor/spy.Cf_4R5Oe.js +22 -0
  40. package/dist/vendor/{utils.D5gGkwyH.js → utils.YuQ3LT2a.js} +1 -1
  41. package/dist/vendor/{vi.ClD3hi7L.js → vi.hATFzZbX.js} +101 -46
  42. package/dist/vendor/{vm.Bi3bljci.js → vm.Ow-X2mkS.js} +2 -2
  43. package/dist/worker.js +1 -1
  44. package/dist/workers/forks.js +2 -2
  45. package/dist/workers/runVmTests.js +4 -4
  46. package/dist/workers/threads.js +2 -2
  47. package/dist/workers/vmForks.js +3 -3
  48. package/dist/workers/vmThreads.js +3 -3
  49. package/dist/workers.d.ts +1 -1
  50. package/dist/workers.js +5 -5
  51. package/package.json +20 -20
  52. package/suppress-warnings.cjs +2 -1
@@ -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.BNLebNi5.js';
3
3
  import { i as isFirstRun, a as runOnce } from './run-once.DLomgGUH.js';
4
- import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.ClD3hi7L.js';
4
+ import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.hATFzZbX.js';
5
5
  import { g as getWorkerState } from './global.7bFbnyXl.js';
6
6
  import * as chai from 'chai';
7
7
  import { assert, should } from 'chai';
@@ -486,8 +486,9 @@ var jsdom = {
486
486
  ];
487
487
  for (const name of globalNames) {
488
488
  const value = globalThis[name];
489
- if (typeof value !== "undefined" && typeof dom.window[name] === "undefined")
489
+ if (typeof value !== "undefined" && typeof dom.window[name] === "undefined") {
490
490
  dom.window[name] = value;
491
+ }
491
492
  }
492
493
  return {
493
494
  getVmContext() {
@@ -12,7 +12,7 @@ async function setupCommonEnv(config) {
12
12
  globalSetup = true;
13
13
  setSafeTimers();
14
14
  if (config.globals)
15
- (await import('../chunks/integrations-globals.B5Jl0grA.js')).registerApiGlobally();
15
+ (await import('../chunks/integrations-globals.C6Ah-pUW.js')).registerApiGlobally();
16
16
  }
17
17
  function setupDefines(defines) {
18
18
  for (const key in defines)
@@ -0,0 +1,22 @@
1
+ import * as spy$1 from '@vitest/spy';
2
+
3
+ function _mergeNamespaces(n, m) {
4
+ m.forEach(function (e) {
5
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
6
+ if (k !== 'default' && !(k in n)) {
7
+ var d = Object.getOwnPropertyDescriptor(e, k);
8
+ Object.defineProperty(n, k, d.get ? d : {
9
+ enumerable: true,
10
+ get: function () { return e[k]; }
11
+ });
12
+ }
13
+ });
14
+ });
15
+ return Object.freeze(n);
16
+ }
17
+
18
+ var spy = /*#__PURE__*/_mergeNamespaces({
19
+ __proto__: null
20
+ }, [spy$1]);
21
+
22
+ export { spy as s };
@@ -214,4 +214,4 @@ var utils = /*#__PURE__*/Object.freeze({
214
214
  spinnerMap: spinnerMap
215
215
  });
216
216
 
217
- export { F_RIGHT as F, getStateString as a, formatTimeString as b, countTestErrors as c, divider as d, getCols as e, formatProjectName as f, getStateSymbol as g, getHookStateSymbol as h, F_POINTER as i, pointer as p, renderSnapshotSummary as r, stripAnsi as s, utils as u };
217
+ export { F_RIGHT as F, F_POINTER as a, getStateString as b, formatTimeString as c, countTestErrors as d, divider as e, formatProjectName as f, getStateSymbol as g, getCols as h, getHookStateSymbol as i, pointer as p, renderSnapshotSummary as r, stripAnsi as s, utils as u };
@@ -1,6 +1,6 @@
1
1
  import * as chai$1 from 'chai';
2
2
  import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
3
- import { equals, iterableEquality, subsetEquality, JestExtend, JestChaiExpect, JestAsymmetricMatchers, GLOBAL_EXPECT as GLOBAL_EXPECT$1, ASYMMETRIC_MATCHERS_OBJECT as ASYMMETRIC_MATCHERS_OBJECT$1, getState, setState, addCustomEqualityTesters } from '@vitest/expect';
3
+ import { equals, iterableEquality, subsetEquality, JestExtend, JestChaiExpect, JestAsymmetricMatchers, GLOBAL_EXPECT, ASYMMETRIC_MATCHERS_OBJECT, getState, setState, addCustomEqualityTesters } from '@vitest/expect';
4
4
  import { stripSnapshotIndentation, addSerializer, SnapshotClient } from '@vitest/snapshot';
5
5
  import { getNames } from '@vitest/runner/utils';
6
6
  import '@vitest/utils/error';
@@ -8,6 +8,8 @@ import { getCurrentTest } from '@vitest/runner';
8
8
  import { g as getTestName } from './tasks.WC7M-K-v.js';
9
9
  import { g as getWorkerState, a as getCurrentEnvironment } from './global.7bFbnyXl.js';
10
10
  import { getSafeTimers, assertTypes, createSimpleStackTrace } from '@vitest/utils';
11
+ import 'pathe';
12
+ import './env.bmJgw1qP.js';
11
13
  import { parseSingleStack } from '@vitest/utils/source-map';
12
14
  import { i as isChildProcess } from './base._gnK9Slw.js';
13
15
  import { R as RealDate, r as resetDate, m as mockDate } from './date.BKM1wewY.js';
@@ -142,32 +144,6 @@ var chaiSubset = {exports: {}};
142
144
  var chaiSubsetExports = chaiSubset.exports;
143
145
  var Subset = /*@__PURE__*/getDefaultExportFromCjs(chaiSubsetExports);
144
146
 
145
- const MATCHERS_OBJECT = Symbol.for("matchers-object");
146
- const JEST_MATCHERS_OBJECT = Symbol.for("$$jest-matchers-object");
147
- const GLOBAL_EXPECT = Symbol.for("expect-global");
148
- const ASYMMETRIC_MATCHERS_OBJECT = Symbol.for("asymmetric-matchers-object");
149
-
150
- if (!Object.prototype.hasOwnProperty.call(globalThis, MATCHERS_OBJECT)) {
151
- const globalState = /* @__PURE__ */ new WeakMap();
152
- const matchers = /* @__PURE__ */ Object.create(null);
153
- const customEqualityTesters = [];
154
- const assymetricMatchers = /* @__PURE__ */ Object.create(null);
155
- Object.defineProperty(globalThis, MATCHERS_OBJECT, {
156
- get: () => globalState
157
- });
158
- Object.defineProperty(globalThis, JEST_MATCHERS_OBJECT, {
159
- configurable: true,
160
- get: () => ({
161
- state: globalState.get(globalThis[GLOBAL_EXPECT]),
162
- matchers,
163
- customEqualityTesters
164
- })
165
- });
166
- Object.defineProperty(globalThis, ASYMMETRIC_MATCHERS_OBJECT, {
167
- get: () => assymetricMatchers
168
- });
169
- }
170
-
171
147
  function recordAsyncExpect(test, promise) {
172
148
  if (test && promise instanceof Promise) {
173
149
  promise = promise.finally(() => {
@@ -359,10 +335,85 @@ chai$1.use(Subset);
359
335
  chai$1.use(SnapshotPlugin);
360
336
  chai$1.use(JestAsymmetricMatchers);
361
337
 
338
+ const unsupported = [
339
+ // .poll is meant to retry matchers until they succeed, and
340
+ // snapshots will always succeed as long as the poll method doesn't thow an error
341
+ // in this case using the `vi.waitFor` method is more appropriate
342
+ "matchSnapshot",
343
+ "toMatchSnapshot",
344
+ "toMatchInlineSnapshot",
345
+ "toThrowErrorMatchingSnapshot",
346
+ "toThrowErrorMatchingInlineSnapshot",
347
+ // toThrow will never succeed because we call the poll callback until it doesn't throw
348
+ "throws",
349
+ "Throw",
350
+ "throw",
351
+ "toThrow",
352
+ "toThrowError"
353
+ // these are not supported because you can call them without `.poll`,
354
+ // we throw an error inside the rejects/resolves methods to prevent this
355
+ // rejects,
356
+ // resolves
357
+ ];
358
+ function createExpectPoll(expect) {
359
+ return function poll(fn, options = {}) {
360
+ var _a;
361
+ const state = getWorkerState();
362
+ const defaults = ((_a = state.config.expect) == null ? void 0 : _a.poll) ?? {};
363
+ const {
364
+ interval = defaults.interval ?? 50,
365
+ timeout = defaults.timeout ?? 1e3,
366
+ message
367
+ } = options;
368
+ const assertion = expect(null, message).withContext({ poll: true });
369
+ const proxy = new Proxy(assertion, {
370
+ get(target, key, receiver) {
371
+ const result = Reflect.get(target, key, receiver);
372
+ if (typeof result !== "function")
373
+ return result instanceof chai$1.Assertion ? proxy : result;
374
+ if (key === "assert")
375
+ return result;
376
+ if (typeof key === "string" && unsupported.includes(key))
377
+ throw new SyntaxError(`expect.poll() is not supported in combination with .${key}(). Use vi.waitFor() if your assertion condition is unstable.`);
378
+ return function(...args) {
379
+ const STACK_TRACE_ERROR = new Error("STACK_TRACE_ERROR");
380
+ return new Promise((resolve, reject) => {
381
+ let intervalId;
382
+ let lastError;
383
+ const { setTimeout, clearTimeout } = getSafeTimers();
384
+ const timeoutId = setTimeout(() => {
385
+ clearTimeout(intervalId);
386
+ reject(copyStackTrace$1(new Error(`Matcher did not succeed in ${timeout}ms`, { cause: lastError }), STACK_TRACE_ERROR));
387
+ }, timeout);
388
+ const check = async () => {
389
+ try {
390
+ chai$1.util.flag(this, "object", await fn());
391
+ resolve(await result.call(this, ...args));
392
+ clearTimeout(intervalId);
393
+ clearTimeout(timeoutId);
394
+ } catch (err) {
395
+ lastError = err;
396
+ intervalId = setTimeout(check, interval);
397
+ }
398
+ };
399
+ check();
400
+ });
401
+ };
402
+ }
403
+ });
404
+ return proxy;
405
+ };
406
+ }
407
+ function copyStackTrace$1(target, source) {
408
+ if (source.stack !== void 0)
409
+ target.stack = source.stack.replace(source.message, target.message);
410
+ return target;
411
+ }
412
+
362
413
  function createExpect(test) {
363
414
  const expect = (value, message) => {
364
415
  const { assertionCalls } = getState(expect);
365
- setState({ assertionCalls: assertionCalls + 1, soft: false }, expect);
416
+ setState({ assertionCalls: assertionCalls + 1 }, expect);
366
417
  const assert2 = chai$1.expect(value, message);
367
418
  const _test = test || getCurrentTest();
368
419
  if (_test)
@@ -371,10 +422,10 @@ function createExpect(test) {
371
422
  return assert2;
372
423
  };
373
424
  Object.assign(expect, chai$1.expect);
374
- Object.assign(expect, globalThis[ASYMMETRIC_MATCHERS_OBJECT$1]);
425
+ Object.assign(expect, globalThis[ASYMMETRIC_MATCHERS_OBJECT]);
375
426
  expect.getState = () => getState(expect);
376
427
  expect.setState = (state) => setState(state, expect);
377
- const globalState = getState(globalThis[GLOBAL_EXPECT$1]) || {};
428
+ const globalState = getState(globalThis[GLOBAL_EXPECT]) || {};
378
429
  const testPath = getTestFile(test);
379
430
  setState({
380
431
  // this should also add "snapshotState" that is added conditionally
@@ -391,12 +442,9 @@ function createExpect(test) {
391
442
  expect.extend = (matchers) => chai$1.expect.extend(expect, matchers);
392
443
  expect.addEqualityTesters = (customTesters) => addCustomEqualityTesters(customTesters);
393
444
  expect.soft = (...args) => {
394
- const assert2 = expect(...args);
395
- expect.setState({
396
- soft: true
397
- });
398
- return assert2;
445
+ return expect(...args).withContext({ soft: true });
399
446
  };
447
+ expect.poll = createExpectPoll(expect);
400
448
  expect.unreachable = (message) => {
401
449
  chai$1.assert.fail(`expected${message ? ` "${message}" ` : " "}not to be reached`);
402
450
  };
@@ -429,7 +477,7 @@ function getTestFile(test) {
429
477
  return state.filepath;
430
478
  }
431
479
  const globalExpect = createExpect();
432
- Object.defineProperty(globalThis, GLOBAL_EXPECT$1, {
480
+ Object.defineProperty(globalThis, GLOBAL_EXPECT, {
433
481
  value: globalExpect,
434
482
  writable: true,
435
483
  configurable: true
@@ -3228,6 +3276,8 @@ function waitFor(callback, options = {}) {
3228
3276
  resolve(result);
3229
3277
  };
3230
3278
  const handleTimeout = () => {
3279
+ if (intervalId)
3280
+ clearInterval(intervalId);
3231
3281
  let error = lastError;
3232
3282
  if (!error)
3233
3283
  error = copyStackTrace(new Error("Timed out in waitFor!"), STACK_TRACE_ERROR);
@@ -3276,6 +3326,8 @@ function waitUntil(callback, options = {}) {
3276
3326
  let timeoutId;
3277
3327
  let intervalId;
3278
3328
  const onReject = (error) => {
3329
+ if (intervalId)
3330
+ clearInterval(intervalId);
3279
3331
  if (!error)
3280
3332
  error = copyStackTrace(new Error("Timed out in waitUntil!"), STACK_TRACE_ERROR);
3281
3333
  reject(error);
@@ -3343,10 +3395,13 @@ function createVitest() {
3343
3395
  const _stubsGlobal = /* @__PURE__ */ new Map();
3344
3396
  const _stubsEnv = /* @__PURE__ */ new Map();
3345
3397
  const _envBooleans = ["PROD", "DEV", "SSR"];
3346
- const getImporter = () => {
3347
- const stackTrace = createSimpleStackTrace({ stackTraceLimit: 4 });
3348
- const importerStack = stackTrace.split("\n")[4];
3349
- const stack = parseSingleStack(importerStack);
3398
+ const getImporter = (name) => {
3399
+ const stackTrace = createSimpleStackTrace({ stackTraceLimit: 5 });
3400
+ const stackArray = stackTrace.split("\n");
3401
+ const importerStackIndex = stackArray.findIndex((stack2) => {
3402
+ return stack2.includes(` at Object.${name}`) || stack2.includes(`${name}@`);
3403
+ });
3404
+ const stack = parseSingleStack(stackArray[importerStackIndex + 1]);
3350
3405
  return (stack == null ? void 0 : stack.file) || "";
3351
3406
  };
3352
3407
  const utils = {
@@ -3441,7 +3496,7 @@ function createVitest() {
3441
3496
  mock(path, factory) {
3442
3497
  if (typeof path !== "string")
3443
3498
  throw new Error(`vi.mock() expects a string path, but received a ${typeof path}`);
3444
- const importer = getImporter();
3499
+ const importer = getImporter("mock");
3445
3500
  _mocker.queueMock(
3446
3501
  path,
3447
3502
  importer,
@@ -3452,12 +3507,12 @@ function createVitest() {
3452
3507
  unmock(path) {
3453
3508
  if (typeof path !== "string")
3454
3509
  throw new Error(`vi.unmock() expects a string path, but received a ${typeof path}`);
3455
- _mocker.queueUnmock(path, getImporter());
3510
+ _mocker.queueUnmock(path, getImporter("unmock"));
3456
3511
  },
3457
3512
  doMock(path, factory) {
3458
3513
  if (typeof path !== "string")
3459
3514
  throw new Error(`vi.doMock() expects a string path, but received a ${typeof path}`);
3460
- const importer = getImporter();
3515
+ const importer = getImporter("doMock");
3461
3516
  _mocker.queueMock(
3462
3517
  path,
3463
3518
  importer,
@@ -3468,17 +3523,17 @@ function createVitest() {
3468
3523
  doUnmock(path) {
3469
3524
  if (typeof path !== "string")
3470
3525
  throw new Error(`vi.doUnmock() expects a string path, but received a ${typeof path}`);
3471
- _mocker.queueUnmock(path, getImporter());
3526
+ _mocker.queueUnmock(path, getImporter("doUnmock"));
3472
3527
  },
3473
3528
  async importActual(path) {
3474
3529
  return _mocker.importActual(
3475
3530
  path,
3476
- getImporter(),
3531
+ getImporter("importActual"),
3477
3532
  _mocker.getMockContext().callstack
3478
3533
  );
3479
3534
  },
3480
3535
  async importMock(path) {
3481
- return _mocker.importMock(path, getImporter());
3536
+ return _mocker.importMock(path, getImporter("importMock"));
3482
3537
  },
3483
3538
  // this is typed in the interface so it's not necessary to type it here
3484
3539
  mocked(item, _options = {}) {
@@ -1,8 +1,8 @@
1
1
  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
- import { createCustomConsole } from '../chunks/runtime-console.CUES-L8X.js';
5
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.CLLNVNnK.js';
4
+ import { createCustomConsole } from '../chunks/runtime-console.DiVMr5d4.js';
5
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.BHj6OMh4.js';
6
6
  import { distDir } from '../path.js';
7
7
  import { dirname as dirname$1 } from 'node:path';
8
8
  import { statSync, existsSync, promises, 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 { readFileSync } from 'node:fs';
5
5
  import { resolve, normalize } from 'pathe';
6
- import { e as environments } from './vendor/index.DeR1hhfY.js';
6
+ import { e as environments } from './vendor/index.kpsSqFiz.js';
7
7
  import { i as isChildProcess, s as setProcessTitle } from './vendor/base._gnK9Slw.js';
8
8
  import { s as setupInspect } from './vendor/inspector.hPQncR7V.js';
9
9
  import { c as createRuntimeRpc, a as rpcDone } from './vendor/rpc.DRDE9Pu1.js';
@@ -1,10 +1,10 @@
1
1
  import v8 from 'node:v8';
2
2
  import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../vendor/utils.CUjzkRH7.js';
3
- import { r as runBaseTests } from '../vendor/base.VFkIJ66g.js';
3
+ import { r as runBaseTests } from '../vendor/base.Dln9yllP.js';
4
4
  import '@vitest/utils';
5
5
  import 'vite-node/client';
6
6
  import '../vendor/global.7bFbnyXl.js';
7
- import '../vendor/execute.CLLNVNnK.js';
7
+ import '../vendor/execute.BHj6OMh4.js';
8
8
  import 'node:vm';
9
9
  import 'node:url';
10
10
  import 'node:fs';
@@ -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 { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../vendor/index.BfoZyXD1.js';
9
+ import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../vendor/index.B5SKBLvV.js';
10
10
  import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.ChSqD-qS.js';
11
11
  import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
12
- import { V as VitestIndex } from '../vendor/index.CmILuxzC.js';
13
- import { s as setupCommonEnv } from '../vendor/setup-common.XeoZAW8t.js';
12
+ import { V as VitestIndex } from '../vendor/index.D3hs2WiI.js';
13
+ import { s as setupCommonEnv } from '../vendor/setup-common.DAu7t7mY.js';
14
14
  import { c as closeInspector } from '../vendor/inspector.hPQncR7V.js';
15
15
  import 'chai';
16
16
  import 'pathe';
@@ -24,7 +24,7 @@ import '../vendor/index._7XLd8Kd.js';
24
24
  import '../vendor/env.bmJgw1qP.js';
25
25
  import 'std-env';
26
26
  import '../vendor/run-once.DLomgGUH.js';
27
- import '../vendor/vi.ClD3hi7L.js';
27
+ import '../vendor/vi.hATFzZbX.js';
28
28
  import '../vendor/_commonjsHelpers.BFTU3MAI.js';
29
29
  import '@vitest/expect';
30
30
  import '@vitest/snapshot';
@@ -1,8 +1,8 @@
1
- import { r as runBaseTests } from '../vendor/base.VFkIJ66g.js';
1
+ import { r as runBaseTests } from '../vendor/base.Dln9yllP.js';
2
2
  import { a as createThreadsRpcOptions } from '../vendor/utils.CUjzkRH7.js';
3
3
  import 'vite-node/client';
4
4
  import '../vendor/global.7bFbnyXl.js';
5
- import '../vendor/execute.CLLNVNnK.js';
5
+ import '../vendor/execute.BHj6OMh4.js';
6
6
  import 'node:vm';
7
7
  import 'node:url';
8
8
  import 'node:fs';
@@ -1,11 +1,11 @@
1
1
  import v8 from 'node:v8';
2
2
  import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../vendor/utils.CUjzkRH7.js';
3
- import { r as runVmTests } from '../vendor/vm.Bi3bljci.js';
3
+ import { r as runVmTests } from '../vendor/vm.Ow-X2mkS.js';
4
4
  import '@vitest/utils';
5
5
  import 'node:vm';
6
6
  import 'node:url';
7
7
  import 'pathe';
8
- import '../chunks/runtime-console.CUES-L8X.js';
8
+ import '../chunks/runtime-console.DiVMr5d4.js';
9
9
  import 'node:stream';
10
10
  import 'node:console';
11
11
  import 'node:path';
@@ -14,7 +14,7 @@ import '@vitest/runner/utils';
14
14
  import '../vendor/global.7bFbnyXl.js';
15
15
  import '../vendor/env.bmJgw1qP.js';
16
16
  import 'std-env';
17
- import '../vendor/execute.CLLNVNnK.js';
17
+ import '../vendor/execute.BHj6OMh4.js';
18
18
  import 'node:fs';
19
19
  import 'vite-node/client';
20
20
  import 'vite-node/utils';
@@ -1,10 +1,10 @@
1
1
  import { a as createThreadsRpcOptions } from '../vendor/utils.CUjzkRH7.js';
2
- import { r as runVmTests } from '../vendor/vm.Bi3bljci.js';
2
+ import { r as runVmTests } from '../vendor/vm.Ow-X2mkS.js';
3
3
  import '@vitest/utils';
4
4
  import 'node:vm';
5
5
  import 'node:url';
6
6
  import 'pathe';
7
- import '../chunks/runtime-console.CUES-L8X.js';
7
+ import '../chunks/runtime-console.DiVMr5d4.js';
8
8
  import 'node:stream';
9
9
  import 'node:console';
10
10
  import 'node:path';
@@ -13,7 +13,7 @@ import '@vitest/runner/utils';
13
13
  import '../vendor/global.7bFbnyXl.js';
14
14
  import '../vendor/env.bmJgw1qP.js';
15
15
  import 'std-env';
16
- import '../vendor/execute.CLLNVNnK.js';
16
+ import '../vendor/execute.BHj6OMh4.js';
17
17
  import 'node:fs';
18
18
  import 'vite-node/client';
19
19
  import 'vite-node/utils';
package/dist/workers.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as v8 from 'v8';
2
- import { d as BirpcOptions, e as RuntimeRPC, f as ContextRPC, W as WorkerGlobalState, g as WorkerContext, R as ResolvedConfig } from './reporters-MGvT5U9f.js';
2
+ import { d as BirpcOptions, e as RuntimeRPC, f as ContextRPC, W as WorkerGlobalState, g as WorkerContext, R as ResolvedConfig } from './reporters-CYVC6LOl.js';
3
3
  import { Awaitable } from '@vitest/utils';
4
4
  import 'vite';
5
5
  import '@vitest/runner';
package/dist/workers.js CHANGED
@@ -1,15 +1,15 @@
1
1
  export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './vendor/utils.CUjzkRH7.js';
2
2
  export { p as provideWorkerState } from './vendor/global.7bFbnyXl.js';
3
3
  export { run as runVitestWorker } from './worker.js';
4
- export { r as runVmTests } from './vendor/vm.Bi3bljci.js';
5
- export { r as runBaseTests } from './vendor/base.VFkIJ66g.js';
4
+ export { r as runVmTests } from './vendor/vm.Ow-X2mkS.js';
5
+ export { r as runBaseTests } from './vendor/base.Dln9yllP.js';
6
6
  import '@vitest/utils';
7
7
  import 'node:url';
8
8
  import 'tinypool';
9
9
  import 'vite-node/client';
10
10
  import 'node:fs';
11
11
  import 'pathe';
12
- import './vendor/index.DeR1hhfY.js';
12
+ import './vendor/index.kpsSqFiz.js';
13
13
  import 'node:console';
14
14
  import './vendor/base._gnK9Slw.js';
15
15
  import './vendor/inspector.hPQncR7V.js';
@@ -17,14 +17,14 @@ import 'node:module';
17
17
  import './vendor/rpc.DRDE9Pu1.js';
18
18
  import './vendor/index.BpSiYbpB.js';
19
19
  import 'node:vm';
20
- import './chunks/runtime-console.CUES-L8X.js';
20
+ import './chunks/runtime-console.DiVMr5d4.js';
21
21
  import 'node:stream';
22
22
  import 'node:path';
23
23
  import './vendor/date.BKM1wewY.js';
24
24
  import '@vitest/runner/utils';
25
25
  import './vendor/env.bmJgw1qP.js';
26
26
  import 'std-env';
27
- import './vendor/execute.CLLNVNnK.js';
27
+ import './vendor/execute.BHj6OMh4.js';
28
28
  import 'vite-node/utils';
29
29
  import '@vitest/utils/error';
30
30
  import './path.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.1",
4
+ "version": "2.0.0-beta.10",
5
5
  "description": "Next generation testing framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -119,8 +119,8 @@
119
119
  "@types/node": "^18.0.0 || >=20.0.0",
120
120
  "happy-dom": "*",
121
121
  "jsdom": "*",
122
- "@vitest/ui": "2.0.0-beta.1",
123
- "@vitest/browser": "2.0.0-beta.1"
122
+ "@vitest/browser": "2.0.0-beta.10",
123
+ "@vitest/ui": "2.0.0-beta.10"
124
124
  },
125
125
  "peerDependenciesMeta": {
126
126
  "@edge-runtime/vm": {
@@ -143,35 +143,36 @@
143
143
  }
144
144
  },
145
145
  "dependencies": {
146
+ "@ampproject/remapping": "^2.3.0",
146
147
  "chai": "^5.1.1",
147
- "debug": "^4.3.4",
148
+ "debug": "^4.3.5",
148
149
  "execa": "^8.0.1",
149
150
  "magic-string": "^0.30.10",
150
151
  "pathe": "^1.1.2",
151
- "picocolors": "^1.0.0",
152
+ "picocolors": "^1.0.1",
152
153
  "std-env": "^3.7.0",
153
154
  "tinybench": "^2.8.0",
154
- "tinypool": "^0.8.4",
155
+ "tinypool": "^1.0.0",
155
156
  "vite": "^5.0.0",
156
157
  "why-is-node-running": "^2.2.2",
157
- "@vitest/runner": "2.0.0-beta.1",
158
- "@vitest/expect": "2.0.0-beta.1",
159
- "@vitest/snapshot": "2.0.0-beta.1",
160
- "@vitest/utils": "2.0.0-beta.1",
161
- "@vitest/spy": "2.0.0-beta.1",
162
- "vite-node": "2.0.0-beta.1"
158
+ "@vitest/expect": "2.0.0-beta.10",
159
+ "@vitest/runner": "2.0.0-beta.10",
160
+ "@vitest/snapshot": "2.0.0-beta.10",
161
+ "@vitest/utils": "2.0.0-beta.10",
162
+ "@vitest/spy": "2.0.0-beta.10",
163
+ "vite-node": "2.0.0-beta.10"
163
164
  },
164
165
  "devDependencies": {
165
- "@ampproject/remapping": "^2.3.0",
166
166
  "@antfu/install-pkg": "0.3.1",
167
167
  "@edge-runtime/vm": "^3.2.0",
168
168
  "@sinonjs/fake-timers": "11.1.0",
169
+ "@types/debug": "^4.1.12",
169
170
  "@types/estree": "^1.0.5",
170
171
  "@types/istanbul-lib-coverage": "^2.0.6",
171
172
  "@types/istanbul-reports": "^3.0.4",
172
- "@types/jsdom": "^21.1.6",
173
+ "@types/jsdom": "^21.1.7",
173
174
  "@types/micromatch": "^4.0.7",
174
- "@types/node": "^20.12.11",
175
+ "@types/node": "^20.14.2",
175
176
  "@types/prompts": "^2.4.9",
176
177
  "@types/sinonjs__fake-timers": "^8.1.5",
177
178
  "acorn-walk": "^8.3.2",
@@ -183,13 +184,12 @@
183
184
  "fast-glob": "^3.3.2",
184
185
  "find-up": "^6.3.0",
185
186
  "flatted": "^3.3.1",
186
- "get-tsconfig": "^4.7.4",
187
- "happy-dom": "^14.10.1",
188
- "jsdom": "^24.0.0",
187
+ "get-tsconfig": "^4.7.5",
188
+ "happy-dom": "^14.12.0",
189
+ "jsdom": "^24.1.0",
189
190
  "local-pkg": "^0.5.0",
190
191
  "log-update": "^5.0.1",
191
- "micromatch": "^4.0.5",
192
- "p-limit": "^5.0.0",
192
+ "micromatch": "^4.0.7",
193
193
  "pretty-format": "^29.7.0",
194
194
  "prompts": "^2.4.2",
195
195
  "strip-ansi": "^7.1.0",
@@ -15,8 +15,9 @@ process.emit = function (event, warning) {
15
15
  if (
16
16
  event === 'warning'
17
17
  && ignoreWarnings.has(warning.message)
18
- )
18
+ ) {
19
19
  return
20
+ }
20
21
 
21
22
  // eslint-disable-next-line prefer-rest-params
22
23
  return Reflect.apply(emit, this, arguments)