vitest 0.0.65 → 0.0.69

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.
@@ -1,2545 +0,0 @@
1
- import {
2
- packSnapshotState
3
- } from "../chunk-SF66BJ42.js";
4
- import {
5
- getNames,
6
- hasFailed,
7
- hasTests,
8
- interpretOnlyMode,
9
- partitionSuiteChildren
10
- } from "../chunk-NK2VTQLQ.js";
11
- import {
12
- clearContext,
13
- context,
14
- createSuiteHooks,
15
- defaultSuite,
16
- getFn,
17
- getHooks,
18
- setHooks
19
- } from "../chunk-LRXUKIDM.js";
20
- import {
21
- nanoid
22
- } from "../chunk-3GMBTS5G.js";
23
- import {
24
- __commonJS,
25
- __spreadValues,
26
- __toModule,
27
- init_esm_shims
28
- } from "../chunk-RNHB4AXG.js";
29
-
30
- // node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js
31
- var require_natural_compare = __commonJS({
32
- "node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js"(exports, module) {
33
- init_esm_shims();
34
- var naturalCompare2 = function(a, b) {
35
- var i, codeA, codeB = 1, posA = 0, posB = 0, alphabet = String.alphabet;
36
- function getCode(str, pos, code) {
37
- if (code) {
38
- for (i = pos; code = getCode(str, i), code < 76 && code > 65; )
39
- ++i;
40
- return +str.slice(pos - 1, i);
41
- }
42
- code = alphabet && alphabet.indexOf(str.charAt(pos));
43
- return code > -1 ? code + 76 : (code = str.charCodeAt(pos) || 0, code < 45 || code > 127) ? code : code < 46 ? 65 : code < 48 ? code - 1 : code < 58 ? code + 18 : code < 65 ? code - 11 : code < 91 ? code + 11 : code < 97 ? code - 37 : code < 123 ? code + 5 : code - 63;
44
- }
45
- if ((a += "") != (b += ""))
46
- for (; codeB; ) {
47
- codeA = getCode(a, posA++);
48
- codeB = getCode(b, posB++);
49
- if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
50
- codeA = getCode(a, posA, posA);
51
- codeB = getCode(b, posB, posA = i);
52
- posB = i;
53
- }
54
- if (codeA != codeB)
55
- return codeA < codeB ? -1 : 1;
56
- }
57
- return 0;
58
- };
59
- try {
60
- module.exports = naturalCompare2;
61
- } catch (e) {
62
- String.naturalCompare = naturalCompare2;
63
- }
64
- }
65
- });
66
-
67
- // node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.js
68
- var require_ansi_styles = __commonJS({
69
- "node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.js"(exports, module) {
70
- init_esm_shims();
71
- "use strict";
72
- var ANSI_BACKGROUND_OFFSET = 10;
73
- var wrapAnsi256 = (offset = 0) => (code) => `[${38 + offset};5;${code}m`;
74
- var wrapAnsi16m = (offset = 0) => (red, green, blue) => `[${38 + offset};2;${red};${green};${blue}m`;
75
- function assembleStyles() {
76
- const codes = /* @__PURE__ */ new Map();
77
- const styles = {
78
- modifier: {
79
- reset: [0, 0],
80
- bold: [1, 22],
81
- dim: [2, 22],
82
- italic: [3, 23],
83
- underline: [4, 24],
84
- overline: [53, 55],
85
- inverse: [7, 27],
86
- hidden: [8, 28],
87
- strikethrough: [9, 29]
88
- },
89
- color: {
90
- black: [30, 39],
91
- red: [31, 39],
92
- green: [32, 39],
93
- yellow: [33, 39],
94
- blue: [34, 39],
95
- magenta: [35, 39],
96
- cyan: [36, 39],
97
- white: [37, 39],
98
- blackBright: [90, 39],
99
- redBright: [91, 39],
100
- greenBright: [92, 39],
101
- yellowBright: [93, 39],
102
- blueBright: [94, 39],
103
- magentaBright: [95, 39],
104
- cyanBright: [96, 39],
105
- whiteBright: [97, 39]
106
- },
107
- bgColor: {
108
- bgBlack: [40, 49],
109
- bgRed: [41, 49],
110
- bgGreen: [42, 49],
111
- bgYellow: [43, 49],
112
- bgBlue: [44, 49],
113
- bgMagenta: [45, 49],
114
- bgCyan: [46, 49],
115
- bgWhite: [47, 49],
116
- bgBlackBright: [100, 49],
117
- bgRedBright: [101, 49],
118
- bgGreenBright: [102, 49],
119
- bgYellowBright: [103, 49],
120
- bgBlueBright: [104, 49],
121
- bgMagentaBright: [105, 49],
122
- bgCyanBright: [106, 49],
123
- bgWhiteBright: [107, 49]
124
- }
125
- };
126
- styles.color.gray = styles.color.blackBright;
127
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
128
- styles.color.grey = styles.color.blackBright;
129
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
130
- for (const [groupName, group] of Object.entries(styles)) {
131
- for (const [styleName, style] of Object.entries(group)) {
132
- styles[styleName] = {
133
- open: `[${style[0]}m`,
134
- close: `[${style[1]}m`
135
- };
136
- group[styleName] = styles[styleName];
137
- codes.set(style[0], style[1]);
138
- }
139
- Object.defineProperty(styles, groupName, {
140
- value: group,
141
- enumerable: false
142
- });
143
- }
144
- Object.defineProperty(styles, "codes", {
145
- value: codes,
146
- enumerable: false
147
- });
148
- styles.color.close = "";
149
- styles.bgColor.close = "";
150
- styles.color.ansi256 = wrapAnsi256();
151
- styles.color.ansi16m = wrapAnsi16m();
152
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
153
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
154
- Object.defineProperties(styles, {
155
- rgbToAnsi256: {
156
- value: (red, green, blue) => {
157
- if (red === green && green === blue) {
158
- if (red < 8) {
159
- return 16;
160
- }
161
- if (red > 248) {
162
- return 231;
163
- }
164
- return Math.round((red - 8) / 247 * 24) + 232;
165
- }
166
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
167
- },
168
- enumerable: false
169
- },
170
- hexToRgb: {
171
- value: (hex) => {
172
- const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
173
- if (!matches) {
174
- return [0, 0, 0];
175
- }
176
- let { colorString } = matches.groups;
177
- if (colorString.length === 3) {
178
- colorString = colorString.split("").map((character) => character + character).join("");
179
- }
180
- const integer = Number.parseInt(colorString, 16);
181
- return [
182
- integer >> 16 & 255,
183
- integer >> 8 & 255,
184
- integer & 255
185
- ];
186
- },
187
- enumerable: false
188
- },
189
- hexToAnsi256: {
190
- value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
191
- enumerable: false
192
- }
193
- });
194
- return styles;
195
- }
196
- Object.defineProperty(module, "exports", {
197
- enumerable: true,
198
- get: assembleStyles
199
- });
200
- }
201
- });
202
-
203
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/collections.js
204
- var require_collections = __commonJS({
205
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/collections.js"(exports) {
206
- init_esm_shims();
207
- "use strict";
208
- Object.defineProperty(exports, "__esModule", {
209
- value: true
210
- });
211
- exports.printIteratorEntries = printIteratorEntries;
212
- exports.printIteratorValues = printIteratorValues;
213
- exports.printListItems = printListItems;
214
- exports.printObjectProperties = printObjectProperties;
215
- var getKeysOfEnumerableProperties = (object, compareKeys) => {
216
- const keys = Object.keys(object).sort(compareKeys);
217
- if (Object.getOwnPropertySymbols) {
218
- Object.getOwnPropertySymbols(object).forEach((symbol) => {
219
- if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) {
220
- keys.push(symbol);
221
- }
222
- });
223
- }
224
- return keys;
225
- };
226
- function printIteratorEntries(iterator, config, indentation, depth, refs, printer, separator = ": ") {
227
- let result = "";
228
- let current = iterator.next();
229
- if (!current.done) {
230
- result += config.spacingOuter;
231
- const indentationNext = indentation + config.indent;
232
- while (!current.done) {
233
- const name = printer(current.value[0], config, indentationNext, depth, refs);
234
- const value = printer(current.value[1], config, indentationNext, depth, refs);
235
- result += indentationNext + name + separator + value;
236
- current = iterator.next();
237
- if (!current.done) {
238
- result += "," + config.spacingInner;
239
- } else if (!config.min) {
240
- result += ",";
241
- }
242
- }
243
- result += config.spacingOuter + indentation;
244
- }
245
- return result;
246
- }
247
- function printIteratorValues(iterator, config, indentation, depth, refs, printer) {
248
- let result = "";
249
- let current = iterator.next();
250
- if (!current.done) {
251
- result += config.spacingOuter;
252
- const indentationNext = indentation + config.indent;
253
- while (!current.done) {
254
- result += indentationNext + printer(current.value, config, indentationNext, depth, refs);
255
- current = iterator.next();
256
- if (!current.done) {
257
- result += "," + config.spacingInner;
258
- } else if (!config.min) {
259
- result += ",";
260
- }
261
- }
262
- result += config.spacingOuter + indentation;
263
- }
264
- return result;
265
- }
266
- function printListItems(list, config, indentation, depth, refs, printer) {
267
- let result = "";
268
- if (list.length) {
269
- result += config.spacingOuter;
270
- const indentationNext = indentation + config.indent;
271
- for (let i = 0; i < list.length; i++) {
272
- result += indentationNext;
273
- if (i in list) {
274
- result += printer(list[i], config, indentationNext, depth, refs);
275
- }
276
- if (i < list.length - 1) {
277
- result += "," + config.spacingInner;
278
- } else if (!config.min) {
279
- result += ",";
280
- }
281
- }
282
- result += config.spacingOuter + indentation;
283
- }
284
- return result;
285
- }
286
- function printObjectProperties(val, config, indentation, depth, refs, printer) {
287
- let result = "";
288
- const keys = getKeysOfEnumerableProperties(val, config.compareKeys);
289
- if (keys.length) {
290
- result += config.spacingOuter;
291
- const indentationNext = indentation + config.indent;
292
- for (let i = 0; i < keys.length; i++) {
293
- const key = keys[i];
294
- const name = printer(key, config, indentationNext, depth, refs);
295
- const value = printer(val[key], config, indentationNext, depth, refs);
296
- result += indentationNext + name + ": " + value;
297
- if (i < keys.length - 1) {
298
- result += "," + config.spacingInner;
299
- } else if (!config.min) {
300
- result += ",";
301
- }
302
- }
303
- result += config.spacingOuter + indentation;
304
- }
305
- return result;
306
- }
307
- }
308
- });
309
-
310
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/AsymmetricMatcher.js
311
- var require_AsymmetricMatcher = __commonJS({
312
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/AsymmetricMatcher.js"(exports) {
313
- init_esm_shims();
314
- "use strict";
315
- Object.defineProperty(exports, "__esModule", {
316
- value: true
317
- });
318
- exports.default = exports.test = exports.serialize = void 0;
319
- var _collections = require_collections();
320
- var global = function() {
321
- if (typeof globalThis !== "undefined") {
322
- return globalThis;
323
- } else if (typeof global !== "undefined") {
324
- return global;
325
- } else if (typeof self !== "undefined") {
326
- return self;
327
- } else if (typeof window !== "undefined") {
328
- return window;
329
- } else {
330
- return Function("return this")();
331
- }
332
- }();
333
- var Symbol2 = global["jest-symbol-do-not-touch"] || global.Symbol;
334
- var asymmetricMatcher = typeof Symbol2 === "function" && Symbol2.for ? Symbol2.for("jest.asymmetricMatcher") : 1267621;
335
- var SPACE = " ";
336
- var serialize2 = (val, config, indentation, depth, refs, printer) => {
337
- const stringedValue = val.toString();
338
- if (stringedValue === "ArrayContaining" || stringedValue === "ArrayNotContaining") {
339
- if (++depth > config.maxDepth) {
340
- return "[" + stringedValue + "]";
341
- }
342
- return stringedValue + SPACE + "[" + (0, _collections.printListItems)(val.sample, config, indentation, depth, refs, printer) + "]";
343
- }
344
- if (stringedValue === "ObjectContaining" || stringedValue === "ObjectNotContaining") {
345
- if (++depth > config.maxDepth) {
346
- return "[" + stringedValue + "]";
347
- }
348
- return stringedValue + SPACE + "{" + (0, _collections.printObjectProperties)(val.sample, config, indentation, depth, refs, printer) + "}";
349
- }
350
- if (stringedValue === "StringMatching" || stringedValue === "StringNotMatching") {
351
- return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
352
- }
353
- if (stringedValue === "StringContaining" || stringedValue === "StringNotContaining") {
354
- return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
355
- }
356
- return val.toAsymmetricMatcher();
357
- };
358
- exports.serialize = serialize2;
359
- var test = (val) => val && val.$$typeof === asymmetricMatcher;
360
- exports.test = test;
361
- var plugin = {
362
- serialize: serialize2,
363
- test
364
- };
365
- var _default = plugin;
366
- exports.default = _default;
367
- }
368
- });
369
-
370
- // node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js
371
- var require_ansi_regex = __commonJS({
372
- "node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports, module) {
373
- init_esm_shims();
374
- "use strict";
375
- module.exports = ({ onlyFirst = false } = {}) => {
376
- const pattern = [
377
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
378
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
379
- ].join("|");
380
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
381
- };
382
- }
383
- });
384
-
385
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/ConvertAnsi.js
386
- var require_ConvertAnsi = __commonJS({
387
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/ConvertAnsi.js"(exports) {
388
- init_esm_shims();
389
- "use strict";
390
- Object.defineProperty(exports, "__esModule", {
391
- value: true
392
- });
393
- exports.default = exports.serialize = exports.test = void 0;
394
- var _ansiRegex = _interopRequireDefault(require_ansi_regex());
395
- var _ansiStyles = _interopRequireDefault(require_ansi_styles());
396
- function _interopRequireDefault(obj) {
397
- return obj && obj.__esModule ? obj : { default: obj };
398
- }
399
- var toHumanReadableAnsi = (text) => text.replace((0, _ansiRegex.default)(), (match) => {
400
- switch (match) {
401
- case _ansiStyles.default.red.close:
402
- case _ansiStyles.default.green.close:
403
- case _ansiStyles.default.cyan.close:
404
- case _ansiStyles.default.gray.close:
405
- case _ansiStyles.default.white.close:
406
- case _ansiStyles.default.yellow.close:
407
- case _ansiStyles.default.bgRed.close:
408
- case _ansiStyles.default.bgGreen.close:
409
- case _ansiStyles.default.bgYellow.close:
410
- case _ansiStyles.default.inverse.close:
411
- case _ansiStyles.default.dim.close:
412
- case _ansiStyles.default.bold.close:
413
- case _ansiStyles.default.reset.open:
414
- case _ansiStyles.default.reset.close:
415
- return "</>";
416
- case _ansiStyles.default.red.open:
417
- return "<red>";
418
- case _ansiStyles.default.green.open:
419
- return "<green>";
420
- case _ansiStyles.default.cyan.open:
421
- return "<cyan>";
422
- case _ansiStyles.default.gray.open:
423
- return "<gray>";
424
- case _ansiStyles.default.white.open:
425
- return "<white>";
426
- case _ansiStyles.default.yellow.open:
427
- return "<yellow>";
428
- case _ansiStyles.default.bgRed.open:
429
- return "<bgRed>";
430
- case _ansiStyles.default.bgGreen.open:
431
- return "<bgGreen>";
432
- case _ansiStyles.default.bgYellow.open:
433
- return "<bgYellow>";
434
- case _ansiStyles.default.inverse.open:
435
- return "<inverse>";
436
- case _ansiStyles.default.dim.open:
437
- return "<dim>";
438
- case _ansiStyles.default.bold.open:
439
- return "<bold>";
440
- default:
441
- return "";
442
- }
443
- });
444
- var test = (val) => typeof val === "string" && !!val.match((0, _ansiRegex.default)());
445
- exports.test = test;
446
- var serialize2 = (val, config, indentation, depth, refs, printer) => printer(toHumanReadableAnsi(val), config, indentation, depth, refs);
447
- exports.serialize = serialize2;
448
- var plugin = {
449
- serialize: serialize2,
450
- test
451
- };
452
- var _default = plugin;
453
- exports.default = _default;
454
- }
455
- });
456
-
457
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/DOMCollection.js
458
- var require_DOMCollection = __commonJS({
459
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/DOMCollection.js"(exports) {
460
- init_esm_shims();
461
- "use strict";
462
- Object.defineProperty(exports, "__esModule", {
463
- value: true
464
- });
465
- exports.default = exports.serialize = exports.test = void 0;
466
- var _collections = require_collections();
467
- var SPACE = " ";
468
- var OBJECT_NAMES = ["DOMStringMap", "NamedNodeMap"];
469
- var ARRAY_REGEXP = /^(HTML\w*Collection|NodeList)$/;
470
- var testName = (name) => OBJECT_NAMES.indexOf(name) !== -1 || ARRAY_REGEXP.test(name);
471
- var test = (val) => val && val.constructor && !!val.constructor.name && testName(val.constructor.name);
472
- exports.test = test;
473
- var isNamedNodeMap = (collection) => collection.constructor.name === "NamedNodeMap";
474
- var serialize2 = (collection, config, indentation, depth, refs, printer) => {
475
- const name = collection.constructor.name;
476
- if (++depth > config.maxDepth) {
477
- return "[" + name + "]";
478
- }
479
- return (config.min ? "" : name + SPACE) + (OBJECT_NAMES.indexOf(name) !== -1 ? "{" + (0, _collections.printObjectProperties)(isNamedNodeMap(collection) ? Array.from(collection).reduce((props, attribute) => {
480
- props[attribute.name] = attribute.value;
481
- return props;
482
- }, {}) : __spreadValues({}, collection), config, indentation, depth, refs, printer) + "}" : "[" + (0, _collections.printListItems)(Array.from(collection), config, indentation, depth, refs, printer) + "]");
483
- };
484
- exports.serialize = serialize2;
485
- var plugin = {
486
- serialize: serialize2,
487
- test
488
- };
489
- var _default = plugin;
490
- exports.default = _default;
491
- }
492
- });
493
-
494
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/lib/escapeHTML.js
495
- var require_escapeHTML = __commonJS({
496
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/lib/escapeHTML.js"(exports) {
497
- init_esm_shims();
498
- "use strict";
499
- Object.defineProperty(exports, "__esModule", {
500
- value: true
501
- });
502
- exports.default = escapeHTML;
503
- function escapeHTML(str) {
504
- return str.replace(/</g, "&lt;").replace(/>/g, "&gt;");
505
- }
506
- }
507
- });
508
-
509
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/lib/markup.js
510
- var require_markup = __commonJS({
511
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/lib/markup.js"(exports) {
512
- init_esm_shims();
513
- "use strict";
514
- Object.defineProperty(exports, "__esModule", {
515
- value: true
516
- });
517
- exports.printElementAsLeaf = exports.printElement = exports.printComment = exports.printText = exports.printChildren = exports.printProps = void 0;
518
- var _escapeHTML = _interopRequireDefault(require_escapeHTML());
519
- function _interopRequireDefault(obj) {
520
- return obj && obj.__esModule ? obj : { default: obj };
521
- }
522
- var printProps = (keys, props, config, indentation, depth, refs, printer) => {
523
- const indentationNext = indentation + config.indent;
524
- const colors = config.colors;
525
- return keys.map((key) => {
526
- const value = props[key];
527
- let printed = printer(value, config, indentationNext, depth, refs);
528
- if (typeof value !== "string") {
529
- if (printed.indexOf("\n") !== -1) {
530
- printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;
531
- }
532
- printed = "{" + printed + "}";
533
- }
534
- return config.spacingInner + indentation + colors.prop.open + key + colors.prop.close + "=" + colors.value.open + printed + colors.value.close;
535
- }).join("");
536
- };
537
- exports.printProps = printProps;
538
- var printChildren = (children, config, indentation, depth, refs, printer) => children.map((child) => config.spacingOuter + indentation + (typeof child === "string" ? printText(child, config) : printer(child, config, indentation, depth, refs))).join("");
539
- exports.printChildren = printChildren;
540
- var printText = (text, config) => {
541
- const contentColor = config.colors.content;
542
- return contentColor.open + (0, _escapeHTML.default)(text) + contentColor.close;
543
- };
544
- exports.printText = printText;
545
- var printComment = (comment, config) => {
546
- const commentColor = config.colors.comment;
547
- return commentColor.open + "<!--" + (0, _escapeHTML.default)(comment) + "-->" + commentColor.close;
548
- };
549
- exports.printComment = printComment;
550
- var printElement = (type, printedProps, printedChildren, config, indentation) => {
551
- const tagColor = config.colors.tag;
552
- return tagColor.open + "<" + type + (printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open) + (printedChildren ? ">" + tagColor.close + printedChildren + config.spacingOuter + indentation + tagColor.open + "</" + type : (printedProps && !config.min ? "" : " ") + "/") + ">" + tagColor.close;
553
- };
554
- exports.printElement = printElement;
555
- var printElementAsLeaf = (type, config) => {
556
- const tagColor = config.colors.tag;
557
- return tagColor.open + "<" + type + tagColor.close + " \u2026" + tagColor.open + " />" + tagColor.close;
558
- };
559
- exports.printElementAsLeaf = printElementAsLeaf;
560
- }
561
- });
562
-
563
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/DOMElement.js
564
- var require_DOMElement = __commonJS({
565
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/DOMElement.js"(exports) {
566
- init_esm_shims();
567
- "use strict";
568
- Object.defineProperty(exports, "__esModule", {
569
- value: true
570
- });
571
- exports.default = exports.serialize = exports.test = void 0;
572
- var _markup = require_markup();
573
- var ELEMENT_NODE = 1;
574
- var TEXT_NODE = 3;
575
- var COMMENT_NODE = 8;
576
- var FRAGMENT_NODE = 11;
577
- var ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
578
- var testHasAttribute = (val) => {
579
- try {
580
- return typeof val.hasAttribute === "function" && val.hasAttribute("is");
581
- } catch {
582
- return false;
583
- }
584
- };
585
- var testNode = (val) => {
586
- const constructorName = val.constructor.name;
587
- const { nodeType, tagName } = val;
588
- const isCustomElement = typeof tagName === "string" && tagName.includes("-") || testHasAttribute(val);
589
- return nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement) || nodeType === TEXT_NODE && constructorName === "Text" || nodeType === COMMENT_NODE && constructorName === "Comment" || nodeType === FRAGMENT_NODE && constructorName === "DocumentFragment";
590
- };
591
- var test = (val) => {
592
- var _val$constructor;
593
- return (val === null || val === void 0 ? void 0 : (_val$constructor = val.constructor) === null || _val$constructor === void 0 ? void 0 : _val$constructor.name) && testNode(val);
594
- };
595
- exports.test = test;
596
- function nodeIsText(node) {
597
- return node.nodeType === TEXT_NODE;
598
- }
599
- function nodeIsComment(node) {
600
- return node.nodeType === COMMENT_NODE;
601
- }
602
- function nodeIsFragment(node) {
603
- return node.nodeType === FRAGMENT_NODE;
604
- }
605
- var serialize2 = (node, config, indentation, depth, refs, printer) => {
606
- if (nodeIsText(node)) {
607
- return (0, _markup.printText)(node.data, config);
608
- }
609
- if (nodeIsComment(node)) {
610
- return (0, _markup.printComment)(node.data, config);
611
- }
612
- const type = nodeIsFragment(node) ? `DocumentFragment` : node.tagName.toLowerCase();
613
- if (++depth > config.maxDepth) {
614
- return (0, _markup.printElementAsLeaf)(type, config);
615
- }
616
- return (0, _markup.printElement)(type, (0, _markup.printProps)(nodeIsFragment(node) ? [] : Array.from(node.attributes).map((attr) => attr.name).sort(), nodeIsFragment(node) ? {} : Array.from(node.attributes).reduce((props, attribute) => {
617
- props[attribute.name] = attribute.value;
618
- return props;
619
- }, {}), config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
620
- };
621
- exports.serialize = serialize2;
622
- var plugin = {
623
- serialize: serialize2,
624
- test
625
- };
626
- var _default = plugin;
627
- exports.default = _default;
628
- }
629
- });
630
-
631
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/Immutable.js
632
- var require_Immutable = __commonJS({
633
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/Immutable.js"(exports) {
634
- init_esm_shims();
635
- "use strict";
636
- Object.defineProperty(exports, "__esModule", {
637
- value: true
638
- });
639
- exports.default = exports.test = exports.serialize = void 0;
640
- var _collections = require_collections();
641
- var IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@";
642
- var IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@";
643
- var IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
644
- var IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@";
645
- var IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
646
- var IS_RECORD_SENTINEL = "@@__IMMUTABLE_RECORD__@@";
647
- var IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@";
648
- var IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
649
- var IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@";
650
- var getImmutableName = (name) => "Immutable." + name;
651
- var printAsLeaf = (name) => "[" + name + "]";
652
- var SPACE = " ";
653
- var LAZY = "\u2026";
654
- var printImmutableEntries = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE + "{" + (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) + "}";
655
- function getRecordEntries(val) {
656
- let i = 0;
657
- return {
658
- next() {
659
- if (i < val._keys.length) {
660
- const key = val._keys[i++];
661
- return {
662
- done: false,
663
- value: [key, val.get(key)]
664
- };
665
- }
666
- return {
667
- done: true,
668
- value: void 0
669
- };
670
- }
671
- };
672
- }
673
- var printImmutableRecord = (val, config, indentation, depth, refs, printer) => {
674
- const name = getImmutableName(val._name || "Record");
675
- return ++depth > config.maxDepth ? printAsLeaf(name) : name + SPACE + "{" + (0, _collections.printIteratorEntries)(getRecordEntries(val), config, indentation, depth, refs, printer) + "}";
676
- };
677
- var printImmutableSeq = (val, config, indentation, depth, refs, printer) => {
678
- const name = getImmutableName("Seq");
679
- if (++depth > config.maxDepth) {
680
- return printAsLeaf(name);
681
- }
682
- if (val[IS_KEYED_SENTINEL]) {
683
- return name + SPACE + "{" + (val._iter || val._object ? (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) : LAZY) + "}";
684
- }
685
- return name + SPACE + "[" + (val._iter || val._array || val._collection || val._iterable ? (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) : LAZY) + "]";
686
- };
687
- var printImmutableValues = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE + "[" + (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + "]";
688
- var serialize2 = (val, config, indentation, depth, refs, printer) => {
689
- if (val[IS_MAP_SENTINEL]) {
690
- return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedMap" : "Map");
691
- }
692
- if (val[IS_LIST_SENTINEL]) {
693
- return printImmutableValues(val, config, indentation, depth, refs, printer, "List");
694
- }
695
- if (val[IS_SET_SENTINEL]) {
696
- return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedSet" : "Set");
697
- }
698
- if (val[IS_STACK_SENTINEL]) {
699
- return printImmutableValues(val, config, indentation, depth, refs, printer, "Stack");
700
- }
701
- if (val[IS_SEQ_SENTINEL]) {
702
- return printImmutableSeq(val, config, indentation, depth, refs, printer);
703
- }
704
- return printImmutableRecord(val, config, indentation, depth, refs, printer);
705
- };
706
- exports.serialize = serialize2;
707
- var test = (val) => val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
708
- exports.test = test;
709
- var plugin = {
710
- serialize: serialize2,
711
- test
712
- };
713
- var _default = plugin;
714
- exports.default = _default;
715
- }
716
- });
717
-
718
- // node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/cjs/react-is.production.min.js
719
- var require_react_is_production_min = __commonJS({
720
- "node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
721
- init_esm_shims();
722
- "use strict";
723
- var b = 60103;
724
- var c = 60106;
725
- var d = 60107;
726
- var e = 60108;
727
- var f = 60114;
728
- var g = 60109;
729
- var h = 60110;
730
- var k = 60112;
731
- var l = 60113;
732
- var m = 60120;
733
- var n = 60115;
734
- var p = 60116;
735
- var q = 60121;
736
- var r = 60122;
737
- var u = 60117;
738
- var v = 60129;
739
- var w = 60131;
740
- if (typeof Symbol === "function" && Symbol.for) {
741
- x = Symbol.for;
742
- b = x("react.element");
743
- c = x("react.portal");
744
- d = x("react.fragment");
745
- e = x("react.strict_mode");
746
- f = x("react.profiler");
747
- g = x("react.provider");
748
- h = x("react.context");
749
- k = x("react.forward_ref");
750
- l = x("react.suspense");
751
- m = x("react.suspense_list");
752
- n = x("react.memo");
753
- p = x("react.lazy");
754
- q = x("react.block");
755
- r = x("react.server.block");
756
- u = x("react.fundamental");
757
- v = x("react.debug_trace_mode");
758
- w = x("react.legacy_hidden");
759
- }
760
- var x;
761
- function y(a) {
762
- if (typeof a === "object" && a !== null) {
763
- var t = a.$$typeof;
764
- switch (t) {
765
- case b:
766
- switch (a = a.type, a) {
767
- case d:
768
- case f:
769
- case e:
770
- case l:
771
- case m:
772
- return a;
773
- default:
774
- switch (a = a && a.$$typeof, a) {
775
- case h:
776
- case k:
777
- case p:
778
- case n:
779
- case g:
780
- return a;
781
- default:
782
- return t;
783
- }
784
- }
785
- case c:
786
- return t;
787
- }
788
- }
789
- }
790
- var z = g;
791
- var A = b;
792
- var B = k;
793
- var C = d;
794
- var D = p;
795
- var E = n;
796
- var F = c;
797
- var G = f;
798
- var H = e;
799
- var I = l;
800
- exports.ContextConsumer = h;
801
- exports.ContextProvider = z;
802
- exports.Element = A;
803
- exports.ForwardRef = B;
804
- exports.Fragment = C;
805
- exports.Lazy = D;
806
- exports.Memo = E;
807
- exports.Portal = F;
808
- exports.Profiler = G;
809
- exports.StrictMode = H;
810
- exports.Suspense = I;
811
- exports.isAsyncMode = function() {
812
- return false;
813
- };
814
- exports.isConcurrentMode = function() {
815
- return false;
816
- };
817
- exports.isContextConsumer = function(a) {
818
- return y(a) === h;
819
- };
820
- exports.isContextProvider = function(a) {
821
- return y(a) === g;
822
- };
823
- exports.isElement = function(a) {
824
- return typeof a === "object" && a !== null && a.$$typeof === b;
825
- };
826
- exports.isForwardRef = function(a) {
827
- return y(a) === k;
828
- };
829
- exports.isFragment = function(a) {
830
- return y(a) === d;
831
- };
832
- exports.isLazy = function(a) {
833
- return y(a) === p;
834
- };
835
- exports.isMemo = function(a) {
836
- return y(a) === n;
837
- };
838
- exports.isPortal = function(a) {
839
- return y(a) === c;
840
- };
841
- exports.isProfiler = function(a) {
842
- return y(a) === f;
843
- };
844
- exports.isStrictMode = function(a) {
845
- return y(a) === e;
846
- };
847
- exports.isSuspense = function(a) {
848
- return y(a) === l;
849
- };
850
- exports.isValidElementType = function(a) {
851
- return typeof a === "string" || typeof a === "function" || a === d || a === f || a === v || a === e || a === l || a === m || a === w || typeof a === "object" && a !== null && (a.$$typeof === p || a.$$typeof === n || a.$$typeof === g || a.$$typeof === h || a.$$typeof === k || a.$$typeof === u || a.$$typeof === q || a[0] === r) ? true : false;
852
- };
853
- exports.typeOf = y;
854
- }
855
- });
856
-
857
- // node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/cjs/react-is.development.js
858
- var require_react_is_development = __commonJS({
859
- "node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/cjs/react-is.development.js"(exports) {
860
- init_esm_shims();
861
- "use strict";
862
- if (process.env.NODE_ENV !== "production") {
863
- (function() {
864
- "use strict";
865
- var REACT_ELEMENT_TYPE = 60103;
866
- var REACT_PORTAL_TYPE = 60106;
867
- var REACT_FRAGMENT_TYPE = 60107;
868
- var REACT_STRICT_MODE_TYPE = 60108;
869
- var REACT_PROFILER_TYPE = 60114;
870
- var REACT_PROVIDER_TYPE = 60109;
871
- var REACT_CONTEXT_TYPE = 60110;
872
- var REACT_FORWARD_REF_TYPE = 60112;
873
- var REACT_SUSPENSE_TYPE = 60113;
874
- var REACT_SUSPENSE_LIST_TYPE = 60120;
875
- var REACT_MEMO_TYPE = 60115;
876
- var REACT_LAZY_TYPE = 60116;
877
- var REACT_BLOCK_TYPE = 60121;
878
- var REACT_SERVER_BLOCK_TYPE = 60122;
879
- var REACT_FUNDAMENTAL_TYPE = 60117;
880
- var REACT_SCOPE_TYPE = 60119;
881
- var REACT_OPAQUE_ID_TYPE = 60128;
882
- var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
883
- var REACT_OFFSCREEN_TYPE = 60130;
884
- var REACT_LEGACY_HIDDEN_TYPE = 60131;
885
- if (typeof Symbol === "function" && Symbol.for) {
886
- var symbolFor = Symbol.for;
887
- REACT_ELEMENT_TYPE = symbolFor("react.element");
888
- REACT_PORTAL_TYPE = symbolFor("react.portal");
889
- REACT_FRAGMENT_TYPE = symbolFor("react.fragment");
890
- REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode");
891
- REACT_PROFILER_TYPE = symbolFor("react.profiler");
892
- REACT_PROVIDER_TYPE = symbolFor("react.provider");
893
- REACT_CONTEXT_TYPE = symbolFor("react.context");
894
- REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
895
- REACT_SUSPENSE_TYPE = symbolFor("react.suspense");
896
- REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
897
- REACT_MEMO_TYPE = symbolFor("react.memo");
898
- REACT_LAZY_TYPE = symbolFor("react.lazy");
899
- REACT_BLOCK_TYPE = symbolFor("react.block");
900
- REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
901
- REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
902
- REACT_SCOPE_TYPE = symbolFor("react.scope");
903
- REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
904
- REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
905
- REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
906
- REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
907
- }
908
- var enableScopeAPI = false;
909
- function isValidElementType(type) {
910
- if (typeof type === "string" || typeof type === "function") {
911
- return true;
912
- }
913
- if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) {
914
- return true;
915
- }
916
- if (typeof type === "object" && type !== null) {
917
- if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
918
- return true;
919
- }
920
- }
921
- return false;
922
- }
923
- function typeOf(object) {
924
- if (typeof object === "object" && object !== null) {
925
- var $$typeof = object.$$typeof;
926
- switch ($$typeof) {
927
- case REACT_ELEMENT_TYPE:
928
- var type = object.type;
929
- switch (type) {
930
- case REACT_FRAGMENT_TYPE:
931
- case REACT_PROFILER_TYPE:
932
- case REACT_STRICT_MODE_TYPE:
933
- case REACT_SUSPENSE_TYPE:
934
- case REACT_SUSPENSE_LIST_TYPE:
935
- return type;
936
- default:
937
- var $$typeofType = type && type.$$typeof;
938
- switch ($$typeofType) {
939
- case REACT_CONTEXT_TYPE:
940
- case REACT_FORWARD_REF_TYPE:
941
- case REACT_LAZY_TYPE:
942
- case REACT_MEMO_TYPE:
943
- case REACT_PROVIDER_TYPE:
944
- return $$typeofType;
945
- default:
946
- return $$typeof;
947
- }
948
- }
949
- case REACT_PORTAL_TYPE:
950
- return $$typeof;
951
- }
952
- }
953
- return void 0;
954
- }
955
- var ContextConsumer = REACT_CONTEXT_TYPE;
956
- var ContextProvider = REACT_PROVIDER_TYPE;
957
- var Element = REACT_ELEMENT_TYPE;
958
- var ForwardRef = REACT_FORWARD_REF_TYPE;
959
- var Fragment = REACT_FRAGMENT_TYPE;
960
- var Lazy = REACT_LAZY_TYPE;
961
- var Memo = REACT_MEMO_TYPE;
962
- var Portal = REACT_PORTAL_TYPE;
963
- var Profiler = REACT_PROFILER_TYPE;
964
- var StrictMode = REACT_STRICT_MODE_TYPE;
965
- var Suspense = REACT_SUSPENSE_TYPE;
966
- var hasWarnedAboutDeprecatedIsAsyncMode = false;
967
- var hasWarnedAboutDeprecatedIsConcurrentMode = false;
968
- function isAsyncMode(object) {
969
- {
970
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
971
- hasWarnedAboutDeprecatedIsAsyncMode = true;
972
- console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
973
- }
974
- }
975
- return false;
976
- }
977
- function isConcurrentMode(object) {
978
- {
979
- if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
980
- hasWarnedAboutDeprecatedIsConcurrentMode = true;
981
- console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
982
- }
983
- }
984
- return false;
985
- }
986
- function isContextConsumer(object) {
987
- return typeOf(object) === REACT_CONTEXT_TYPE;
988
- }
989
- function isContextProvider(object) {
990
- return typeOf(object) === REACT_PROVIDER_TYPE;
991
- }
992
- function isElement(object) {
993
- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
994
- }
995
- function isForwardRef(object) {
996
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
997
- }
998
- function isFragment(object) {
999
- return typeOf(object) === REACT_FRAGMENT_TYPE;
1000
- }
1001
- function isLazy(object) {
1002
- return typeOf(object) === REACT_LAZY_TYPE;
1003
- }
1004
- function isMemo(object) {
1005
- return typeOf(object) === REACT_MEMO_TYPE;
1006
- }
1007
- function isPortal(object) {
1008
- return typeOf(object) === REACT_PORTAL_TYPE;
1009
- }
1010
- function isProfiler(object) {
1011
- return typeOf(object) === REACT_PROFILER_TYPE;
1012
- }
1013
- function isStrictMode(object) {
1014
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
1015
- }
1016
- function isSuspense(object) {
1017
- return typeOf(object) === REACT_SUSPENSE_TYPE;
1018
- }
1019
- exports.ContextConsumer = ContextConsumer;
1020
- exports.ContextProvider = ContextProvider;
1021
- exports.Element = Element;
1022
- exports.ForwardRef = ForwardRef;
1023
- exports.Fragment = Fragment;
1024
- exports.Lazy = Lazy;
1025
- exports.Memo = Memo;
1026
- exports.Portal = Portal;
1027
- exports.Profiler = Profiler;
1028
- exports.StrictMode = StrictMode;
1029
- exports.Suspense = Suspense;
1030
- exports.isAsyncMode = isAsyncMode;
1031
- exports.isConcurrentMode = isConcurrentMode;
1032
- exports.isContextConsumer = isContextConsumer;
1033
- exports.isContextProvider = isContextProvider;
1034
- exports.isElement = isElement;
1035
- exports.isForwardRef = isForwardRef;
1036
- exports.isFragment = isFragment;
1037
- exports.isLazy = isLazy;
1038
- exports.isMemo = isMemo;
1039
- exports.isPortal = isPortal;
1040
- exports.isProfiler = isProfiler;
1041
- exports.isStrictMode = isStrictMode;
1042
- exports.isSuspense = isSuspense;
1043
- exports.isValidElementType = isValidElementType;
1044
- exports.typeOf = typeOf;
1045
- })();
1046
- }
1047
- }
1048
- });
1049
-
1050
- // node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/index.js
1051
- var require_react_is = __commonJS({
1052
- "node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/index.js"(exports, module) {
1053
- init_esm_shims();
1054
- "use strict";
1055
- if (process.env.NODE_ENV === "production") {
1056
- module.exports = require_react_is_production_min();
1057
- } else {
1058
- module.exports = require_react_is_development();
1059
- }
1060
- }
1061
- });
1062
-
1063
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/ReactElement.js
1064
- var require_ReactElement = __commonJS({
1065
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/ReactElement.js"(exports) {
1066
- init_esm_shims();
1067
- "use strict";
1068
- Object.defineProperty(exports, "__esModule", {
1069
- value: true
1070
- });
1071
- exports.default = exports.test = exports.serialize = void 0;
1072
- var ReactIs = _interopRequireWildcard(require_react_is());
1073
- var _markup = require_markup();
1074
- function _getRequireWildcardCache(nodeInterop) {
1075
- if (typeof WeakMap !== "function")
1076
- return null;
1077
- var cacheBabelInterop = new WeakMap();
1078
- var cacheNodeInterop = new WeakMap();
1079
- return (_getRequireWildcardCache = function(nodeInterop2) {
1080
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
1081
- })(nodeInterop);
1082
- }
1083
- function _interopRequireWildcard(obj, nodeInterop) {
1084
- if (!nodeInterop && obj && obj.__esModule) {
1085
- return obj;
1086
- }
1087
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
1088
- return { default: obj };
1089
- }
1090
- var cache = _getRequireWildcardCache(nodeInterop);
1091
- if (cache && cache.has(obj)) {
1092
- return cache.get(obj);
1093
- }
1094
- var newObj = {};
1095
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
1096
- for (var key in obj) {
1097
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
1098
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
1099
- if (desc && (desc.get || desc.set)) {
1100
- Object.defineProperty(newObj, key, desc);
1101
- } else {
1102
- newObj[key] = obj[key];
1103
- }
1104
- }
1105
- }
1106
- newObj.default = obj;
1107
- if (cache) {
1108
- cache.set(obj, newObj);
1109
- }
1110
- return newObj;
1111
- }
1112
- var getChildren = (arg, children = []) => {
1113
- if (Array.isArray(arg)) {
1114
- arg.forEach((item) => {
1115
- getChildren(item, children);
1116
- });
1117
- } else if (arg != null && arg !== false) {
1118
- children.push(arg);
1119
- }
1120
- return children;
1121
- };
1122
- var getType = (element) => {
1123
- const type = element.type;
1124
- if (typeof type === "string") {
1125
- return type;
1126
- }
1127
- if (typeof type === "function") {
1128
- return type.displayName || type.name || "Unknown";
1129
- }
1130
- if (ReactIs.isFragment(element)) {
1131
- return "React.Fragment";
1132
- }
1133
- if (ReactIs.isSuspense(element)) {
1134
- return "React.Suspense";
1135
- }
1136
- if (typeof type === "object" && type !== null) {
1137
- if (ReactIs.isContextProvider(element)) {
1138
- return "Context.Provider";
1139
- }
1140
- if (ReactIs.isContextConsumer(element)) {
1141
- return "Context.Consumer";
1142
- }
1143
- if (ReactIs.isForwardRef(element)) {
1144
- if (type.displayName) {
1145
- return type.displayName;
1146
- }
1147
- const functionName = type.render.displayName || type.render.name || "";
1148
- return functionName !== "" ? "ForwardRef(" + functionName + ")" : "ForwardRef";
1149
- }
1150
- if (ReactIs.isMemo(element)) {
1151
- const functionName = type.displayName || type.type.displayName || type.type.name || "";
1152
- return functionName !== "" ? "Memo(" + functionName + ")" : "Memo";
1153
- }
1154
- }
1155
- return "UNDEFINED";
1156
- };
1157
- var getPropKeys = (element) => {
1158
- const { props } = element;
1159
- return Object.keys(props).filter((key) => key !== "children" && props[key] !== void 0).sort();
1160
- };
1161
- var serialize2 = (element, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(getType(element), config) : (0, _markup.printElement)(getType(element), (0, _markup.printProps)(getPropKeys(element), element.props, config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
1162
- exports.serialize = serialize2;
1163
- var test = (val) => val != null && ReactIs.isElement(val);
1164
- exports.test = test;
1165
- var plugin = {
1166
- serialize: serialize2,
1167
- test
1168
- };
1169
- var _default = plugin;
1170
- exports.default = _default;
1171
- }
1172
- });
1173
-
1174
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/ReactTestComponent.js
1175
- var require_ReactTestComponent = __commonJS({
1176
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/plugins/ReactTestComponent.js"(exports) {
1177
- init_esm_shims();
1178
- "use strict";
1179
- Object.defineProperty(exports, "__esModule", {
1180
- value: true
1181
- });
1182
- exports.default = exports.test = exports.serialize = void 0;
1183
- var _markup = require_markup();
1184
- var global = function() {
1185
- if (typeof globalThis !== "undefined") {
1186
- return globalThis;
1187
- } else if (typeof global !== "undefined") {
1188
- return global;
1189
- } else if (typeof self !== "undefined") {
1190
- return self;
1191
- } else if (typeof window !== "undefined") {
1192
- return window;
1193
- } else {
1194
- return Function("return this")();
1195
- }
1196
- }();
1197
- var Symbol2 = global["jest-symbol-do-not-touch"] || global.Symbol;
1198
- var testSymbol = typeof Symbol2 === "function" && Symbol2.for ? Symbol2.for("react.test.json") : 245830487;
1199
- var getPropKeys = (object) => {
1200
- const { props } = object;
1201
- return props ? Object.keys(props).filter((key) => props[key] !== void 0).sort() : [];
1202
- };
1203
- var serialize2 = (object, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(object.type, config) : (0, _markup.printElement)(object.type, object.props ? (0, _markup.printProps)(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer) : "", object.children ? (0, _markup.printChildren)(object.children, config, indentation + config.indent, depth, refs, printer) : "", config, indentation);
1204
- exports.serialize = serialize2;
1205
- var test = (val) => val && val.$$typeof === testSymbol;
1206
- exports.test = test;
1207
- var plugin = {
1208
- serialize: serialize2,
1209
- test
1210
- };
1211
- var _default = plugin;
1212
- exports.default = _default;
1213
- }
1214
- });
1215
-
1216
- // node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/index.js
1217
- var require_build = __commonJS({
1218
- "node_modules/.pnpm/pretty-format@27.4.2/node_modules/pretty-format/build/index.js"(exports) {
1219
- init_esm_shims();
1220
- "use strict";
1221
- Object.defineProperty(exports, "__esModule", {
1222
- value: true
1223
- });
1224
- exports.format = format;
1225
- exports.default = exports.plugins = exports.DEFAULT_OPTIONS = void 0;
1226
- var _ansiStyles = _interopRequireDefault(require_ansi_styles());
1227
- var _collections = require_collections();
1228
- var _AsymmetricMatcher = _interopRequireDefault(require_AsymmetricMatcher());
1229
- var _ConvertAnsi = _interopRequireDefault(require_ConvertAnsi());
1230
- var _DOMCollection = _interopRequireDefault(require_DOMCollection());
1231
- var _DOMElement = _interopRequireDefault(require_DOMElement());
1232
- var _Immutable = _interopRequireDefault(require_Immutable());
1233
- var _ReactElement = _interopRequireDefault(require_ReactElement());
1234
- var _ReactTestComponent = _interopRequireDefault(require_ReactTestComponent());
1235
- function _interopRequireDefault(obj) {
1236
- return obj && obj.__esModule ? obj : { default: obj };
1237
- }
1238
- var toString = Object.prototype.toString;
1239
- var toISOString = Date.prototype.toISOString;
1240
- var errorToString = Error.prototype.toString;
1241
- var regExpToString = RegExp.prototype.toString;
1242
- var getConstructorName = (val) => typeof val.constructor === "function" && val.constructor.name || "Object";
1243
- var isWindow = (val) => typeof window !== "undefined" && val === window;
1244
- var SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
1245
- var NEWLINE_REGEXP = /\n/gi;
1246
- var PrettyFormatPluginError = class extends Error {
1247
- constructor(message, stack) {
1248
- super(message);
1249
- this.stack = stack;
1250
- this.name = this.constructor.name;
1251
- }
1252
- };
1253
- function isToStringedArrayType(toStringed) {
1254
- return toStringed === "[object Array]" || toStringed === "[object ArrayBuffer]" || toStringed === "[object DataView]" || toStringed === "[object Float32Array]" || toStringed === "[object Float64Array]" || toStringed === "[object Int8Array]" || toStringed === "[object Int16Array]" || toStringed === "[object Int32Array]" || toStringed === "[object Uint8Array]" || toStringed === "[object Uint8ClampedArray]" || toStringed === "[object Uint16Array]" || toStringed === "[object Uint32Array]";
1255
- }
1256
- function printNumber(val) {
1257
- return Object.is(val, -0) ? "-0" : String(val);
1258
- }
1259
- function printBigInt(val) {
1260
- return String(`${val}n`);
1261
- }
1262
- function printFunction(val, printFunctionName2) {
1263
- if (!printFunctionName2) {
1264
- return "[Function]";
1265
- }
1266
- return "[Function " + (val.name || "anonymous") + "]";
1267
- }
1268
- function printSymbol(val) {
1269
- return String(val).replace(SYMBOL_REGEXP, "Symbol($1)");
1270
- }
1271
- function printError(val) {
1272
- return "[" + errorToString.call(val) + "]";
1273
- }
1274
- function printBasicValue(val, printFunctionName2, escapeRegex2, escapeString) {
1275
- if (val === true || val === false) {
1276
- return "" + val;
1277
- }
1278
- if (val === void 0) {
1279
- return "undefined";
1280
- }
1281
- if (val === null) {
1282
- return "null";
1283
- }
1284
- const typeOf = typeof val;
1285
- if (typeOf === "number") {
1286
- return printNumber(val);
1287
- }
1288
- if (typeOf === "bigint") {
1289
- return printBigInt(val);
1290
- }
1291
- if (typeOf === "string") {
1292
- if (escapeString) {
1293
- return '"' + val.replace(/"|\\/g, "\\$&") + '"';
1294
- }
1295
- return '"' + val + '"';
1296
- }
1297
- if (typeOf === "function") {
1298
- return printFunction(val, printFunctionName2);
1299
- }
1300
- if (typeOf === "symbol") {
1301
- return printSymbol(val);
1302
- }
1303
- const toStringed = toString.call(val);
1304
- if (toStringed === "[object WeakMap]") {
1305
- return "WeakMap {}";
1306
- }
1307
- if (toStringed === "[object WeakSet]") {
1308
- return "WeakSet {}";
1309
- }
1310
- if (toStringed === "[object Function]" || toStringed === "[object GeneratorFunction]") {
1311
- return printFunction(val, printFunctionName2);
1312
- }
1313
- if (toStringed === "[object Symbol]") {
1314
- return printSymbol(val);
1315
- }
1316
- if (toStringed === "[object Date]") {
1317
- return isNaN(+val) ? "Date { NaN }" : toISOString.call(val);
1318
- }
1319
- if (toStringed === "[object Error]") {
1320
- return printError(val);
1321
- }
1322
- if (toStringed === "[object RegExp]") {
1323
- if (escapeRegex2) {
1324
- return regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g, "\\$&");
1325
- }
1326
- return regExpToString.call(val);
1327
- }
1328
- if (val instanceof Error) {
1329
- return printError(val);
1330
- }
1331
- return null;
1332
- }
1333
- function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
1334
- if (refs.indexOf(val) !== -1) {
1335
- return "[Circular]";
1336
- }
1337
- refs = refs.slice();
1338
- refs.push(val);
1339
- const hitMaxDepth = ++depth > config.maxDepth;
1340
- const min = config.min;
1341
- if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === "function" && !hasCalledToJSON) {
1342
- return printer(val.toJSON(), config, indentation, depth, refs, true);
1343
- }
1344
- const toStringed = toString.call(val);
1345
- if (toStringed === "[object Arguments]") {
1346
- return hitMaxDepth ? "[Arguments]" : (min ? "" : "Arguments ") + "[" + (0, _collections.printListItems)(val, config, indentation, depth, refs, printer) + "]";
1347
- }
1348
- if (isToStringedArrayType(toStringed)) {
1349
- return hitMaxDepth ? "[" + val.constructor.name + "]" : (min ? "" : !config.printBasicPrototype && val.constructor.name === "Array" ? "" : val.constructor.name + " ") + "[" + (0, _collections.printListItems)(val, config, indentation, depth, refs, printer) + "]";
1350
- }
1351
- if (toStringed === "[object Map]") {
1352
- return hitMaxDepth ? "[Map]" : "Map {" + (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer, " => ") + "}";
1353
- }
1354
- if (toStringed === "[object Set]") {
1355
- return hitMaxDepth ? "[Set]" : "Set {" + (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + "}";
1356
- }
1357
- return hitMaxDepth || isWindow(val) ? "[" + getConstructorName(val) + "]" : (min ? "" : !config.printBasicPrototype && getConstructorName(val) === "Object" ? "" : getConstructorName(val) + " ") + "{" + (0, _collections.printObjectProperties)(val, config, indentation, depth, refs, printer) + "}";
1358
- }
1359
- function isNewPlugin(plugin) {
1360
- return plugin.serialize != null;
1361
- }
1362
- function printPlugin(plugin, val, config, indentation, depth, refs) {
1363
- let printed;
1364
- try {
1365
- printed = isNewPlugin(plugin) ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, (valChild) => printer(valChild, config, indentation, depth, refs), (str) => {
1366
- const indentationNext = indentation + config.indent;
1367
- return indentationNext + str.replace(NEWLINE_REGEXP, "\n" + indentationNext);
1368
- }, {
1369
- edgeSpacing: config.spacingOuter,
1370
- min: config.min,
1371
- spacing: config.spacingInner
1372
- }, config.colors);
1373
- } catch (error) {
1374
- throw new PrettyFormatPluginError(error.message, error.stack);
1375
- }
1376
- if (typeof printed !== "string") {
1377
- throw new Error(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);
1378
- }
1379
- return printed;
1380
- }
1381
- function findPlugin(plugins2, val) {
1382
- for (let p = 0; p < plugins2.length; p++) {
1383
- try {
1384
- if (plugins2[p].test(val)) {
1385
- return plugins2[p];
1386
- }
1387
- } catch (error) {
1388
- throw new PrettyFormatPluginError(error.message, error.stack);
1389
- }
1390
- }
1391
- return null;
1392
- }
1393
- function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
1394
- const plugin = findPlugin(config.plugins, val);
1395
- if (plugin !== null) {
1396
- return printPlugin(plugin, val, config, indentation, depth, refs);
1397
- }
1398
- const basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);
1399
- if (basicResult !== null) {
1400
- return basicResult;
1401
- }
1402
- return printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
1403
- }
1404
- var DEFAULT_THEME = {
1405
- comment: "gray",
1406
- content: "reset",
1407
- prop: "yellow",
1408
- tag: "cyan",
1409
- value: "green"
1410
- };
1411
- var DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);
1412
- var DEFAULT_OPTIONS = {
1413
- callToJSON: true,
1414
- compareKeys: void 0,
1415
- escapeRegex: false,
1416
- escapeString: true,
1417
- highlight: false,
1418
- indent: 2,
1419
- maxDepth: Infinity,
1420
- min: false,
1421
- plugins: [],
1422
- printBasicPrototype: true,
1423
- printFunctionName: true,
1424
- theme: DEFAULT_THEME
1425
- };
1426
- exports.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
1427
- function validateOptions(options) {
1428
- Object.keys(options).forEach((key) => {
1429
- if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {
1430
- throw new Error(`pretty-format: Unknown option "${key}".`);
1431
- }
1432
- });
1433
- if (options.min && options.indent !== void 0 && options.indent !== 0) {
1434
- throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
1435
- }
1436
- if (options.theme !== void 0) {
1437
- if (options.theme === null) {
1438
- throw new Error(`pretty-format: Option "theme" must not be null.`);
1439
- }
1440
- if (typeof options.theme !== "object") {
1441
- throw new Error(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof options.theme}".`);
1442
- }
1443
- }
1444
- }
1445
- var getColorsHighlight = (options) => DEFAULT_THEME_KEYS.reduce((colors, key) => {
1446
- const value = options.theme && options.theme[key] !== void 0 ? options.theme[key] : DEFAULT_THEME[key];
1447
- const color = value && _ansiStyles.default[value];
1448
- if (color && typeof color.close === "string" && typeof color.open === "string") {
1449
- colors[key] = color;
1450
- } else {
1451
- throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);
1452
- }
1453
- return colors;
1454
- }, Object.create(null));
1455
- var getColorsEmpty = () => DEFAULT_THEME_KEYS.reduce((colors, key) => {
1456
- colors[key] = {
1457
- close: "",
1458
- open: ""
1459
- };
1460
- return colors;
1461
- }, Object.create(null));
1462
- var getPrintFunctionName = (options) => options && options.printFunctionName !== void 0 ? options.printFunctionName : DEFAULT_OPTIONS.printFunctionName;
1463
- var getEscapeRegex = (options) => options && options.escapeRegex !== void 0 ? options.escapeRegex : DEFAULT_OPTIONS.escapeRegex;
1464
- var getEscapeString = (options) => options && options.escapeString !== void 0 ? options.escapeString : DEFAULT_OPTIONS.escapeString;
1465
- var getConfig = (options) => {
1466
- var _options$printBasicPr;
1467
- return {
1468
- callToJSON: options && options.callToJSON !== void 0 ? options.callToJSON : DEFAULT_OPTIONS.callToJSON,
1469
- colors: options && options.highlight ? getColorsHighlight(options) : getColorsEmpty(),
1470
- compareKeys: options && typeof options.compareKeys === "function" ? options.compareKeys : DEFAULT_OPTIONS.compareKeys,
1471
- escapeRegex: getEscapeRegex(options),
1472
- escapeString: getEscapeString(options),
1473
- indent: options && options.min ? "" : createIndent(options && options.indent !== void 0 ? options.indent : DEFAULT_OPTIONS.indent),
1474
- maxDepth: options && options.maxDepth !== void 0 ? options.maxDepth : DEFAULT_OPTIONS.maxDepth,
1475
- min: options && options.min !== void 0 ? options.min : DEFAULT_OPTIONS.min,
1476
- plugins: options && options.plugins !== void 0 ? options.plugins : DEFAULT_OPTIONS.plugins,
1477
- printBasicPrototype: (_options$printBasicPr = options === null || options === void 0 ? void 0 : options.printBasicPrototype) !== null && _options$printBasicPr !== void 0 ? _options$printBasicPr : true,
1478
- printFunctionName: getPrintFunctionName(options),
1479
- spacingInner: options && options.min ? " " : "\n",
1480
- spacingOuter: options && options.min ? "" : "\n"
1481
- };
1482
- };
1483
- function createIndent(indent) {
1484
- return new Array(indent + 1).join(" ");
1485
- }
1486
- function format(val, options) {
1487
- if (options) {
1488
- validateOptions(options);
1489
- if (options.plugins) {
1490
- const plugin = findPlugin(options.plugins, val);
1491
- if (plugin !== null) {
1492
- return printPlugin(plugin, val, getConfig(options), "", 0, []);
1493
- }
1494
- }
1495
- }
1496
- const basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));
1497
- if (basicResult !== null) {
1498
- return basicResult;
1499
- }
1500
- return printComplexValue(val, getConfig(options), "", 0, []);
1501
- }
1502
- var plugins = {
1503
- AsymmetricMatcher: _AsymmetricMatcher.default,
1504
- ConvertAnsi: _ConvertAnsi.default,
1505
- DOMCollection: _DOMCollection.default,
1506
- DOMElement: _DOMElement.default,
1507
- Immutable: _Immutable.default,
1508
- ReactElement: _ReactElement.default,
1509
- ReactTestComponent: _ReactTestComponent.default
1510
- };
1511
- exports.plugins = plugins;
1512
- var _default = format;
1513
- exports.default = _default;
1514
- }
1515
- });
1516
-
1517
- // src/runtime/entry.ts
1518
- init_esm_shims();
1519
-
1520
- // src/runtime/env.ts
1521
- init_esm_shims();
1522
-
1523
- // src/env/index.ts
1524
- init_esm_shims();
1525
-
1526
- // src/env/node.ts
1527
- init_esm_shims();
1528
- var node_default = {
1529
- name: "node",
1530
- async setup() {
1531
- return {
1532
- teardown() {
1533
- }
1534
- };
1535
- }
1536
- };
1537
-
1538
- // src/env/jsdom.ts
1539
- init_esm_shims();
1540
-
1541
- // src/env/jsdom-keys.ts
1542
- init_esm_shims();
1543
- var LIVING_KEYS = [
1544
- "DOMException",
1545
- "URL",
1546
- "URLSearchParams",
1547
- "EventTarget",
1548
- "NamedNodeMap",
1549
- "Node",
1550
- "Attr",
1551
- "Element",
1552
- "DocumentFragment",
1553
- "DOMImplementation",
1554
- "Document",
1555
- "XMLDocument",
1556
- "CharacterData",
1557
- "Text",
1558
- "CDATASection",
1559
- "ProcessingInstruction",
1560
- "Comment",
1561
- "DocumentType",
1562
- "NodeList",
1563
- "HTMLCollection",
1564
- "HTMLOptionsCollection",
1565
- "DOMStringMap",
1566
- "DOMTokenList",
1567
- "StyleSheetList",
1568
- "HTMLElement",
1569
- "HTMLHeadElement",
1570
- "HTMLTitleElement",
1571
- "HTMLBaseElement",
1572
- "HTMLLinkElement",
1573
- "HTMLMetaElement",
1574
- "HTMLStyleElement",
1575
- "HTMLBodyElement",
1576
- "HTMLHeadingElement",
1577
- "HTMLParagraphElement",
1578
- "HTMLHRElement",
1579
- "HTMLPreElement",
1580
- "HTMLUListElement",
1581
- "HTMLOListElement",
1582
- "HTMLLIElement",
1583
- "HTMLMenuElement",
1584
- "HTMLDListElement",
1585
- "HTMLDivElement",
1586
- "HTMLAnchorElement",
1587
- "HTMLAreaElement",
1588
- "HTMLBRElement",
1589
- "HTMLButtonElement",
1590
- "HTMLCanvasElement",
1591
- "HTMLDataElement",
1592
- "HTMLDataListElement",
1593
- "HTMLDetailsElement",
1594
- "HTMLDialogElement",
1595
- "HTMLDirectoryElement",
1596
- "HTMLFieldSetElement",
1597
- "HTMLFontElement",
1598
- "HTMLFormElement",
1599
- "HTMLHtmlElement",
1600
- "HTMLImageElement",
1601
- "HTMLInputElement",
1602
- "HTMLLabelElement",
1603
- "HTMLLegendElement",
1604
- "HTMLMapElement",
1605
- "HTMLMarqueeElement",
1606
- "HTMLMediaElement",
1607
- "HTMLMeterElement",
1608
- "HTMLModElement",
1609
- "HTMLOptGroupElement",
1610
- "HTMLOptionElement",
1611
- "HTMLOutputElement",
1612
- "HTMLPictureElement",
1613
- "HTMLProgressElement",
1614
- "HTMLQuoteElement",
1615
- "HTMLScriptElement",
1616
- "HTMLSelectElement",
1617
- "HTMLSlotElement",
1618
- "HTMLSourceElement",
1619
- "HTMLSpanElement",
1620
- "HTMLTableCaptionElement",
1621
- "HTMLTableCellElement",
1622
- "HTMLTableColElement",
1623
- "HTMLTableElement",
1624
- "HTMLTimeElement",
1625
- "HTMLTableRowElement",
1626
- "HTMLTableSectionElement",
1627
- "HTMLTemplateElement",
1628
- "HTMLTextAreaElement",
1629
- "HTMLUnknownElement",
1630
- "HTMLFrameElement",
1631
- "HTMLFrameSetElement",
1632
- "HTMLIFrameElement",
1633
- "HTMLEmbedElement",
1634
- "HTMLObjectElement",
1635
- "HTMLParamElement",
1636
- "HTMLVideoElement",
1637
- "HTMLAudioElement",
1638
- "HTMLTrackElement",
1639
- "SVGElement",
1640
- "SVGGraphicsElement",
1641
- "SVGSVGElement",
1642
- "SVGTitleElement",
1643
- "SVGAnimatedString",
1644
- "SVGNumber",
1645
- "SVGStringList",
1646
- "Event",
1647
- "CloseEvent",
1648
- "CustomEvent",
1649
- "MessageEvent",
1650
- "ErrorEvent",
1651
- "HashChangeEvent",
1652
- "PopStateEvent",
1653
- "StorageEvent",
1654
- "ProgressEvent",
1655
- "PageTransitionEvent",
1656
- "UIEvent",
1657
- "FocusEvent",
1658
- "InputEvent",
1659
- "MouseEvent",
1660
- "KeyboardEvent",
1661
- "TouchEvent",
1662
- "CompositionEvent",
1663
- "WheelEvent",
1664
- "BarProp",
1665
- "External",
1666
- "Location",
1667
- "History",
1668
- "Screen",
1669
- "Performance",
1670
- "Navigator",
1671
- "PluginArray",
1672
- "MimeTypeArray",
1673
- "Plugin",
1674
- "MimeType",
1675
- "FileReader",
1676
- "Blob",
1677
- "File",
1678
- "FileList",
1679
- "ValidityState",
1680
- "DOMParser",
1681
- "XMLSerializer",
1682
- "FormData",
1683
- "XMLHttpRequestEventTarget",
1684
- "XMLHttpRequestUpload",
1685
- "XMLHttpRequest",
1686
- "WebSocket",
1687
- "NodeFilter",
1688
- "NodeIterator",
1689
- "TreeWalker",
1690
- "AbstractRange",
1691
- "Range",
1692
- "StaticRange",
1693
- "Selection",
1694
- "Storage",
1695
- "CustomElementRegistry",
1696
- "ShadowRoot",
1697
- "MutationObserver",
1698
- "MutationRecord",
1699
- "Headers",
1700
- "AbortController",
1701
- "AbortSignal"
1702
- ];
1703
- var OTHER_KEYS = [
1704
- "addEventListener",
1705
- "alert",
1706
- "atob",
1707
- "blur",
1708
- "btoa",
1709
- "close",
1710
- "confirm",
1711
- "createPopup",
1712
- "dispatchEvent",
1713
- "document",
1714
- "focus",
1715
- "frames",
1716
- "getComputedStyle",
1717
- "history",
1718
- "innerHeight",
1719
- "innerWidth",
1720
- "length",
1721
- "location",
1722
- "moveBy",
1723
- "moveTo",
1724
- "name",
1725
- "navigator",
1726
- "open",
1727
- "outerHeight",
1728
- "outerWidth",
1729
- "pageXOffset",
1730
- "pageYOffset",
1731
- "parent",
1732
- "postMessage",
1733
- "print",
1734
- "prompt",
1735
- "removeEventListener",
1736
- "resizeBy",
1737
- "resizeTo",
1738
- "screen",
1739
- "screenLeft",
1740
- "screenTop",
1741
- "screenX",
1742
- "screenY",
1743
- "scroll",
1744
- "scrollBy",
1745
- "scrollLeft",
1746
- "scrollTo",
1747
- "scrollTop",
1748
- "scrollX",
1749
- "scrollY",
1750
- "self",
1751
- "stop",
1752
- "top",
1753
- "window"
1754
- ];
1755
- var KEYS = LIVING_KEYS.concat(OTHER_KEYS);
1756
-
1757
- // src/env/jsdom.ts
1758
- var jsdom_default = {
1759
- name: "jsdom",
1760
- async setup(global) {
1761
- const { JSDOM } = await import("jsdom");
1762
- const dom = new JSDOM("<!DOCTYPE html>", {
1763
- pretendToBeVisual: true,
1764
- runScripts: "dangerously",
1765
- url: "http://localhost:3000"
1766
- });
1767
- const keys = KEYS.concat(Object.getOwnPropertyNames(dom.window)).filter((k) => !k.startsWith("_")).filter((k) => !(k in global));
1768
- for (const key of keys)
1769
- global[key] = dom.window[key];
1770
- return {
1771
- teardown(global2) {
1772
- keys.forEach((key) => delete global2[key]);
1773
- }
1774
- };
1775
- }
1776
- };
1777
-
1778
- // src/env/happy-dom.ts
1779
- init_esm_shims();
1780
- var happy_dom_default = {
1781
- name: "happy-dom",
1782
- async setup(global) {
1783
- const { Window } = await import("happy-dom");
1784
- const win = new Window();
1785
- const keys = KEYS.concat(Object.getOwnPropertyNames(win)).filter((k) => !k.startsWith("_")).filter((k) => !(k in global));
1786
- for (const key of keys)
1787
- global[key] = win[key];
1788
- return {
1789
- teardown(global2) {
1790
- win.happyDOM.cancelAsync();
1791
- keys.forEach((key) => delete global2[key]);
1792
- }
1793
- };
1794
- }
1795
- };
1796
-
1797
- // src/env/index.ts
1798
- var environments = {
1799
- node: node_default,
1800
- jsdom: jsdom_default,
1801
- "happy-dom": happy_dom_default
1802
- };
1803
-
1804
- // src/integrations/chai/setup.ts
1805
- init_esm_shims();
1806
- import chai from "chai";
1807
- import SinonChai from "sinon-chai";
1808
- import Subset from "chai-subset";
1809
-
1810
- // src/integrations/snapshot/chai.ts
1811
- init_esm_shims();
1812
-
1813
- // src/integrations/snapshot/client.ts
1814
- init_esm_shims();
1815
- import path2 from "path";
1816
- import { expect } from "chai";
1817
-
1818
- // src/runtime/rpc.ts
1819
- init_esm_shims();
1820
- var rpc = async (method, ...args) => {
1821
- var _a;
1822
- return (_a = process.__vitest_worker__) == null ? void 0 : _a.rpc(method, ...args);
1823
- };
1824
- var send = async (method, ...args) => {
1825
- var _a;
1826
- return (_a = process.__vitest_worker__) == null ? void 0 : _a.send(method, ...args);
1827
- };
1828
-
1829
- // src/integrations/snapshot/port/state.ts
1830
- init_esm_shims();
1831
- import fs2 from "fs";
1832
-
1833
- // src/integrations/snapshot/port/utils.ts
1834
- init_esm_shims();
1835
- var import_natural_compare = __toModule(require_natural_compare());
1836
- var import_pretty_format2 = __toModule(require_build());
1837
- import path from "path";
1838
- import fs from "fs";
1839
-
1840
- // src/integrations/snapshot/port/plugins.ts
1841
- init_esm_shims();
1842
- var import_pretty_format = __toModule(require_build());
1843
- var {
1844
- DOMCollection,
1845
- DOMElement,
1846
- Immutable,
1847
- ReactElement,
1848
- ReactTestComponent,
1849
- AsymmetricMatcher
1850
- } = import_pretty_format.plugins;
1851
- var PLUGINS = [
1852
- ReactTestComponent,
1853
- ReactElement,
1854
- DOMElement,
1855
- DOMCollection,
1856
- Immutable,
1857
- AsymmetricMatcher
1858
- ];
1859
- var getSerializers = () => PLUGINS;
1860
-
1861
- // src/integrations/snapshot/port/utils.ts
1862
- var SNAPSHOT_VERSION = "1";
1863
- var writeSnapshotVersion = () => `// Vitest Snapshot v${SNAPSHOT_VERSION}`;
1864
- var testNameToKey = (testName, count) => `${testName} ${count}`;
1865
- var keyToTestName = (key) => {
1866
- if (!/ \d+$/.test(key))
1867
- throw new Error("Snapshot keys must end with a number.");
1868
- return key.replace(/ \d+$/, "");
1869
- };
1870
- var getSnapshotData = (snapshotPath, update) => {
1871
- const data = Object.create(null);
1872
- let snapshotContents = "";
1873
- let dirty = false;
1874
- if (fs.existsSync(snapshotPath)) {
1875
- try {
1876
- snapshotContents = fs.readFileSync(snapshotPath, "utf8");
1877
- const populate = new Function("exports", snapshotContents);
1878
- populate(data);
1879
- } catch {
1880
- }
1881
- }
1882
- const isInvalid = snapshotContents;
1883
- if ((update === "all" || update === "new") && isInvalid)
1884
- dirty = true;
1885
- return { data, dirty };
1886
- };
1887
- var addExtraLineBreaks = (string) => string.includes("\n") ? `
1888
- ${string}
1889
- ` : string;
1890
- var removeExtraLineBreaks = (string) => string.length > 2 && string.startsWith("\n") && string.endsWith("\n") ? string.slice(1, -1) : string;
1891
- var escapeRegex = true;
1892
- var printFunctionName = false;
1893
- function serialize(val, indent = 2, formatOverrides = {}) {
1894
- return normalizeNewlines((0, import_pretty_format2.format)(val, __spreadValues({
1895
- escapeRegex,
1896
- indent,
1897
- plugins: getSerializers(),
1898
- printFunctionName
1899
- }, formatOverrides)));
1900
- }
1901
- function escapeBacktickString(str) {
1902
- return str.replace(/`|\\|\${/g, "\\$&");
1903
- }
1904
- function printBacktickString(str) {
1905
- return `\`${escapeBacktickString(str)}\``;
1906
- }
1907
- function ensureDirectoryExists(filePath) {
1908
- try {
1909
- fs.mkdirSync(path.join(path.dirname(filePath)), { recursive: true });
1910
- } catch {
1911
- }
1912
- }
1913
- function normalizeNewlines(string) {
1914
- return string.replace(/\r\n|\r/g, "\n");
1915
- }
1916
- function saveSnapshotFile(snapshotData, snapshotPath) {
1917
- const snapshots = Object.keys(snapshotData).sort(import_natural_compare.default).map((key) => `exports[${printBacktickString(key)}] = ${printBacktickString(normalizeNewlines(snapshotData[key]))};`);
1918
- ensureDirectoryExists(snapshotPath);
1919
- fs.writeFileSync(snapshotPath, `${writeSnapshotVersion()}
1920
-
1921
- ${snapshots.join("\n\n")}
1922
- `);
1923
- }
1924
-
1925
- // src/integrations/snapshot/port/state.ts
1926
- var SnapshotState = class {
1927
- _counters;
1928
- _dirty;
1929
- _index;
1930
- _updateSnapshot;
1931
- _snapshotData;
1932
- _initialData;
1933
- _snapshotPath;
1934
- _uncheckedKeys;
1935
- _snapshotFormat;
1936
- added;
1937
- expand;
1938
- matched;
1939
- unmatched;
1940
- updated;
1941
- constructor(snapshotPath, options) {
1942
- this._snapshotPath = snapshotPath;
1943
- const { data, dirty } = getSnapshotData(this._snapshotPath, options.updateSnapshot);
1944
- this._initialData = data;
1945
- this._snapshotData = data;
1946
- this._dirty = dirty;
1947
- this._uncheckedKeys = new Set(Object.keys(this._snapshotData));
1948
- this._counters = /* @__PURE__ */ new Map();
1949
- this._index = 0;
1950
- this.expand = options.expand || false;
1951
- this.added = 0;
1952
- this.matched = 0;
1953
- this.unmatched = 0;
1954
- this._updateSnapshot = options.updateSnapshot;
1955
- this.updated = 0;
1956
- this._snapshotFormat = options.snapshotFormat || {};
1957
- }
1958
- markSnapshotsAsCheckedForTest(testName) {
1959
- this._uncheckedKeys.forEach((uncheckedKey) => {
1960
- if (keyToTestName(uncheckedKey) === testName)
1961
- this._uncheckedKeys.delete(uncheckedKey);
1962
- });
1963
- }
1964
- _addSnapshot(key, receivedSerialized, options) {
1965
- this._dirty = true;
1966
- this._snapshotData[key] = receivedSerialized;
1967
- }
1968
- clear() {
1969
- this._snapshotData = this._initialData;
1970
- this._counters = /* @__PURE__ */ new Map();
1971
- this._index = 0;
1972
- this.added = 0;
1973
- this.matched = 0;
1974
- this.unmatched = 0;
1975
- this.updated = 0;
1976
- }
1977
- save() {
1978
- const hasExternalSnapshots = Object.keys(this._snapshotData).length;
1979
- const isEmpty = !hasExternalSnapshots;
1980
- const status = {
1981
- deleted: false,
1982
- saved: false
1983
- };
1984
- if ((this._dirty || this._uncheckedKeys.size) && !isEmpty) {
1985
- if (hasExternalSnapshots)
1986
- saveSnapshotFile(this._snapshotData, this._snapshotPath);
1987
- status.saved = true;
1988
- } else if (!hasExternalSnapshots && fs2.existsSync(this._snapshotPath)) {
1989
- if (this._updateSnapshot === "all")
1990
- fs2.unlinkSync(this._snapshotPath);
1991
- status.deleted = true;
1992
- }
1993
- return status;
1994
- }
1995
- getUncheckedCount() {
1996
- return this._uncheckedKeys.size || 0;
1997
- }
1998
- getUncheckedKeys() {
1999
- return Array.from(this._uncheckedKeys);
2000
- }
2001
- removeUncheckedKeys() {
2002
- if (this._updateSnapshot === "all" && this._uncheckedKeys.size) {
2003
- this._dirty = true;
2004
- this._uncheckedKeys.forEach((key) => delete this._snapshotData[key]);
2005
- this._uncheckedKeys.clear();
2006
- }
2007
- }
2008
- match({
2009
- testName,
2010
- received,
2011
- key,
2012
- inlineSnapshot,
2013
- isInline,
2014
- error
2015
- }) {
2016
- this._counters.set(testName, (this._counters.get(testName) || 0) + 1);
2017
- const count = Number(this._counters.get(testName));
2018
- if (!key)
2019
- key = testNameToKey(testName, count);
2020
- if (!(isInline && this._snapshotData[key] !== void 0))
2021
- this._uncheckedKeys.delete(key);
2022
- const receivedSerialized = addExtraLineBreaks(serialize(received, void 0, this._snapshotFormat));
2023
- const expected = isInline ? inlineSnapshot : this._snapshotData[key];
2024
- const pass = expected === receivedSerialized;
2025
- const hasSnapshot = expected !== void 0;
2026
- const snapshotIsPersisted = isInline || fs2.existsSync(this._snapshotPath);
2027
- if (pass && !isInline) {
2028
- this._snapshotData[key] = receivedSerialized;
2029
- }
2030
- if (hasSnapshot && this._updateSnapshot === "all" || (!hasSnapshot || !snapshotIsPersisted) && (this._updateSnapshot === "new" || this._updateSnapshot === "all")) {
2031
- if (this._updateSnapshot === "all") {
2032
- if (!pass) {
2033
- if (hasSnapshot)
2034
- this.updated++;
2035
- else
2036
- this.added++;
2037
- this._addSnapshot(key, receivedSerialized, { error, isInline });
2038
- } else {
2039
- this.matched++;
2040
- }
2041
- } else {
2042
- this._addSnapshot(key, receivedSerialized, { error, isInline });
2043
- this.added++;
2044
- }
2045
- return {
2046
- actual: "",
2047
- count,
2048
- expected: "",
2049
- key,
2050
- pass: true
2051
- };
2052
- } else {
2053
- if (!pass) {
2054
- this.unmatched++;
2055
- return {
2056
- actual: removeExtraLineBreaks(receivedSerialized),
2057
- count,
2058
- expected: expected !== void 0 ? removeExtraLineBreaks(expected) : void 0,
2059
- key,
2060
- pass: false
2061
- };
2062
- } else {
2063
- this.matched++;
2064
- return {
2065
- actual: "",
2066
- count,
2067
- expected: "",
2068
- key,
2069
- pass: true
2070
- };
2071
- }
2072
- }
2073
- }
2074
- fail(testName, _received, key) {
2075
- this._counters.set(testName, (this._counters.get(testName) || 0) + 1);
2076
- const count = Number(this._counters.get(testName));
2077
- if (!key)
2078
- key = testNameToKey(testName, count);
2079
- this._uncheckedKeys.delete(key);
2080
- this.unmatched++;
2081
- return key;
2082
- }
2083
- };
2084
-
2085
- // src/integrations/snapshot/client.ts
2086
- var resolveSnapshotPath = (testPath) => path2.join(path2.join(path2.dirname(testPath), "__snapshots__"), `${path2.basename(testPath)}.snap`);
2087
- var SnapshotClient = class {
2088
- test;
2089
- testFile = "";
2090
- snapshotState;
2091
- setTest(test) {
2092
- this.test = test;
2093
- if (this.testFile !== this.test.file.filepath) {
2094
- if (this.snapshotState)
2095
- this.saveSnap();
2096
- this.testFile = this.test.file.filepath;
2097
- this.snapshotState = new SnapshotState(resolveSnapshotPath(this.testFile), process.__vitest_worker__.config.snapshotOptions);
2098
- }
2099
- }
2100
- clearTest() {
2101
- this.test = void 0;
2102
- }
2103
- assert(received, message) {
2104
- if (!this.test)
2105
- throw new Error("Snapshot can't not be used outside of test");
2106
- const { actual, expected, key, pass } = this.snapshotState.match({
2107
- testName: getNames(this.test).slice(1).join(" > "),
2108
- received,
2109
- isInline: false
2110
- });
2111
- if (!pass) {
2112
- expect(actual.trim()).equals(expected ? expected.trim() : "", message || `Snapshot name: \`${key}\``);
2113
- }
2114
- }
2115
- async saveSnap() {
2116
- if (!this.testFile || !this.snapshotState)
2117
- return;
2118
- const result = packSnapshotState(this.testFile, this.snapshotState);
2119
- await rpc("snapshotSaved", result);
2120
- this.testFile = "";
2121
- this.snapshotState = void 0;
2122
- }
2123
- };
2124
-
2125
- // src/integrations/snapshot/chai.ts
2126
- var _client;
2127
- function getSnapshotClient() {
2128
- if (!_client)
2129
- _client = new SnapshotClient();
2130
- return _client;
2131
- }
2132
- function SnapshotPlugin() {
2133
- return function(chai2, utils) {
2134
- for (const key of ["matchSnapshot", "toMatchSnapshot"]) {
2135
- utils.addMethod(chai2.Assertion.prototype, key, function(message) {
2136
- const expected = utils.flag(this, "object");
2137
- getSnapshotClient().assert(expected, message);
2138
- });
2139
- }
2140
- };
2141
- }
2142
-
2143
- // src/integrations/chai/jest-expect.ts
2144
- init_esm_shims();
2145
- function JestChaiExpect() {
2146
- return (chai2, utils) => {
2147
- function def(name, fn) {
2148
- const addMethod = (n) => {
2149
- utils.addMethod(chai2.Assertion.prototype, n, fn);
2150
- };
2151
- if (Array.isArray(name))
2152
- name.forEach((n) => addMethod(n));
2153
- else
2154
- addMethod(name);
2155
- }
2156
- def("toEqual", function(expected) {
2157
- return this.eql(expected);
2158
- });
2159
- def("toStrictEqual", function(expected) {
2160
- return this.equal(expected);
2161
- });
2162
- def("toBe", function(expected) {
2163
- return this.equal(expected);
2164
- });
2165
- def("toMatchObject", function(expected) {
2166
- return this.containSubset(expected);
2167
- });
2168
- def("toMatch", function(expected) {
2169
- if (typeof expected === "string")
2170
- return this.include(expected);
2171
- else
2172
- return this.match(expected);
2173
- });
2174
- def("toContain", function(item) {
2175
- return this.contain(item);
2176
- });
2177
- def("toContainEqual", function(expected) {
2178
- const obj = utils.flag(this, "object");
2179
- const index = Array.from(obj).findIndex((item) => {
2180
- try {
2181
- chai2.assert.deepEqual(item, expected);
2182
- } catch {
2183
- return false;
2184
- }
2185
- return true;
2186
- });
2187
- this.assert(index !== -1, "expected #{this} to deep equally contain #{exp}", "expected #{this} to not deep equally contain #{exp}", expected);
2188
- });
2189
- def("toBeTruthy", function() {
2190
- const obj = utils.flag(this, "object");
2191
- this.assert(Boolean(obj), "expected #{this} to be truthy", "expected #{this} to not be truthy", obj);
2192
- });
2193
- def("toBeFalsy", function() {
2194
- const obj = utils.flag(this, "object");
2195
- this.assert(!obj, "expected #{this} to be falsy", "expected #{this} to not be falsy", obj);
2196
- });
2197
- def("toBeGreaterThan", function(expected) {
2198
- return this.to.greaterThan(expected);
2199
- });
2200
- def("toBeGreaterThanOrEqual", function(expected) {
2201
- return this.to.greaterThanOrEqual(expected);
2202
- });
2203
- def("toBeLessThan", function(expected) {
2204
- return this.to.lessThan(expected);
2205
- });
2206
- def("toBeLessThanOrEqual", function(expected) {
2207
- return this.to.lessThanOrEqual(expected);
2208
- });
2209
- def("toBeNaN", function() {
2210
- return this.be.NaN;
2211
- });
2212
- def("toBeUndefined", function() {
2213
- return this.be.undefined;
2214
- });
2215
- def("toBeNull", function() {
2216
- return this.be.null;
2217
- });
2218
- def("toBeDefined", function() {
2219
- return this.not.be.undefined;
2220
- });
2221
- def("toBeInstanceOf", function(obj) {
2222
- return this.instanceOf(obj);
2223
- });
2224
- def("toHaveLength", function(length) {
2225
- return this.have.length(length);
2226
- });
2227
- def("toBeCloseTo", function(number, numDigits = 2) {
2228
- utils.expectTypes(this, ["number"]);
2229
- return this.closeTo(number, numDigits);
2230
- });
2231
- function isSpy(putativeSpy) {
2232
- return typeof putativeSpy === "function" && typeof putativeSpy.getCall === "function" && typeof putativeSpy.calledWithExactly === "function";
2233
- }
2234
- function isCall(putativeCall) {
2235
- return putativeCall && isSpy(putativeCall.proxy);
2236
- }
2237
- const assertIsMock = (assertion) => {
2238
- if (!isSpy(assertion._obj) && !isCall(assertion._obj))
2239
- throw new TypeError(`${utils.inspect(assertion._obj)} is not a spy or a call to a spy!`);
2240
- };
2241
- def(["toHaveBeenCalledTimes", "toBeCalledTimes"], function(number) {
2242
- assertIsMock(this);
2243
- return this.callCount(number);
2244
- });
2245
- def("toHaveBeenCalledOnce", function() {
2246
- assertIsMock(this);
2247
- return this.callCount(1);
2248
- });
2249
- def(["toHaveBeenCalled", "toBeCalled"], function() {
2250
- assertIsMock(this);
2251
- return this.called;
2252
- });
2253
- def(["toHaveBeenCalledWith", "toBeCalledWith"], function(...args) {
2254
- assertIsMock(this);
2255
- return this.calledWith(...args);
2256
- });
2257
- const ordinalOf = (i) => {
2258
- const j = i % 10;
2259
- const k = i % 100;
2260
- if (j === 1 && k !== 11)
2261
- return `${i}st`;
2262
- if (j === 2 && k !== 12)
2263
- return `${i}nd`;
2264
- if (j === 3 && k !== 13)
2265
- return `${i}rd`;
2266
- return `${i}th`;
2267
- };
2268
- def(["toHaveBeenNthCalledWith", "nthCalledWith"], function(times, ...args) {
2269
- assertIsMock(this);
2270
- const spy = utils.flag(this, "object");
2271
- const nthCall = spy.getCall(times - 1);
2272
- this.assert(nthCall.calledWith(...args), `expected ${ordinalOf(times)} spy call to have been called with #{exp}`, `expected ${ordinalOf(times)} spy call not to have been called with #{exp}`, args, nthCall.args);
2273
- });
2274
- def(["toHaveBeenLastCalledWith", "lastCalledWith"], function(...args) {
2275
- assertIsMock(this);
2276
- const spy = utils.flag(this, "object");
2277
- const lastCall = spy.getCall(spy.returnValues.length - 1);
2278
- this.assert(lastCall.calledWith(...args), "expected last spy call to have been called with #{exp}", "expected last spy call not to have been called with #{exp}", args, lastCall.args);
2279
- });
2280
- def(["toThrow", "toThrowError"], function(expected) {
2281
- const negate = utils.flag(this, "negate");
2282
- if (negate)
2283
- this.not.to.throw(expected);
2284
- else
2285
- this.to.throw(expected);
2286
- });
2287
- def(["toHaveReturned", "toReturn"], function() {
2288
- assertIsMock(this);
2289
- const spy = utils.flag(this, "object");
2290
- const calledAndNotThrew = spy.called && !spy.alwaysThrew();
2291
- this.assert(calledAndNotThrew, "expected spy to be successfully called at least once", "expected spy not to be successfully called", calledAndNotThrew, !calledAndNotThrew);
2292
- });
2293
- def(["toHaveReturnedTimes", "toReturnTimes"], function(times) {
2294
- assertIsMock(this);
2295
- const spy = utils.flag(this, "object");
2296
- const successfullReturns = spy.getCalls().reduce((success, call) => call.threw() ? success : ++success, 0);
2297
- this.assert(successfullReturns === times, `expected spy to be successfully called ${times} times`, `expected spy not to be successfully called ${times} times`, `expected number of returns: ${times}`, `recieved number of returns: ${successfullReturns}`);
2298
- });
2299
- def(["toHaveReturnedWith", "toReturnWith"], function(value) {
2300
- assertIsMock(this);
2301
- return this.returned(value);
2302
- });
2303
- def(["toHaveLastReturnedWith", "lastReturnedWith"], function(value) {
2304
- assertIsMock(this);
2305
- const spy = utils.flag(this, "object");
2306
- const lastReturn = spy.lastCall.returned(value);
2307
- this.assert(lastReturn, "expected last spy call to return #{exp}", "expected last spy call not to return #{exp}", value, spy.lastCall.returnValue);
2308
- });
2309
- def(["toHaveNthReturnedWith", "nthReturnedWith"], function(nthCall, value) {
2310
- assertIsMock(this);
2311
- const spy = utils.flag(this, "object");
2312
- const isNot = utils.flag(this, "negate");
2313
- const call = spy.getCall(nthCall - 1);
2314
- const ordinalCall = `${ordinalOf(nthCall)} call`;
2315
- if (!isNot && call.threw())
2316
- chai2.assert.fail(`expected ${ordinalCall} to return #{exp}, but instead it threw an error`);
2317
- const nthCallReturn = call.returned(value);
2318
- this.assert(nthCallReturn, `expected ${ordinalCall} spy call to return #{exp}`, `expected ${ordinalCall} spy call not to return #{exp}`, value, call.returnValue);
2319
- });
2320
- };
2321
- }
2322
-
2323
- // src/integrations/chai/setup.ts
2324
- var installed = false;
2325
- async function setupChai() {
2326
- if (installed)
2327
- return;
2328
- chai.use(SinonChai);
2329
- chai.use(JestChaiExpect());
2330
- chai.use(Subset);
2331
- chai.use(SnapshotPlugin());
2332
- installed = true;
2333
- }
2334
-
2335
- // src/runtime/env.ts
2336
- async function setupGlobalEnv(config) {
2337
- await setupChai();
2338
- if (config.global)
2339
- (await import("../global-OS2VOPCA.js")).registerApiGlobally();
2340
- }
2341
- async function withEnv(name, fn) {
2342
- const env = await environments[name].setup(globalThis);
2343
- try {
2344
- await fn();
2345
- } finally {
2346
- await env.teardown(globalThis);
2347
- }
2348
- }
2349
-
2350
- // src/runtime/run.ts
2351
- init_esm_shims();
2352
- import { performance as performance2 } from "perf_hooks";
2353
-
2354
- // src/runtime/collect.ts
2355
- init_esm_shims();
2356
- import { basename } from "path";
2357
- import { performance } from "perf_hooks";
2358
-
2359
- // src/runtime/error.ts
2360
- init_esm_shims();
2361
- function processError(err) {
2362
- if (!err)
2363
- return err;
2364
- if (err.stack)
2365
- err.stackStr = String(err.stack);
2366
- if (err.name)
2367
- err.nameStr = String(err.name);
2368
- return err;
2369
- }
2370
-
2371
- // src/runtime/collect.ts
2372
- async function collectTests(paths) {
2373
- const files = [];
2374
- for (const filepath of paths) {
2375
- const file = {
2376
- id: nanoid(),
2377
- name: basename(filepath),
2378
- type: "suite",
2379
- mode: "run",
2380
- computeMode: "serial",
2381
- filepath,
2382
- tasks: []
2383
- };
2384
- setHooks(file, createSuiteHooks());
2385
- clearContext();
2386
- try {
2387
- await import(filepath);
2388
- for (const c of [defaultSuite, ...context.tasks]) {
2389
- if (c.type === "test") {
2390
- file.tasks.push(c);
2391
- } else {
2392
- const suite = await c.collect(file);
2393
- if (suite.name || suite.tasks.length)
2394
- file.tasks.push(suite);
2395
- }
2396
- }
2397
- } catch (e) {
2398
- file.result = {
2399
- start: performance.now(),
2400
- state: "fail",
2401
- error: processError(e)
2402
- };
2403
- process.stdout.write("\0");
2404
- }
2405
- files.push(file);
2406
- }
2407
- const tasks = files.reduce((tasks2, file) => tasks2.concat(file.tasks), []);
2408
- interpretOnlyMode(tasks);
2409
- tasks.forEach((i) => {
2410
- if (i.type === "suite") {
2411
- if (i.mode === "skip")
2412
- i.tasks.forEach((c) => c.mode === "run" && (c.mode = "skip"));
2413
- else
2414
- interpretOnlyMode(i.tasks);
2415
- }
2416
- });
2417
- return files;
2418
- }
2419
-
2420
- // src/runtime/run.ts
2421
- async function callHook(suite, name, args) {
2422
- await Promise.all(getHooks(suite)[name].map((fn) => fn(...args)));
2423
- }
2424
- function updateTask(task) {
2425
- return rpc("onTaskUpdate", [task.id, task.result]);
2426
- }
2427
- async function runTest(test) {
2428
- if (test.mode !== "run")
2429
- return;
2430
- test.result = {
2431
- start: performance2.now(),
2432
- state: "run"
2433
- };
2434
- updateTask(test);
2435
- getSnapshotClient().setTest(test);
2436
- try {
2437
- await callHook(test.suite, "beforeEach", [test, test.suite]);
2438
- await getFn(test)();
2439
- test.result.state = "pass";
2440
- } catch (e) {
2441
- test.result.state = "fail";
2442
- test.result.error = processError(e);
2443
- }
2444
- try {
2445
- await callHook(test.suite, "afterEach", [test, test.suite]);
2446
- } catch (e) {
2447
- test.result.state = "fail";
2448
- test.result.error = processError(e);
2449
- }
2450
- getSnapshotClient().clearTest();
2451
- test.result.end = performance2.now();
2452
- updateTask(test);
2453
- }
2454
- async function runSuite(suite) {
2455
- var _a;
2456
- if (((_a = suite.result) == null ? void 0 : _a.state) === "fail")
2457
- return;
2458
- suite.result = {
2459
- start: performance2.now(),
2460
- state: "run"
2461
- };
2462
- updateTask(suite);
2463
- if (suite.mode === "skip") {
2464
- suite.result.state = "skip";
2465
- } else if (suite.mode === "todo") {
2466
- suite.result.state = "todo";
2467
- } else {
2468
- try {
2469
- await callHook(suite, "beforeAll", [suite]);
2470
- for (const tasksGroup of partitionSuiteChildren(suite)) {
2471
- const computeMode = tasksGroup[0].computeMode;
2472
- if (computeMode === "serial") {
2473
- for (const c of tasksGroup)
2474
- await runSuiteChild(c);
2475
- } else if (computeMode === "concurrent") {
2476
- await Promise.all(tasksGroup.map((c) => runSuiteChild(c)));
2477
- }
2478
- }
2479
- await callHook(suite, "afterAll", [suite]);
2480
- } catch (e) {
2481
- suite.result.state = "fail";
2482
- suite.result.error = processError(e);
2483
- }
2484
- }
2485
- suite.result.end = performance2.now();
2486
- if (suite.mode === "run") {
2487
- if (!hasTests(suite)) {
2488
- suite.result.state = "fail";
2489
- if (!suite.result.error)
2490
- suite.result.error = new Error(`No tests found in suite ${suite.name}`);
2491
- } else if (hasFailed(suite)) {
2492
- suite.result.state = "fail";
2493
- } else {
2494
- suite.result.state = "pass";
2495
- }
2496
- }
2497
- updateTask(suite);
2498
- }
2499
- async function runSuiteChild(c) {
2500
- return c.type === "test" ? runTest(c) : runSuite(c);
2501
- }
2502
- async function runSuites(suites) {
2503
- for (const suite of suites)
2504
- await runSuite(suite);
2505
- }
2506
- async function startTests(paths) {
2507
- const files = await collectTests(paths);
2508
- send("onCollected", files);
2509
- await runSuites(files);
2510
- await getSnapshotClient().saveSnap();
2511
- }
2512
-
2513
- // src/runtime/entry.ts
2514
- async function run(files, config) {
2515
- await setupGlobalEnv(config);
2516
- await withEnv(config.environment, async () => {
2517
- await startTests(files);
2518
- });
2519
- }
2520
- export {
2521
- run
2522
- };
2523
- /*
2524
- * @version 1.4.0
2525
- * @date 2015-10-26
2526
- * @stability 3 - Stable
2527
- * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
2528
- * @license MIT License
2529
- */
2530
- /** @license React v17.0.2
2531
- * react-is.development.js
2532
- *
2533
- * Copyright (c) Facebook, Inc. and its affiliates.
2534
- *
2535
- * This source code is licensed under the MIT license found in the
2536
- * LICENSE file in the root directory of this source tree.
2537
- */
2538
- /** @license React v17.0.2
2539
- * react-is.production.min.js
2540
- *
2541
- * Copyright (c) Facebook, Inc. and its affiliates.
2542
- *
2543
- * This source code is licensed under the MIT license found in the
2544
- * LICENSE file in the root directory of this source tree.
2545
- */