@noma.to/qwik-testing-library 1.0.4 → 1.1.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 (100) hide show
  1. package/README.md +61 -0
  2. package/lib/_virtual/_commonjsHelpers.qwik.cjs +2 -0
  3. package/lib/_virtual/_commonjsHelpers.qwik.mjs +2 -0
  4. package/lib/_virtual/sourcemap-codec.umd.qwik.cjs +4 -0
  5. package/lib/_virtual/sourcemap-codec.umd.qwik.mjs +4 -0
  6. package/lib/index.qwik.cjs +4 -0
  7. package/lib/index.qwik.mjs +4 -0
  8. package/lib/lib/mock.qwik.cjs +14 -0
  9. package/lib/lib/mock.qwik.mjs +14 -0
  10. package/lib/lib/qwik-testing-library.qwik.cjs +4 -0
  11. package/lib/lib/qwik-testing-library.qwik.mjs +4 -0
  12. package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.qwik.cjs +425 -0
  13. package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.qwik.mjs +425 -0
  14. package/lib/node_modules/.pnpm/@vitest_expect@2.1.1/node_modules/@vitest/expect/dist/index.qwik.cjs +1967 -0
  15. package/lib/node_modules/.pnpm/@vitest_expect@2.1.1/node_modules/@vitest/expect/dist/index.qwik.mjs +1967 -0
  16. package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.1/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +1202 -0
  17. package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.1/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +1202 -0
  18. package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +44 -0
  19. package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +44 -0
  20. package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/index.qwik.cjs +665 -0
  21. package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/index.qwik.mjs +665 -0
  22. package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.1/node_modules/@vitest/snapshot/dist/index.qwik.cjs +1641 -0
  23. package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.1/node_modules/@vitest/snapshot/dist/index.qwik.mjs +1641 -0
  24. package/lib/node_modules/.pnpm/@vitest_spy@2.1.1/node_modules/@vitest/spy/dist/index.qwik.cjs +148 -0
  25. package/lib/node_modules/.pnpm/@vitest_spy@2.1.1/node_modules/@vitest/spy/dist/index.qwik.mjs +148 -0
  26. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/chunk-display.qwik.cjs +158 -0
  27. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/chunk-display.qwik.mjs +158 -0
  28. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/diff.qwik.cjs +1731 -0
  29. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/diff.qwik.mjs +1731 -0
  30. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/error.qwik.cjs +137 -0
  31. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/error.qwik.mjs +137 -0
  32. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/helpers.qwik.cjs +150 -0
  33. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/helpers.qwik.mjs +150 -0
  34. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/index.qwik.cjs +81 -0
  35. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/index.qwik.mjs +81 -0
  36. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/source-map.qwik.cjs +216 -0
  37. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/source-map.qwik.mjs +216 -0
  38. package/lib/node_modules/.pnpm/chai@5.1.1/node_modules/chai/chai.qwik.cjs +3905 -0
  39. package/lib/node_modules/.pnpm/chai@5.1.1/node_modules/chai/chai.qwik.mjs +3905 -0
  40. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/arguments.qwik.cjs +9 -0
  41. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/arguments.qwik.mjs +10 -0
  42. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/array.qwik.cjs +16 -0
  43. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/array.qwik.mjs +17 -0
  44. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/bigint.qwik.cjs +9 -0
  45. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/bigint.qwik.mjs +10 -0
  46. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/class.qwik.cjs +16 -0
  47. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/class.qwik.mjs +17 -0
  48. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/date.qwik.cjs +12 -0
  49. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/date.qwik.mjs +13 -0
  50. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/error.qwik.cjs +30 -0
  51. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/error.qwik.mjs +31 -0
  52. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/function.qwik.cjs +11 -0
  53. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/function.qwik.mjs +12 -0
  54. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/helpers.qwik.cjs +160 -0
  55. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/helpers.qwik.mjs +160 -0
  56. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/html.qwik.cjs +36 -0
  57. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/html.qwik.mjs +36 -0
  58. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/index.qwik.cjs +130 -0
  59. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/index.qwik.mjs +130 -0
  60. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/map.qwik.cjs +25 -0
  61. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/map.qwik.mjs +26 -0
  62. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/number.qwik.cjs +19 -0
  63. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/number.qwik.mjs +20 -0
  64. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/object.qwik.cjs +24 -0
  65. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/object.qwik.mjs +25 -0
  66. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/promise.qwik.cjs +17 -0
  67. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/promise.qwik.mjs +18 -0
  68. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/regexp.qwik.cjs +9 -0
  69. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/regexp.qwik.mjs +10 -0
  70. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/set.qwik.cjs +16 -0
  71. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/set.qwik.mjs +17 -0
  72. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/string.qwik.cjs +24 -0
  73. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/string.qwik.mjs +25 -0
  74. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/symbol.qwik.cjs +8 -0
  75. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/symbol.qwik.mjs +9 -0
  76. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/typedarray.qwik.cjs +34 -0
  77. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/typedarray.qwik.mjs +35 -0
  78. package/lib/node_modules/.pnpm/magic-string@0.30.11/node_modules/magic-string/dist/magic-string.es.qwik.cjs +968 -0
  79. package/lib/node_modules/.pnpm/magic-string@0.30.11/node_modules/magic-string/dist/magic-string.es.qwik.mjs +968 -0
  80. package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.cjs +101 -0
  81. package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.mjs +101 -0
  82. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +7 -0
  83. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +8 -0
  84. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.cjs +80 -0
  85. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.mjs +80 -0
  86. package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.cjs +104 -0
  87. package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.mjs +104 -0
  88. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.cjs +8 -0
  89. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.mjs +8 -0
  90. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/base.BlXpj3e_.qwik.cjs +6 -0
  91. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/base.BlXpj3e_.qwik.mjs +6 -0
  92. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.cjs +56 -0
  93. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.mjs +56 -0
  94. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/utils.Ck2hJTRs.qwik.cjs +16 -0
  95. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/utils.Ck2hJTRs.qwik.mjs +16 -0
  96. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/vi.D6IHiKAI.qwik.cjs +2556 -0
  97. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/vi.D6IHiKAI.qwik.mjs +2556 -0
  98. package/lib-types/lib/mock.d.ts +34 -0
  99. package/lib-types/lib/qwik-testing-library.d.ts +2 -1
  100. package/package.json +5 -4
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const diff = require("./diff.qwik.cjs");
4
+ const chunkDisplay = require("./chunk-display.qwik.cjs");
5
+ require("../../../../../tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.cjs");
6
+ require("../../../../../loupe@3.1.1/node_modules/loupe/lib/index.qwik.cjs");
7
+ const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
8
+ const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
9
+ function isImmutable(v) {
10
+ return v && (v[IS_COLLECTION_SYMBOL] || v[IS_RECORD_SYMBOL]);
11
+ }
12
+ const OBJECT_PROTO = Object.getPrototypeOf({});
13
+ function getUnserializableMessage(err) {
14
+ if (err instanceof Error) {
15
+ return `<unserializable>: ${err.message}`;
16
+ }
17
+ if (typeof err === "string") {
18
+ return `<unserializable>: ${err}`;
19
+ }
20
+ return "<unserializable>";
21
+ }
22
+ function serializeValue(val, seen = /* @__PURE__ */ new WeakMap()) {
23
+ if (!val || typeof val === "string") {
24
+ return val;
25
+ }
26
+ if (typeof val === "function") {
27
+ return `Function<${val.name || "anonymous"}>`;
28
+ }
29
+ if (typeof val === "symbol") {
30
+ return val.toString();
31
+ }
32
+ if (typeof val !== "object") {
33
+ return val;
34
+ }
35
+ if (isImmutable(val)) {
36
+ return serializeValue(val.toJSON(), seen);
37
+ }
38
+ if (val instanceof Promise || val.constructor && val.constructor.prototype === "AsyncFunction") {
39
+ return "Promise";
40
+ }
41
+ if (typeof Element !== "undefined" && val instanceof Element) {
42
+ return val.tagName;
43
+ }
44
+ if (typeof val.asymmetricMatch === "function") {
45
+ return `${val.toString()} ${chunkDisplay.f(val.sample)}`;
46
+ }
47
+ if (typeof val.toJSON === "function") {
48
+ return serializeValue(val.toJSON(), seen);
49
+ }
50
+ if (seen.has(val)) {
51
+ return seen.get(val);
52
+ }
53
+ if (Array.isArray(val)) {
54
+ const clone = new Array(val.length);
55
+ seen.set(val, clone);
56
+ val.forEach((e, i) => {
57
+ try {
58
+ clone[i] = serializeValue(e, seen);
59
+ } catch (err) {
60
+ clone[i] = getUnserializableMessage(err);
61
+ }
62
+ });
63
+ return clone;
64
+ } else {
65
+ const clone = /* @__PURE__ */ Object.create(null);
66
+ seen.set(val, clone);
67
+ let obj = val;
68
+ while (obj && obj !== OBJECT_PROTO) {
69
+ Object.getOwnPropertyNames(obj).forEach((key) => {
70
+ if (key in clone) {
71
+ return;
72
+ }
73
+ try {
74
+ clone[key] = serializeValue(val[key], seen);
75
+ } catch (err) {
76
+ delete clone[key];
77
+ clone[key] = getUnserializableMessage(err);
78
+ }
79
+ });
80
+ obj = Object.getPrototypeOf(obj);
81
+ }
82
+ return clone;
83
+ }
84
+ }
85
+ function normalizeErrorMessage(message) {
86
+ return message.replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "");
87
+ }
88
+ function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
89
+ if (!_err || typeof _err !== "object") {
90
+ return { message: String(_err) };
91
+ }
92
+ const err = _err;
93
+ if (err.stack) {
94
+ err.stackStr = String(err.stack);
95
+ }
96
+ if (err.name) {
97
+ err.nameStr = String(err.name);
98
+ }
99
+ if (err.showDiff || err.showDiff === void 0 && err.expected !== void 0 && err.actual !== void 0) {
100
+ err.diff = diff.printDiffOrStringify(err.actual, err.expected, {
101
+ ...diffOptions,
102
+ ...err.diffOptions
103
+ });
104
+ }
105
+ if (typeof err.expected !== "string") {
106
+ err.expected = chunkDisplay.s(err.expected, 10);
107
+ }
108
+ if (typeof err.actual !== "string") {
109
+ err.actual = chunkDisplay.s(err.actual, 10);
110
+ }
111
+ try {
112
+ if (typeof err.message === "string") {
113
+ err.message = normalizeErrorMessage(err.message);
114
+ }
115
+ } catch {
116
+ }
117
+ try {
118
+ if (!seen.has(err) && typeof err.cause === "object") {
119
+ seen.add(err);
120
+ err.cause = processError(err.cause, diffOptions, seen);
121
+ }
122
+ } catch {
123
+ }
124
+ try {
125
+ return serializeValue(err);
126
+ } catch (e) {
127
+ return serializeValue(
128
+ new Error(
129
+ `Failed to fully serialize error: ${e == null ? void 0 : e.message}
130
+ Inner error message: ${err == null ? void 0 : err.message}`
131
+ )
132
+ );
133
+ }
134
+ }
135
+ exports.processError = processError;
136
+ exports.serializeError = serializeValue;
137
+ exports.serializeValue = serializeValue;
@@ -0,0 +1,137 @@
1
+ import { printDiffOrStringify } from "./diff.qwik.mjs";
2
+ import { s as stringify, f as format } from "./chunk-display.qwik.mjs";
3
+ import "../../../../../tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs";
4
+ import "../../../../../loupe@3.1.1/node_modules/loupe/lib/index.qwik.mjs";
5
+ const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
6
+ const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
7
+ function isImmutable(v) {
8
+ return v && (v[IS_COLLECTION_SYMBOL] || v[IS_RECORD_SYMBOL]);
9
+ }
10
+ const OBJECT_PROTO = Object.getPrototypeOf({});
11
+ function getUnserializableMessage(err) {
12
+ if (err instanceof Error) {
13
+ return `<unserializable>: ${err.message}`;
14
+ }
15
+ if (typeof err === "string") {
16
+ return `<unserializable>: ${err}`;
17
+ }
18
+ return "<unserializable>";
19
+ }
20
+ function serializeValue(val, seen = /* @__PURE__ */ new WeakMap()) {
21
+ if (!val || typeof val === "string") {
22
+ return val;
23
+ }
24
+ if (typeof val === "function") {
25
+ return `Function<${val.name || "anonymous"}>`;
26
+ }
27
+ if (typeof val === "symbol") {
28
+ return val.toString();
29
+ }
30
+ if (typeof val !== "object") {
31
+ return val;
32
+ }
33
+ if (isImmutable(val)) {
34
+ return serializeValue(val.toJSON(), seen);
35
+ }
36
+ if (val instanceof Promise || val.constructor && val.constructor.prototype === "AsyncFunction") {
37
+ return "Promise";
38
+ }
39
+ if (typeof Element !== "undefined" && val instanceof Element) {
40
+ return val.tagName;
41
+ }
42
+ if (typeof val.asymmetricMatch === "function") {
43
+ return `${val.toString()} ${format(val.sample)}`;
44
+ }
45
+ if (typeof val.toJSON === "function") {
46
+ return serializeValue(val.toJSON(), seen);
47
+ }
48
+ if (seen.has(val)) {
49
+ return seen.get(val);
50
+ }
51
+ if (Array.isArray(val)) {
52
+ const clone = new Array(val.length);
53
+ seen.set(val, clone);
54
+ val.forEach((e, i) => {
55
+ try {
56
+ clone[i] = serializeValue(e, seen);
57
+ } catch (err) {
58
+ clone[i] = getUnserializableMessage(err);
59
+ }
60
+ });
61
+ return clone;
62
+ } else {
63
+ const clone = /* @__PURE__ */ Object.create(null);
64
+ seen.set(val, clone);
65
+ let obj = val;
66
+ while (obj && obj !== OBJECT_PROTO) {
67
+ Object.getOwnPropertyNames(obj).forEach((key) => {
68
+ if (key in clone) {
69
+ return;
70
+ }
71
+ try {
72
+ clone[key] = serializeValue(val[key], seen);
73
+ } catch (err) {
74
+ delete clone[key];
75
+ clone[key] = getUnserializableMessage(err);
76
+ }
77
+ });
78
+ obj = Object.getPrototypeOf(obj);
79
+ }
80
+ return clone;
81
+ }
82
+ }
83
+ function normalizeErrorMessage(message) {
84
+ return message.replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "");
85
+ }
86
+ function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
87
+ if (!_err || typeof _err !== "object") {
88
+ return { message: String(_err) };
89
+ }
90
+ const err = _err;
91
+ if (err.stack) {
92
+ err.stackStr = String(err.stack);
93
+ }
94
+ if (err.name) {
95
+ err.nameStr = String(err.name);
96
+ }
97
+ if (err.showDiff || err.showDiff === void 0 && err.expected !== void 0 && err.actual !== void 0) {
98
+ err.diff = printDiffOrStringify(err.actual, err.expected, {
99
+ ...diffOptions,
100
+ ...err.diffOptions
101
+ });
102
+ }
103
+ if (typeof err.expected !== "string") {
104
+ err.expected = stringify(err.expected, 10);
105
+ }
106
+ if (typeof err.actual !== "string") {
107
+ err.actual = stringify(err.actual, 10);
108
+ }
109
+ try {
110
+ if (typeof err.message === "string") {
111
+ err.message = normalizeErrorMessage(err.message);
112
+ }
113
+ } catch {
114
+ }
115
+ try {
116
+ if (!seen.has(err) && typeof err.cause === "object") {
117
+ seen.add(err);
118
+ err.cause = processError(err.cause, diffOptions, seen);
119
+ }
120
+ } catch {
121
+ }
122
+ try {
123
+ return serializeValue(err);
124
+ } catch (e) {
125
+ return serializeValue(
126
+ new Error(
127
+ `Failed to fully serialize error: ${e == null ? void 0 : e.message}
128
+ Inner error message: ${err == null ? void 0 : err.message}`
129
+ )
130
+ );
131
+ }
132
+ }
133
+ export {
134
+ processError,
135
+ serializeValue as serializeError,
136
+ serializeValue
137
+ };
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function createSimpleStackTrace(options) {
4
+ const { message = "$$stack trace error", stackTraceLimit = 1 } = options || {};
5
+ const limit = Error.stackTraceLimit;
6
+ const prepareStackTrace = Error.prepareStackTrace;
7
+ Error.stackTraceLimit = stackTraceLimit;
8
+ Error.prepareStackTrace = (e) => e.stack;
9
+ const err = new Error(message);
10
+ const stackTrace = err.stack || "";
11
+ Error.prepareStackTrace = prepareStackTrace;
12
+ Error.stackTraceLimit = limit;
13
+ return stackTrace;
14
+ }
15
+ function assertTypes(value, name, types) {
16
+ const receivedType = typeof value;
17
+ const pass = types.includes(receivedType);
18
+ if (!pass) {
19
+ throw new TypeError(
20
+ `${name} value must be ${types.join(" or ")}, received "${receivedType}"`
21
+ );
22
+ }
23
+ }
24
+ function toArray(array) {
25
+ if (array === null || array === void 0) {
26
+ array = [];
27
+ }
28
+ if (Array.isArray(array)) {
29
+ return array;
30
+ }
31
+ return [array];
32
+ }
33
+ function isObject(item) {
34
+ return item != null && typeof item === "object" && !Array.isArray(item);
35
+ }
36
+ function isFinalObj(obj) {
37
+ return obj === Object.prototype || obj === Function.prototype || obj === RegExp.prototype;
38
+ }
39
+ function getType(value) {
40
+ return Object.prototype.toString.apply(value).slice(8, -1);
41
+ }
42
+ function collectOwnProperties(obj, collector) {
43
+ const collect = typeof collector === "function" ? collector : (key) => collector.add(key);
44
+ Object.getOwnPropertyNames(obj).forEach(collect);
45
+ Object.getOwnPropertySymbols(obj).forEach(collect);
46
+ }
47
+ function getOwnProperties(obj) {
48
+ const ownProps = /* @__PURE__ */ new Set();
49
+ if (isFinalObj(obj)) {
50
+ return [];
51
+ }
52
+ collectOwnProperties(obj, ownProps);
53
+ return Array.from(ownProps);
54
+ }
55
+ const defaultCloneOptions = { forceWritable: false };
56
+ function deepClone(val, options = defaultCloneOptions) {
57
+ const seen = /* @__PURE__ */ new WeakMap();
58
+ return clone(val, seen, options);
59
+ }
60
+ function clone(val, seen, options = defaultCloneOptions) {
61
+ let k, out;
62
+ if (seen.has(val)) {
63
+ return seen.get(val);
64
+ }
65
+ if (Array.isArray(val)) {
66
+ out = Array.from({ length: k = val.length });
67
+ seen.set(val, out);
68
+ while (k--) {
69
+ out[k] = clone(val[k], seen, options);
70
+ }
71
+ return out;
72
+ }
73
+ if (Object.prototype.toString.call(val) === "[object Object]") {
74
+ out = Object.create(Object.getPrototypeOf(val));
75
+ seen.set(val, out);
76
+ const props = getOwnProperties(val);
77
+ for (const k2 of props) {
78
+ const descriptor = Object.getOwnPropertyDescriptor(val, k2);
79
+ if (!descriptor) {
80
+ continue;
81
+ }
82
+ const cloned = clone(val[k2], seen, options);
83
+ if (options.forceWritable) {
84
+ Object.defineProperty(out, k2, {
85
+ enumerable: descriptor.enumerable,
86
+ configurable: true,
87
+ writable: true,
88
+ value: cloned
89
+ });
90
+ } else if ("get" in descriptor) {
91
+ Object.defineProperty(out, k2, {
92
+ ...descriptor,
93
+ get() {
94
+ return cloned;
95
+ }
96
+ });
97
+ } else {
98
+ Object.defineProperty(out, k2, {
99
+ ...descriptor,
100
+ value: cloned
101
+ });
102
+ }
103
+ }
104
+ return out;
105
+ }
106
+ return val;
107
+ }
108
+ function objectAttr(source, path, defaultValue = void 0) {
109
+ const paths = path.replace(/\[(\d+)\]/g, ".$1").split(".");
110
+ let result = source;
111
+ for (const p of paths) {
112
+ result = new Object(result)[p];
113
+ if (result === void 0) {
114
+ return defaultValue;
115
+ }
116
+ }
117
+ return result;
118
+ }
119
+ function createDefer() {
120
+ let resolve = null;
121
+ let reject = null;
122
+ const p = new Promise((_resolve, _reject) => {
123
+ resolve = _resolve;
124
+ reject = _reject;
125
+ });
126
+ p.resolve = resolve;
127
+ p.reject = reject;
128
+ return p;
129
+ }
130
+ function isNegativeNaN(val) {
131
+ if (!Number.isNaN(val)) {
132
+ return false;
133
+ }
134
+ const f64 = new Float64Array(1);
135
+ f64[0] = val;
136
+ const u32 = new Uint32Array(f64.buffer);
137
+ const isNegative = u32[1] >>> 31 === 1;
138
+ return isNegative;
139
+ }
140
+ exports.assertTypes = assertTypes;
141
+ exports.clone = clone;
142
+ exports.createDefer = createDefer;
143
+ exports.createSimpleStackTrace = createSimpleStackTrace;
144
+ exports.deepClone = deepClone;
145
+ exports.getOwnProperties = getOwnProperties;
146
+ exports.getType = getType;
147
+ exports.isNegativeNaN = isNegativeNaN;
148
+ exports.isObject = isObject;
149
+ exports.objectAttr = objectAttr;
150
+ exports.toArray = toArray;
@@ -0,0 +1,150 @@
1
+ function createSimpleStackTrace(options) {
2
+ const { message = "$$stack trace error", stackTraceLimit = 1 } = options || {};
3
+ const limit = Error.stackTraceLimit;
4
+ const prepareStackTrace = Error.prepareStackTrace;
5
+ Error.stackTraceLimit = stackTraceLimit;
6
+ Error.prepareStackTrace = (e) => e.stack;
7
+ const err = new Error(message);
8
+ const stackTrace = err.stack || "";
9
+ Error.prepareStackTrace = prepareStackTrace;
10
+ Error.stackTraceLimit = limit;
11
+ return stackTrace;
12
+ }
13
+ function assertTypes(value, name, types) {
14
+ const receivedType = typeof value;
15
+ const pass = types.includes(receivedType);
16
+ if (!pass) {
17
+ throw new TypeError(
18
+ `${name} value must be ${types.join(" or ")}, received "${receivedType}"`
19
+ );
20
+ }
21
+ }
22
+ function toArray(array) {
23
+ if (array === null || array === void 0) {
24
+ array = [];
25
+ }
26
+ if (Array.isArray(array)) {
27
+ return array;
28
+ }
29
+ return [array];
30
+ }
31
+ function isObject(item) {
32
+ return item != null && typeof item === "object" && !Array.isArray(item);
33
+ }
34
+ function isFinalObj(obj) {
35
+ return obj === Object.prototype || obj === Function.prototype || obj === RegExp.prototype;
36
+ }
37
+ function getType(value) {
38
+ return Object.prototype.toString.apply(value).slice(8, -1);
39
+ }
40
+ function collectOwnProperties(obj, collector) {
41
+ const collect = typeof collector === "function" ? collector : (key) => collector.add(key);
42
+ Object.getOwnPropertyNames(obj).forEach(collect);
43
+ Object.getOwnPropertySymbols(obj).forEach(collect);
44
+ }
45
+ function getOwnProperties(obj) {
46
+ const ownProps = /* @__PURE__ */ new Set();
47
+ if (isFinalObj(obj)) {
48
+ return [];
49
+ }
50
+ collectOwnProperties(obj, ownProps);
51
+ return Array.from(ownProps);
52
+ }
53
+ const defaultCloneOptions = { forceWritable: false };
54
+ function deepClone(val, options = defaultCloneOptions) {
55
+ const seen = /* @__PURE__ */ new WeakMap();
56
+ return clone(val, seen, options);
57
+ }
58
+ function clone(val, seen, options = defaultCloneOptions) {
59
+ let k, out;
60
+ if (seen.has(val)) {
61
+ return seen.get(val);
62
+ }
63
+ if (Array.isArray(val)) {
64
+ out = Array.from({ length: k = val.length });
65
+ seen.set(val, out);
66
+ while (k--) {
67
+ out[k] = clone(val[k], seen, options);
68
+ }
69
+ return out;
70
+ }
71
+ if (Object.prototype.toString.call(val) === "[object Object]") {
72
+ out = Object.create(Object.getPrototypeOf(val));
73
+ seen.set(val, out);
74
+ const props = getOwnProperties(val);
75
+ for (const k2 of props) {
76
+ const descriptor = Object.getOwnPropertyDescriptor(val, k2);
77
+ if (!descriptor) {
78
+ continue;
79
+ }
80
+ const cloned = clone(val[k2], seen, options);
81
+ if (options.forceWritable) {
82
+ Object.defineProperty(out, k2, {
83
+ enumerable: descriptor.enumerable,
84
+ configurable: true,
85
+ writable: true,
86
+ value: cloned
87
+ });
88
+ } else if ("get" in descriptor) {
89
+ Object.defineProperty(out, k2, {
90
+ ...descriptor,
91
+ get() {
92
+ return cloned;
93
+ }
94
+ });
95
+ } else {
96
+ Object.defineProperty(out, k2, {
97
+ ...descriptor,
98
+ value: cloned
99
+ });
100
+ }
101
+ }
102
+ return out;
103
+ }
104
+ return val;
105
+ }
106
+ function objectAttr(source, path, defaultValue = void 0) {
107
+ const paths = path.replace(/\[(\d+)\]/g, ".$1").split(".");
108
+ let result = source;
109
+ for (const p of paths) {
110
+ result = new Object(result)[p];
111
+ if (result === void 0) {
112
+ return defaultValue;
113
+ }
114
+ }
115
+ return result;
116
+ }
117
+ function createDefer() {
118
+ let resolve = null;
119
+ let reject = null;
120
+ const p = new Promise((_resolve, _reject) => {
121
+ resolve = _resolve;
122
+ reject = _reject;
123
+ });
124
+ p.resolve = resolve;
125
+ p.reject = reject;
126
+ return p;
127
+ }
128
+ function isNegativeNaN(val) {
129
+ if (!Number.isNaN(val)) {
130
+ return false;
131
+ }
132
+ const f64 = new Float64Array(1);
133
+ f64[0] = val;
134
+ const u32 = new Uint32Array(f64.buffer);
135
+ const isNegative = u32[1] >>> 31 === 1;
136
+ return isNegative;
137
+ }
138
+ export {
139
+ assertTypes,
140
+ clone,
141
+ createDefer,
142
+ createSimpleStackTrace,
143
+ deepClone,
144
+ getOwnProperties,
145
+ getType,
146
+ isNegativeNaN,
147
+ isObject,
148
+ objectAttr,
149
+ toArray
150
+ };
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("../../../../../tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.cjs");
4
+ require("../../../../../loupe@3.1.1/node_modules/loupe/lib/index.qwik.cjs");
5
+ const SAFE_TIMERS_SYMBOL = Symbol("vitest:SAFE_TIMERS");
6
+ function getSafeTimers() {
7
+ const {
8
+ setTimeout: safeSetTimeout,
9
+ setInterval: safeSetInterval,
10
+ clearInterval: safeClearInterval,
11
+ clearTimeout: safeClearTimeout,
12
+ setImmediate: safeSetImmediate,
13
+ clearImmediate: safeClearImmediate
14
+ } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
15
+ const { nextTick: safeNextTick } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis.process || { nextTick: (cb) => cb() };
16
+ return {
17
+ nextTick: safeNextTick,
18
+ setTimeout: safeSetTimeout,
19
+ setInterval: safeSetInterval,
20
+ clearInterval: safeClearInterval,
21
+ clearTimeout: safeClearTimeout,
22
+ setImmediate: safeSetImmediate,
23
+ clearImmediate: safeClearImmediate
24
+ };
25
+ }
26
+ var LineTerminatorSequence;
27
+ LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
28
+ RegExp(LineTerminatorSequence.source);
29
+ var reservedWords = {
30
+ keyword: [
31
+ "break",
32
+ "case",
33
+ "catch",
34
+ "continue",
35
+ "debugger",
36
+ "default",
37
+ "do",
38
+ "else",
39
+ "finally",
40
+ "for",
41
+ "function",
42
+ "if",
43
+ "return",
44
+ "switch",
45
+ "throw",
46
+ "try",
47
+ "var",
48
+ "const",
49
+ "while",
50
+ "with",
51
+ "new",
52
+ "this",
53
+ "super",
54
+ "class",
55
+ "extends",
56
+ "export",
57
+ "import",
58
+ "null",
59
+ "true",
60
+ "false",
61
+ "in",
62
+ "instanceof",
63
+ "typeof",
64
+ "void",
65
+ "delete"
66
+ ],
67
+ strict: [
68
+ "implements",
69
+ "interface",
70
+ "let",
71
+ "package",
72
+ "private",
73
+ "protected",
74
+ "public",
75
+ "static",
76
+ "yield"
77
+ ]
78
+ };
79
+ new Set(reservedWords.keyword);
80
+ new Set(reservedWords.strict);
81
+ exports.getSafeTimers = getSafeTimers;