@depup/vitest 5.0.1-depup.0 → 5.0.3-depup.0

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 (72) hide show
  1. package/LICENSE.md +28 -0
  2. package/README.md +9 -7
  3. package/browser/context.d.ts +7 -1
  4. package/browser/context.js +5 -5
  5. package/changes.json +14 -6
  6. package/dist/browser.d.ts +4 -4
  7. package/dist/browser.js +10 -10
  8. package/dist/chunks/{base.Cc3oda2V.js → base.DhkQeZwd.js} +14 -14
  9. package/dist/chunks/{browser.d.g5Thl309.d.ts → browser.d.3cffPS1V.d.ts} +3 -3
  10. package/dist/chunks/{cac.fSuRXrAx.js → cac.DfDGTQ9W.js} +13 -13
  11. package/dist/chunks/{cli-api.DcLieX4F.js → cli-api.C4x4GGip.js} +5 -5
  12. package/dist/chunks/{config.d.CU_b-wJj.d.ts → config.d.BxjInJat.d.ts} +13 -15
  13. package/dist/chunks/{console.B09ye7y0.js → console.RBA5x-0t.js} +3 -2
  14. package/dist/chunks/{coverage.AipniaqB.js → coverage.S6Dao4g-.js} +1 -1
  15. package/dist/chunks/{coverage.CX7NN5s7.js → coverage._yXj5zeb.js} +1 -1
  16. package/dist/chunks/{creator.BEj8pIIH.js → creator.203NYCo3.js} +12 -12
  17. package/dist/chunks/{display.pkpxlVcY.js → display.CXBnkt9a.js} +1 -1
  18. package/dist/chunks/{doctor.DR3u0Z_G.js → doctor.CpHPRoza.js} +2 -2
  19. package/dist/chunks/{environment.d.C6xYahWA.d.ts → environment.d.DAj1Vt__.d.ts} +1 -1
  20. package/dist/chunks/{globals.D9ucJdZZ.js → globals.9QtHn8Sr.js} +9 -9
  21. package/dist/chunks/{index.m3L2HgmY.js → index.C4tKZ0yW.js} +29 -15
  22. package/dist/chunks/{index.DzobfTyw.js → index.DpLw24bj.js} +177 -85
  23. package/dist/chunks/{index.M2dsQ_UQ.js → index.cx-_w29y.js} +551 -179
  24. package/dist/chunks/{index.DNv8WNGe.js → index.ggMXe2IF.js} +17 -7
  25. package/dist/chunks/{index.D4dXTzh9.js → index.k8L_ZRzq.js} +24 -7
  26. package/dist/chunks/{init-forks.DgHqDQHC.js → init-forks.hzLs7kMZ.js} +1 -1
  27. package/dist/chunks/{init-threads.B-t1iYCi.js → init-threads.COb0VD5D.js} +1 -1
  28. package/dist/chunks/{init.3UJvPvQg.js → init.D0qF-GGk.js} +4 -5
  29. package/dist/chunks/{native.CF4uT5hY.js → native.CBlba4VV.js} +2 -2
  30. package/dist/chunks/{nativeModuleMocker.B20FEd-E.js → nativeModuleMocker.CXSh3m91.js} +2 -2
  31. package/dist/chunks/{nativeModuleRunner.J0QLzNtK.js → nativeModuleRunner.jwZPY3dg.js} +1 -1
  32. package/dist/chunks/{node.CfQ_OGWr.js → node.BzimPqT5.js} +1 -1
  33. package/dist/chunks/{pathe.M-eThtNZ.DwEga6ro.js → pathe.M-eThtNZ.CknpM8Or.js} +1 -1
  34. package/dist/chunks/{plugin.d.CN87HSxv.d.ts → plugin.d.BsjqSb4-.d.ts} +35 -27
  35. package/dist/chunks/{plugins.Cigb0uSy.js → plugins.D2ut1V9b.js} +1 -1
  36. package/dist/chunks/{resolver.NpfwMKt9.js → resolver.fbW9AUvG.js} +1 -1
  37. package/dist/chunks/{rpc.Bvs-iVxs.js → rpc.BTmCtPly.js} +8 -6
  38. package/dist/chunks/{rpc.d.DA9Utv4e.d.ts → rpc.d.BPFHl-HE.d.ts} +1 -1
  39. package/dist/chunks/{run.C5UmxDPh.js → run.BTlFXlnv.js} +29 -19
  40. package/dist/chunks/{setup-common.BkQOiNcI.js → setup-common.BglbuAHD.js} +3 -3
  41. package/dist/chunks/{source-map.BH0bbrs9.js → source-map.DUxvo12T.js} +4 -8
  42. package/dist/chunks/{source-map.d.YqWNcp4e.d.ts → source-map.d.BLHtC2OB.d.ts} +1 -1
  43. package/dist/chunks/{spy.DQ0ZsPbi.js → spy.DgMTfhrK.js} +21 -18
  44. package/dist/chunks/{task-utils.d.BZm4GSQD.d.ts → task-utils.d.C-IeGxLU.d.ts} +1 -1
  45. package/dist/chunks/{utils.CJ0JImL8.js → utils.RcGwuOc_.js} +2 -2
  46. package/dist/chunks/{vm.W4G5WMTl.js → vm.vTyZj_02.js} +8 -8
  47. package/dist/chunks/{worker.d.MLmnzOJE.d.ts → worker.d.Bt2A2mmi.d.ts} +3 -3
  48. package/dist/cli.js +2 -2
  49. package/dist/config.d.ts +9 -9
  50. package/dist/index.d.ts +10 -10
  51. package/dist/index.js +9 -9
  52. package/dist/module-evaluator.d.ts +3 -2
  53. package/dist/module-evaluator.js +8 -5
  54. package/dist/node.d.ts +9 -9
  55. package/dist/node.js +14 -14
  56. package/dist/runtime.d.ts +6 -6
  57. package/dist/runtime.js +4 -4
  58. package/dist/spy.js +1 -1
  59. package/dist/task-utils.js +2 -1
  60. package/dist/worker.d.ts +4 -4
  61. package/dist/worker.js +17 -17
  62. package/dist/workers/forks.js +18 -18
  63. package/dist/workers/runVmTests.js +14 -14
  64. package/dist/workers/threads.js +18 -18
  65. package/dist/workers/vmForks.js +12 -12
  66. package/dist/workers/vmThreads.js +12 -12
  67. package/globals.d.ts +19 -19
  68. package/index.cjs +3 -3
  69. package/optional-runtime-types.d.ts +1 -1
  70. package/optional-types.d.ts +1 -1
  71. package/package.json +37 -24
  72. package/suppress-warnings.cjs +1 -1
@@ -1,17 +1,17 @@
1
- import { b as printDiffOrStringify, d as diff, a as processError, T as TestSyntaxError, g as getCurrentTest, c as createTaskCollector, e as getCurrentSuite, f as createChainable, h as getHooks, i as getFn, m as matchesTags, j as afterAll, k as afterEach, l as aroundAll, n as aroundEach, o as beforeAll, q as beforeEach, r as describe, t as it, u as onTestFailed, v as onTestFinished, w as recordArtifact, x as suite, y as test } from './run.C5UmxDPh.js';
1
+ import { b as printDiffOrStringify, d as diff, a as processError, T as TestSyntaxError, g as getCurrentTest, c as createTaskCollector, e as getCurrentSuite, f as createChainable, h as getHooks, i as getFn, m as matchesTags, j as afterAll, k as afterEach, l as aroundAll, n as aroundEach, o as beforeAll, q as beforeEach, r as describe, t as it, u as onTestFailed, v as onTestFinished, w as recordArtifact, x as suite, y as test } from './run.BTlFXlnv.js';
2
2
  import { i as isChildProcess, r as resetModules, g as getWorkerState } from './utils.DYj33du9.js';
3
- import { e as getDefaultExportFromCjs, f as parseErrorStacktrace, h as commonjsGlobal, a as getSafeTimers, i as parseSingleStack, j as delay } from './source-map.BH0bbrs9.js';
4
- import { i as isMockFunction, f as fn, a as spyOn, r as restoreAllMocks, b as resetAllMocks, c as clearAllMocks } from './spy.DQ0ZsPbi.js';
5
- import { u as isObject, B as getCallLastIndex, g as getType, D as noop, x as assertTypes, w as ordinal, E as createSimpleStackTrace, i as isAbsolute, a as relative, n as normalize } from './pathe.M-eThtNZ.DwEga6ro.js';
6
- import { s as stringify, i as inspect } from './display.pkpxlVcY.js';
3
+ import { e as parseErrorStacktrace, a as getSafeTimers, f as parseSingleStack, h as delay } from './source-map.DUxvo12T.js';
4
+ import { i as isMockFunction, f as fn, a as spyOn, r as restoreAllMocks, b as resetAllMocks, c as clearAllMocks } from './spy.DgMTfhrK.js';
5
+ import { u as isObject, B as getCallLastIndex, g as getType, D as noop, x as assertTypes, w as ordinal, E as createSimpleStackTrace, i as isAbsolute, a as relative, n as normalize } from './pathe.M-eThtNZ.CknpM8Or.js';
6
+ import { g as getDefaultExportFromCjs, f as format, a as commonjsGlobal } from './index.cx-_w29y.js';
7
+ import { s as stringify, i as inspect } from './display.CXBnkt9a.js';
7
8
  import { y } from './tinyrainbow.Ht9iggcq.js';
8
9
  import * as chai from 'chai';
9
10
  import { use, util } from 'chai';
10
11
  import { getNames, getTests, getTestName, createFileTask } from '../task-utils.js';
11
- import { g as getSerializers, a as addSerializer } from './plugins.Cigb0uSy.js';
12
+ import { g as getSerializers, a as addSerializer } from './plugins.D2ut1V9b.js';
12
13
  import { p as positionToOffset, o as offsetToLineNumber, l as lineSplitRE } from './offset.Dy-5Fdfn.js';
13
- import { f as format } from './index.M2dsQ_UQ.js';
14
- import { r as rpc, V as VitestEvaluatedModules } from './rpc.Bvs-iVxs.js';
14
+ import { r as rpc, V as VitestEvaluatedModules } from './rpc.BTmCtPly.js';
15
15
  import { Bench } from 'tinybench';
16
16
  import { expectTypeOf } from 'expect-type';
17
17
 
@@ -1223,8 +1223,10 @@ function asymmetricMatch(a, b, customTesters) {
1223
1223
  const asymmetricA = isAsymmetric(a);
1224
1224
  const asymmetricB = isAsymmetric(b);
1225
1225
  if (asymmetricA && asymmetricB) return;
1226
- if (asymmetricA) return a.asymmetricMatch(b, customTesters);
1227
- if (asymmetricB) return b.asymmetricMatch(a, customTesters);
1226
+ // Asymmetric matchers define their own subset semantics.
1227
+ const testers = customTesters.filter((tester) => !isSubsetEqualityTester(tester));
1228
+ if (asymmetricA) return a.asymmetricMatch(b, testers);
1229
+ if (asymmetricB) return b.asymmetricMatch(a, testers);
1228
1230
  }
1229
1231
  // https://github.com/jestjs/jest/blob/905bcbced3d40cdf7aadc4cdf6fb731c4bb3dbe3/packages/expect-utils/src/utils.ts#L509
1230
1232
  function isError(value) {
@@ -1471,12 +1473,21 @@ function hasPropertyInObject(object, key) {
1471
1473
  function isObjectWithKeys(a) {
1472
1474
  return isObject(a) && !isError(a) && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof Set) && !(a instanceof Map);
1473
1475
  }
1476
+ // Recursive subset testers are closures, so track them by identity.
1477
+ const subsetEqualityTesters = /* @__PURE__ */ new WeakSet();
1478
+ function registerSubsetEqualityTester(tester) {
1479
+ subsetEqualityTesters.add(tester);
1480
+ return tester;
1481
+ }
1482
+ function isSubsetEqualityTester(tester) {
1483
+ return tester === subsetEquality || subsetEqualityTesters.has(tester);
1484
+ }
1474
1485
  function subsetEquality(object, subset, customTesters = []) {
1475
1486
  const filteredCustomTesters = customTesters.filter((t) => t !== subsetEquality);
1476
1487
  // subsetEquality needs to keep track of the references
1477
1488
  // it has already visited to avoid infinite loops in case
1478
1489
  // there are circular references in the subset passed to it.
1479
- const subsetEqualityWithContext = (seenReferences = /* @__PURE__ */ new WeakMap()) => (object, subset) => {
1490
+ const subsetEqualityWithContext = (seenReferences = /* @__PURE__ */ new WeakMap()) => registerSubsetEqualityTester((object, subset) => {
1480
1491
  if (!isObjectWithKeys(subset)) return;
1481
1492
  return Object.keys(subset).every((key) => {
1482
1493
  if (subset[key] != null && typeof subset[key] === "object") {
@@ -1492,7 +1503,7 @@ function subsetEquality(object, subset, customTesters = []) {
1492
1503
  seenReferences.delete(subset[key]);
1493
1504
  return result;
1494
1505
  });
1495
- };
1506
+ });
1496
1507
  return subsetEqualityWithContext()(object, subset);
1497
1508
  }
1498
1509
  function typeEquality(a, b) {
@@ -1853,7 +1864,6 @@ const JestAsymmetricMatchers = (chai, utils) => {
1853
1864
  utils.addMethod(chai.expect, "stringMatching", (expected) => new StringMatching(expected));
1854
1865
  utils.addMethod(chai.expect, "closeTo", (expected, precision) => new CloseTo(expected, precision));
1855
1866
  utils.addMethod(chai.expect, "schemaMatching", (expected) => new SchemaMatching(expected));
1856
- // defineProperty does not work
1857
1867
  chai.expect.not = {
1858
1868
  stringContaining: (expected) => new StringContaining(expected, true),
1859
1869
  objectContaining: (expected) => new ObjectContaining(expected, true),
@@ -2591,8 +2601,12 @@ function JestExtendPlugin(c, expect, matchers) {
2591
2601
  constructor(inverse = false, ...sample) {
2592
2602
  super(sample, inverse);
2593
2603
  }
2594
- asymmetricMatch(other) {
2595
- const { pass } = expectAssertion.call(this.getMatcherContext(expect), other, ...this.sample);
2604
+ asymmetricMatch(other, customTesters) {
2605
+ const context = this.getMatcherContext(expect);
2606
+ const { pass } = expectAssertion.call(customTesters ? {
2607
+ ...context,
2608
+ customTesters
2609
+ } : context, other, ...this.sample);
2596
2610
  return this.inverse ? !pass : pass;
2597
2611
  }
2598
2612
  toString() {