@noma.to/qwik-testing-library 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 (85) hide show
  1. package/lib/lib/mock.qwik.cjs +3 -3
  2. package/lib/lib/mock.qwik.mjs +1 -1
  3. package/lib/lib/qwik-testing-library.qwik.cjs +2 -2
  4. package/lib/lib/qwik-testing-library.qwik.mjs +3 -3
  5. package/lib/lib/qwikloader.qwik.cjs +1 -1
  6. package/lib/lib/qwikloader.qwik.mjs +1 -1
  7. package/lib/node_modules/.pnpm/{@vitest_expect@2.1.8 → @vitest_expect@3.0.5}/node_modules/@vitest/expect/dist/index.qwik.cjs +175 -35
  8. package/lib/node_modules/.pnpm/{@vitest_expect@2.1.8 → @vitest_expect@3.0.5}/node_modules/@vitest/expect/dist/index.qwik.mjs +180 -40
  9. package/lib/node_modules/.pnpm/{@vitest_pretty-format@2.1.8 → @vitest_pretty-format@3.0.5}/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +301 -10
  10. package/lib/node_modules/.pnpm/{@vitest_pretty-format@2.1.8 → @vitest_pretty-format@3.0.5}/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +306 -15
  11. package/lib/node_modules/.pnpm/{@vitest_runner@2.1.8 → @vitest_runner@3.0.5}/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +1 -1
  12. package/lib/node_modules/.pnpm/{@vitest_runner@2.1.8 → @vitest_runner@3.0.5}/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +1 -1
  13. package/lib/node_modules/.pnpm/{@vitest_runner@2.1.8 → @vitest_runner@3.0.5}/node_modules/@vitest/runner/dist/index.qwik.cjs +130 -44
  14. package/lib/node_modules/.pnpm/{@vitest_runner@2.1.8 → @vitest_runner@3.0.5}/node_modules/@vitest/runner/dist/index.qwik.mjs +130 -44
  15. package/lib/node_modules/.pnpm/{@vitest_snapshot@2.1.8 → @vitest_snapshot@3.0.5}/node_modules/@vitest/snapshot/dist/index.qwik.cjs +119 -84
  16. package/lib/node_modules/.pnpm/{@vitest_snapshot@2.1.8 → @vitest_snapshot@3.0.5}/node_modules/@vitest/snapshot/dist/index.qwik.mjs +119 -84
  17. package/lib/node_modules/.pnpm/{@vitest_spy@2.1.8 → @vitest_spy@3.0.5}/node_modules/@vitest/spy/dist/index.qwik.cjs +20 -3
  18. package/lib/node_modules/.pnpm/{@vitest_spy@2.1.8 → @vitest_spy@3.0.5}/node_modules/@vitest/spy/dist/index.qwik.mjs +20 -3
  19. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.cjs +3 -3
  20. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.mjs +3 -3
  21. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/diff.qwik.cjs +37 -21
  22. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/diff.qwik.mjs +37 -21
  23. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/error.qwik.cjs +2 -2
  24. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/error.qwik.mjs +2 -2
  25. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/helpers.qwik.cjs +1 -1
  26. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/helpers.qwik.mjs +1 -1
  27. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/index.qwik.cjs +6 -4
  28. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/index.qwik.mjs +6 -4
  29. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/source-map.qwik.cjs +1 -1
  30. package/lib/node_modules/.pnpm/{@vitest_utils@2.1.8 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/source-map.qwik.mjs +1 -1
  31. package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/index.qwik.mjs +6 -6
  32. package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/map.qwik.cjs +1 -3
  33. package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/map.qwik.mjs +1 -3
  34. package/lib/node_modules/.pnpm/{pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.cjs → pathe@2.0.2/node_modules/pathe/dist/shared/pathe.UZ-hd4nF.qwik.cjs} +2 -2
  35. package/lib/node_modules/.pnpm/{pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.mjs → pathe@2.0.2/node_modules/pathe/dist/shared/pathe.UZ-hd4nF.qwik.mjs} +2 -2
  36. package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +4 -0
  37. package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +5 -0
  38. package/lib/node_modules/.pnpm/{vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0 → vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0}/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.cjs +1 -1
  39. package/lib/node_modules/.pnpm/{vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0 → vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0}/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.mjs +1 -1
  40. package/lib/node_modules/.pnpm/{vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.cjs → vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.CjhMlMwf.qwik.cjs} +439 -211
  41. package/lib/node_modules/.pnpm/{vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.mjs → vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.CjhMlMwf.qwik.mjs} +415 -187
  42. package/package.json +8 -8
  43. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +0 -7
  44. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +0 -8
  45. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/arguments.qwik.cjs +0 -0
  46. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/arguments.qwik.mjs +0 -0
  47. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/array.qwik.cjs +0 -0
  48. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/array.qwik.mjs +0 -0
  49. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/bigint.qwik.cjs +0 -0
  50. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/bigint.qwik.mjs +0 -0
  51. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/class.qwik.cjs +0 -0
  52. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/class.qwik.mjs +0 -0
  53. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/date.qwik.cjs +0 -0
  54. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/date.qwik.mjs +0 -0
  55. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/error.qwik.cjs +0 -0
  56. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/error.qwik.mjs +0 -0
  57. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/function.qwik.cjs +0 -0
  58. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/function.qwik.mjs +0 -0
  59. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/helpers.qwik.cjs +0 -0
  60. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/helpers.qwik.mjs +0 -0
  61. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/html.qwik.cjs +0 -0
  62. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/html.qwik.mjs +0 -0
  63. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/index.qwik.cjs +0 -0
  64. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/number.qwik.cjs +0 -0
  65. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/number.qwik.mjs +0 -0
  66. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/object.qwik.cjs +0 -0
  67. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/object.qwik.mjs +0 -0
  68. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/promise.qwik.cjs +0 -0
  69. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/promise.qwik.mjs +0 -0
  70. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/regexp.qwik.cjs +0 -0
  71. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/regexp.qwik.mjs +0 -0
  72. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/set.qwik.cjs +0 -0
  73. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/set.qwik.mjs +0 -0
  74. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/string.qwik.cjs +0 -0
  75. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/string.qwik.mjs +0 -0
  76. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/symbol.qwik.cjs +0 -0
  77. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/symbol.qwik.mjs +0 -0
  78. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/typedarray.qwik.cjs +0 -0
  79. /package/lib/node_modules/.pnpm/{loupe@3.1.2 → loupe@3.1.3}/node_modules/loupe/lib/typedarray.qwik.mjs +0 -0
  80. /package/lib/node_modules/.pnpm/{tinyrainbow@1.2.0 → tinyrainbow@2.0.0}/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.cjs +0 -0
  81. /package/lib/node_modules/.pnpm/{tinyrainbow@1.2.0 → tinyrainbow@2.0.0}/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.mjs +0 -0
  82. /package/lib/node_modules/.pnpm/{vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0 → vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.cjs +0 -0
  83. /package/lib/node_modules/.pnpm/{vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0 → vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.mjs +0 -0
  84. /package/lib/node_modules/.pnpm/{vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0 → vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0}/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.cjs +0 -0
  85. /package/lib/node_modules/.pnpm/{vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0 → vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0}/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.mjs +0 -0
@@ -1,24 +1,72 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { diff, printDiffOrStringify } from "../../../../../@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/diff.qwik.mjs";
5
- import f from "../../../../../tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs";
6
- import { isMockFunction } from "../../../../../@vitest_spy@2.1.8/node_modules/@vitest/spy/dist/index.qwik.mjs";
7
- import { processError } from "../../../../../@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/error.qwik.mjs";
4
+ import { diff, printDiffOrStringify } from "../../../../../@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/diff.qwik.mjs";
5
+ import s from "../../../../../tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.qwik.mjs";
6
+ import { isMockFunction } from "../../../../../@vitest_spy@3.0.5/node_modules/@vitest/spy/dist/index.qwik.mjs";
7
+ import { processError } from "../../../../../@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/error.qwik.mjs";
8
8
  import { use, util as utils_exports } from "../../../../../chai@5.1.2/node_modules/chai/chai.qwik.mjs";
9
- import { getType, assertTypes, isObject } from "../../../../../@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/helpers.qwik.mjs";
10
- import { s as stringify } from "../../../../../@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.mjs";
9
+ import { getType, isObject, assertTypes } from "../../../../../@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/helpers.qwik.mjs";
10
+ import { s as stringify } from "../../../../../@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.mjs";
11
11
  const MATCHERS_OBJECT = Symbol.for("matchers-object");
12
12
  const JEST_MATCHERS_OBJECT = Symbol.for("$$jest-matchers-object");
13
13
  const GLOBAL_EXPECT = Symbol.for("expect-global");
14
14
  const ASYMMETRIC_MATCHERS_OBJECT = Symbol.for(
15
15
  "asymmetric-matchers-object"
16
16
  );
17
- const EXPECTED_COLOR = f.green;
18
- const RECEIVED_COLOR = f.red;
19
- const INVERTED_COLOR = f.inverse;
20
- const BOLD_WEIGHT = f.bold;
21
- const DIM_COLOR = f.dim;
17
+ const customMatchers = {
18
+ toSatisfy(actual, expected, message) {
19
+ const { printReceived: printReceived2, printExpected: printExpected2, matcherHint: matcherHint2 } = this.utils;
20
+ const pass = expected(actual);
21
+ return {
22
+ pass,
23
+ message: () => pass ? `${matcherHint2(".not.toSatisfy", "received", "")}
24
+
25
+ Expected value to not satisfy:
26
+ ${message || printExpected2(expected)}
27
+ Received:
28
+ ${printReceived2(actual)}` : `${matcherHint2(".toSatisfy", "received", "")}
29
+
30
+ Expected value to satisfy:
31
+ ${message || printExpected2(expected)}
32
+
33
+ Received:
34
+ ${printReceived2(actual)}`
35
+ };
36
+ },
37
+ toBeOneOf(actual, expected) {
38
+ const { equals: equals2, customTesters } = this;
39
+ const { printReceived: printReceived2, printExpected: printExpected2, matcherHint: matcherHint2 } = this.utils;
40
+ if (!Array.isArray(expected)) {
41
+ throw new TypeError(
42
+ `You must provide an array to ${matcherHint2(".toBeOneOf")}, not '${typeof expected}'.`
43
+ );
44
+ }
45
+ const pass = expected.length === 0 || expected.some(
46
+ (item) => equals2(item, actual, customTesters)
47
+ );
48
+ return {
49
+ pass,
50
+ message: () => pass ? `${matcherHint2(".not.toBeOneOf", "received", "")}
51
+
52
+ Expected value to not be one of:
53
+ ${printExpected2(expected)}
54
+ Received:
55
+ ${printReceived2(actual)}` : `${matcherHint2(".toBeOneOf", "received", "")}
56
+
57
+ Expected value to be one of:
58
+ ${printExpected2(expected)}
59
+
60
+ Received:
61
+ ${printReceived2(actual)}`
62
+ };
63
+ }
64
+ };
65
+ const EXPECTED_COLOR = s.green;
66
+ const RECEIVED_COLOR = s.red;
67
+ const INVERTED_COLOR = s.inverse;
68
+ const BOLD_WEIGHT = s.bold;
69
+ const DIM_COLOR = s.dim;
22
70
  function matcherHint(matcherName, received = "received", expected = "expected", options = {}) {
23
71
  const {
24
72
  comment = "",
@@ -145,9 +193,6 @@ function eq(a, b, aStack, bStack, customTesters, hasKey2) {
145
193
  return customTesterResult;
146
194
  }
147
195
  }
148
- if (a instanceof Error && b instanceof Error) {
149
- return a.message === b.message;
150
- }
151
196
  if (typeof URL === "function" && a instanceof URL && b instanceof URL) {
152
197
  return a.href === b.href;
153
198
  }
@@ -200,6 +245,14 @@ function eq(a, b, aStack, bStack, customTesters, hasKey2) {
200
245
  if (className === "[object Array]" && a.length !== b.length) {
201
246
  return false;
202
247
  }
248
+ if (a instanceof Error && b instanceof Error) {
249
+ try {
250
+ return isErrorEqual(a, b, aStack, bStack, customTesters, hasKey2);
251
+ } finally {
252
+ aStack.pop();
253
+ bStack.pop();
254
+ }
255
+ }
203
256
  const aKeys = keys(a, hasKey2);
204
257
  let key;
205
258
  let size = aKeys.length;
@@ -217,6 +270,17 @@ function eq(a, b, aStack, bStack, customTesters, hasKey2) {
217
270
  bStack.pop();
218
271
  return result;
219
272
  }
273
+ function isErrorEqual(a, b, aStack, bStack, customTesters, hasKey2) {
274
+ let result = Object.getPrototypeOf(a) === Object.getPrototypeOf(b) && a.name === b.name && a.message === b.message;
275
+ if (typeof b.cause !== "undefined") {
276
+ result && (result = eq(a.cause, b.cause, aStack, bStack, customTesters, hasKey2));
277
+ }
278
+ if (a instanceof AggregateError && b instanceof AggregateError) {
279
+ result && (result = eq(a.errors, b.errors, aStack, bStack, customTesters, hasKey2));
280
+ }
281
+ result && (result = eq({ ...a }, { ...b }, aStack, bStack, customTesters, hasKey2));
282
+ return result;
283
+ }
220
284
  function keys(obj, hasKey2) {
221
285
  const keys2 = [];
222
286
  for (const key in obj) {
@@ -472,9 +536,9 @@ function getObjectKeys(object) {
472
536
  return [
473
537
  ...Object.keys(object),
474
538
  ...Object.getOwnPropertySymbols(object).filter(
475
- (s) => {
539
+ (s2) => {
476
540
  var _a;
477
- return (_a = Object.getOwnPropertyDescriptor(object, s)) == null ? void 0 : _a.enumerable;
541
+ return (_a = Object.getOwnPropertyDescriptor(object, s2)) == null ? void 0 : _a.enumerable;
478
542
  }
479
543
  )
480
544
  ];
@@ -537,7 +601,7 @@ if (!Object.prototype.hasOwnProperty.call(globalThis, MATCHERS_OBJECT)) {
537
601
  const globalState = /* @__PURE__ */ new WeakMap();
538
602
  const matchers = /* @__PURE__ */ Object.create(null);
539
603
  const customEqualityTesters = [];
540
- const assymetricMatchers = /* @__PURE__ */ Object.create(null);
604
+ const asymmetricMatchers = /* @__PURE__ */ Object.create(null);
541
605
  Object.defineProperty(globalThis, MATCHERS_OBJECT, {
542
606
  get: () => globalState
543
607
  });
@@ -550,7 +614,7 @@ if (!Object.prototype.hasOwnProperty.call(globalThis, MATCHERS_OBJECT)) {
550
614
  })
551
615
  });
552
616
  Object.defineProperty(globalThis, ASYMMETRIC_MATCHERS_OBJECT, {
553
- get: () => assymetricMatchers
617
+ get: () => asymmetricMatchers
554
618
  });
555
619
  }
556
620
  function getState(expect) {
@@ -889,7 +953,7 @@ function recordAsyncExpect(_test, promise, assertion, error) {
889
953
  test.onFinished.push(() => {
890
954
  var _a;
891
955
  if (!resolved) {
892
- const processor = ((_a = globalThis.__vitest_worker__) == null ? void 0 : _a.onFilterStackTrace) || ((s) => s || "");
956
+ const processor = ((_a = globalThis.__vitest_worker__) == null ? void 0 : _a.onFilterStackTrace) || ((s2) => s2 || "");
893
957
  const stack = processor(error.stack);
894
958
  console.warn([
895
959
  `Promise returned by \`${assertion}\` was not awaited. `,
@@ -900,9 +964,9 @@ function recordAsyncExpect(_test, promise, assertion, error) {
900
964
  }
901
965
  });
902
966
  return {
903
- then(onFullfilled, onRejected) {
967
+ then(onFulfilled, onRejected) {
904
968
  resolved = true;
905
- return promise.then(onFullfilled, onRejected);
969
+ return promise.then(onFulfilled, onRejected);
906
970
  },
907
971
  catch(onRejected) {
908
972
  return promise.catch(onRejected);
@@ -1417,6 +1481,25 @@ const JestChaiExpect = (chai, utils) => {
1417
1481
  throw new AssertionError(formatCalls(spy, msg, args));
1418
1482
  }
1419
1483
  });
1484
+ def("toHaveBeenCalledExactlyOnceWith", function(...args) {
1485
+ const spy = getSpy(this);
1486
+ const spyName = spy.getMockName();
1487
+ const callCount = spy.mock.calls.length;
1488
+ const hasCallWithArgs = spy.mock.calls.some(
1489
+ (callArg) => equals(callArg, args, [...customTesters, iterableEquality])
1490
+ );
1491
+ const pass = hasCallWithArgs && callCount === 1;
1492
+ const isNot = utils.flag(this, "negate");
1493
+ const msg = utils.getMessage(this, [
1494
+ pass,
1495
+ `expected "${spyName}" to be called once with arguments: #{exp}`,
1496
+ `expected "${spyName}" to not be called once with arguments: #{exp}`,
1497
+ args
1498
+ ]);
1499
+ if (pass && isNot || !pass && !isNot) {
1500
+ throw new AssertionError(formatCalls(spy, msg, args));
1501
+ }
1502
+ });
1420
1503
  def(
1421
1504
  ["toHaveBeenNthCalledWith", "nthCalledWith"],
1422
1505
  function(times, ...args) {
@@ -1454,6 +1537,61 @@ const JestChaiExpect = (chai, utils) => {
1454
1537
  );
1455
1538
  }
1456
1539
  );
1540
+ function isSpyCalledBeforeAnotherSpy(beforeSpy, afterSpy, failIfNoFirstInvocation) {
1541
+ const beforeInvocationCallOrder = beforeSpy.mock.invocationCallOrder;
1542
+ const afterInvocationCallOrder = afterSpy.mock.invocationCallOrder;
1543
+ if (beforeInvocationCallOrder.length === 0) {
1544
+ return !failIfNoFirstInvocation;
1545
+ }
1546
+ if (afterInvocationCallOrder.length === 0) {
1547
+ return false;
1548
+ }
1549
+ return beforeInvocationCallOrder[0] < afterInvocationCallOrder[0];
1550
+ }
1551
+ def(
1552
+ ["toHaveBeenCalledBefore"],
1553
+ function(resultSpy, failIfNoFirstInvocation = true) {
1554
+ const expectSpy = getSpy(this);
1555
+ if (!isMockFunction(resultSpy)) {
1556
+ throw new TypeError(
1557
+ `${utils.inspect(resultSpy)} is not a spy or a call to a spy`
1558
+ );
1559
+ }
1560
+ this.assert(
1561
+ isSpyCalledBeforeAnotherSpy(
1562
+ expectSpy,
1563
+ resultSpy,
1564
+ failIfNoFirstInvocation
1565
+ ),
1566
+ `expected "${expectSpy.getMockName()}" to have been called before "${resultSpy.getMockName()}"`,
1567
+ `expected "${expectSpy.getMockName()}" to not have been called before "${resultSpy.getMockName()}"`,
1568
+ resultSpy,
1569
+ expectSpy
1570
+ );
1571
+ }
1572
+ );
1573
+ def(
1574
+ ["toHaveBeenCalledAfter"],
1575
+ function(resultSpy, failIfNoFirstInvocation = true) {
1576
+ const expectSpy = getSpy(this);
1577
+ if (!isMockFunction(resultSpy)) {
1578
+ throw new TypeError(
1579
+ `${utils.inspect(resultSpy)} is not a spy or a call to a spy`
1580
+ );
1581
+ }
1582
+ this.assert(
1583
+ isSpyCalledBeforeAnotherSpy(
1584
+ resultSpy,
1585
+ expectSpy,
1586
+ failIfNoFirstInvocation
1587
+ ),
1588
+ `expected "${expectSpy.getMockName()}" to have been called after "${resultSpy.getMockName()}"`,
1589
+ `expected "${expectSpy.getMockName()}" to not have been called after "${resultSpy.getMockName()}"`,
1590
+ resultSpy,
1591
+ expectSpy
1592
+ );
1593
+ }
1594
+ );
1457
1595
  def(
1458
1596
  ["toThrow", "toThrowError"],
1459
1597
  function(expected) {
@@ -1503,12 +1641,16 @@ const JestChaiExpect = (chai, utils) => {
1503
1641
  );
1504
1642
  }
1505
1643
  if (expected instanceof Error) {
1644
+ const equal = equals(thrown, expected, [
1645
+ ...customTesters,
1646
+ iterableEquality
1647
+ ]);
1506
1648
  return this.assert(
1507
- thrown && expected.message === thrown.message,
1508
- `expected error to have message: ${expected.message}`,
1509
- `expected error not to have message: ${expected.message}`,
1510
- expected.message,
1511
- thrown && thrown.message
1649
+ equal,
1650
+ "expected a thrown error to be #{exp}",
1651
+ "expected a thrown error not to be #{exp}",
1652
+ expected,
1653
+ thrown
1512
1654
  );
1513
1655
  }
1514
1656
  if (typeof expected === "object" && "asymmetricMatch" in expected && typeof expected.asymmetricMatch === "function") {
@@ -1556,7 +1698,7 @@ const JestChaiExpect = (chai, utils) => {
1556
1698
  {
1557
1699
  name: "toHaveResolvedTimes",
1558
1700
  condition: (spy, times) => spy.mock.settledResults.reduce(
1559
- (s, { type }) => type === "fulfilled" ? ++s : s,
1701
+ (s2, { type }) => type === "fulfilled" ? ++s2 : s2,
1560
1702
  0
1561
1703
  ) === times,
1562
1704
  action: "resolved"
@@ -1564,7 +1706,7 @@ const JestChaiExpect = (chai, utils) => {
1564
1706
  {
1565
1707
  name: ["toHaveReturnedTimes", "toReturnTimes"],
1566
1708
  condition: (spy, times) => spy.mock.results.reduce(
1567
- (s, { type }) => type === "throw" ? s : ++s,
1709
+ (s2, { type }) => type === "throw" ? s2 : ++s2,
1568
1710
  0
1569
1711
  ) === times,
1570
1712
  action: "called"
@@ -1682,9 +1824,6 @@ const JestChaiExpect = (chai, utils) => {
1682
1824
  );
1683
1825
  });
1684
1826
  });
1685
- def("toSatisfy", function(matcher, message) {
1686
- return this.be.satisfy(matcher, message);
1687
- });
1688
1827
  def("withContext", function(context) {
1689
1828
  for (const key in context) {
1690
1829
  utils.flag(this, key, context[key]);
@@ -1830,13 +1969,13 @@ function ordinalOf(i) {
1830
1969
  }
1831
1970
  function formatCalls(spy, msg, showActualCall) {
1832
1971
  if (spy.mock.calls) {
1833
- msg += f.gray(
1972
+ msg += s.gray(
1834
1973
  `
1835
1974
 
1836
1975
  Received:
1837
1976
 
1838
1977
  ${spy.mock.calls.map((callArg, i) => {
1839
- let methodCall = f.bold(
1978
+ let methodCall = s.bold(
1840
1979
  ` ${ordinalOf(i + 1)} ${spy.getMockName()} call:
1841
1980
 
1842
1981
  `
@@ -1853,22 +1992,22 @@ ${spy.mock.calls.map((callArg, i) => {
1853
1992
  }).join("\n")}`
1854
1993
  );
1855
1994
  }
1856
- msg += f.gray(
1995
+ msg += s.gray(
1857
1996
  `
1858
1997
 
1859
- Number of calls: ${f.bold(spy.mock.calls.length)}
1998
+ Number of calls: ${s.bold(spy.mock.calls.length)}
1860
1999
  `
1861
2000
  );
1862
2001
  return msg;
1863
2002
  }
1864
2003
  function formatReturns(spy, results, msg, showActualReturn) {
1865
- msg += f.gray(
2004
+ msg += s.gray(
1866
2005
  `
1867
2006
 
1868
2007
  Received:
1869
2008
 
1870
2009
  ${results.map((callReturn, i) => {
1871
- let methodCall = f.bold(
2010
+ let methodCall = s.bold(
1872
2011
  ` ${ordinalOf(i + 1)} ${spy.getMockName()} call return:
1873
2012
 
1874
2013
  `
@@ -1884,10 +2023,10 @@ ${results.map((callReturn, i) => {
1884
2023
  return methodCall;
1885
2024
  }).join("\n")}`
1886
2025
  );
1887
- msg += f.gray(
2026
+ msg += s.gray(
1888
2027
  `
1889
2028
 
1890
- Number of calls: ${f.bold(spy.mock.calls.length)}
2029
+ Number of calls: ${s.bold(spy.mock.calls.length)}
1891
2030
  `
1892
2031
  );
1893
2032
  return msg;
@@ -1977,7 +2116,7 @@ function JestExtendPlugin(c, expect, matchers) {
1977
2116
  return "any";
1978
2117
  }
1979
2118
  toAsymmetricMatcher() {
1980
- return `${this.toString()}<${this.sample.map(String).join(", ")}>`;
2119
+ return `${this.toString()}<${this.sample.map((item) => stringify(item)).join(", ")}>`;
1981
2120
  }
1982
2121
  }
1983
2122
  const customMatcher = (...sample) => new CustomMatcher(false, ...sample);
@@ -2033,6 +2172,7 @@ export {
2033
2172
  StringMatching,
2034
2173
  addCustomEqualityTesters,
2035
2174
  arrayBufferEquality,
2175
+ customMatchers,
2036
2176
  equals,
2037
2177
  generateToBeMessage,
2038
2178
  getObjectKeys,