@effect-uai/elevenlabs 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ElevenLabsMusicGenerator.d.mts +1 -3
- package/dist/ElevenLabsMusicGenerator.d.mts.map +1 -1
- package/dist/ElevenLabsMusicGenerator.mjs +6 -4
- package/dist/ElevenLabsMusicGenerator.mjs.map +1 -1
- package/dist/ElevenLabsMusicGenerator.test.d.mts +1 -1
- package/dist/ElevenLabsMusicGenerator.test.mjs +10 -6
- package/dist/ElevenLabsMusicGenerator.test.mjs.map +1 -1
- package/dist/ElevenLabsSynthesizer.d.mts +4 -7
- package/dist/ElevenLabsSynthesizer.d.mts.map +1 -1
- package/dist/ElevenLabsSynthesizer.mjs +1 -1
- package/dist/ElevenLabsSynthesizer.mjs.map +1 -1
- package/dist/ElevenLabsTranscriber.d.mts +5 -9
- package/dist/ElevenLabsTranscriber.d.mts.map +1 -1
- package/dist/ElevenLabsTranscriber.mjs +1 -1
- package/dist/ElevenLabsTranscriber.mjs.map +1 -1
- package/dist/ElevenLabsTranscriber.test.d.mts +1 -1
- package/dist/ElevenLabsTranscriber.test.mjs +10 -5
- package/dist/ElevenLabsTranscriber.test.mjs.map +1 -1
- package/dist/codec.d.mts +4 -6
- package/dist/codec.d.mts.map +1 -1
- package/dist/codec.mjs +1 -1
- package/dist/codec.mjs.map +1 -1
- package/dist/codec.test.d.mts +1 -1
- package/dist/codec.test.mjs +19 -13
- package/dist/codec.test.mjs.map +1 -1
- package/dist/dist-C0AvqZTC.mjs +145 -0
- package/dist/dist-C0AvqZTC.mjs.map +1 -0
- package/dist/{magic-string.es-CaWgF-3p.mjs → magic-string.es-CUAnjKYC.mjs} +14 -13
- package/dist/{magic-string.es-CaWgF-3p.mjs.map → magic-string.es-CUAnjKYC.mjs.map} +1 -1
- package/dist/models.d.mts.map +1 -1
- package/dist/{musicCodec-CZni1gAQ.d.mts → musicCodec-DjmvNC4W.d.mts} +1 -2
- package/dist/musicCodec-DjmvNC4W.d.mts.map +1 -0
- package/dist/musicCodec.d.mts +1 -1
- package/dist/musicCodec.mjs.map +1 -1
- package/dist/realtimeStt.d.mts +0 -1
- package/dist/realtimeStt.d.mts.map +1 -1
- package/dist/realtimeStt.mjs.map +1 -1
- package/dist/realtimeTts.d.mts +2 -2
- package/dist/realtimeTts.d.mts.map +1 -1
- package/dist/realtimeTts.mjs.map +1 -1
- package/dist/region.d.mts.map +1 -1
- package/dist/region.mjs.map +1 -1
- package/dist/region.test.d.mts +1 -1
- package/dist/region.test.mjs +1 -1
- package/dist/region.test.mjs.map +1 -1
- package/dist/{dist-CWoAuwS9.mjs → test.DNmyFkvJ-N3QqMRwZ.mjs} +257 -381
- package/dist/test.DNmyFkvJ-N3QqMRwZ.mjs.map +1 -0
- package/package.json +5 -5
- package/src/ElevenLabsMusicGenerator.ts +7 -10
- package/src/ElevenLabsSynthesizer.ts +10 -13
- package/src/ElevenLabsTranscriber.ts +5 -8
- package/src/realtimeStt.ts +12 -14
- package/dist/dist-CWoAuwS9.mjs.map +0 -1
- package/dist/musicCodec-CZni1gAQ.d.mts.map +0 -1
- /package/dist/{chunk-uyGKjUfl.mjs → rolldown-runtime-EAsCxrDo.mjs} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { t as __commonJSMin } from "./chunk-uyGKjUfl.mjs";
|
|
2
1
|
//#region ../../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.js
|
|
3
2
|
var b = {
|
|
4
3
|
reset: [0, 0],
|
|
@@ -82,7 +81,7 @@ function C({ force: e } = {}) {
|
|
|
82
81
|
}
|
|
83
82
|
var y = C();
|
|
84
83
|
//#endregion
|
|
85
|
-
//#region ../../../node_modules/.pnpm/@vitest+pretty-format@4.1.
|
|
84
|
+
//#region ../../../node_modules/.pnpm/@vitest+pretty-format@4.1.11/node_modules/@vitest/pretty-format/dist/index.js
|
|
86
85
|
function _mergeNamespaces(n, m) {
|
|
87
86
|
m.forEach(function(e) {
|
|
88
87
|
e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
|
|
@@ -236,7 +235,7 @@ const plugin$5 = {
|
|
|
236
235
|
test: test$5
|
|
237
236
|
};
|
|
238
237
|
const SPACE$1 = " ";
|
|
239
|
-
const OBJECT_NAMES = new Set(["DOMStringMap", "NamedNodeMap"]);
|
|
238
|
+
const OBJECT_NAMES = /* @__PURE__ */ new Set(["DOMStringMap", "NamedNodeMap"]);
|
|
240
239
|
const ARRAY_REGEXP = /^(?:HTML\w*Collection|NodeList)$/;
|
|
241
240
|
function testName(name) {
|
|
242
241
|
return OBJECT_NAMES.has(name) || ARRAY_REGEXP.test(name);
|
|
@@ -527,7 +526,7 @@ function requireReactIs$1() {
|
|
|
527
526
|
return reactIs$1.exports;
|
|
528
527
|
}
|
|
529
528
|
var reactIsExports$1 = requireReactIs$1();
|
|
530
|
-
var ReactIs19 =
|
|
529
|
+
var ReactIs19 = /*#__PURE__*/ _mergeNamespaces({
|
|
531
530
|
__proto__: null,
|
|
532
531
|
default: /* @__PURE__ */ getDefaultExportFromCjs$2(reactIsExports$1)
|
|
533
532
|
}, [reactIsExports$1]);
|
|
@@ -639,7 +638,7 @@ function requireReactIs() {
|
|
|
639
638
|
return reactIs.exports;
|
|
640
639
|
}
|
|
641
640
|
var reactIsExports = requireReactIs();
|
|
642
|
-
var ReactIs18 =
|
|
641
|
+
var ReactIs18 = /*#__PURE__*/ _mergeNamespaces({
|
|
643
642
|
__proto__: null,
|
|
644
643
|
default: /* @__PURE__ */ getDefaultExportFromCjs$2(reactIsExports)
|
|
645
644
|
}, [reactIsExports]);
|
|
@@ -965,7 +964,7 @@ const plugins = {
|
|
|
965
964
|
Error: ErrorPlugin
|
|
966
965
|
};
|
|
967
966
|
//#endregion
|
|
968
|
-
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.
|
|
967
|
+
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.11/node_modules/@vitest/utils/dist/display.js
|
|
969
968
|
const ansiColors$1 = {
|
|
970
969
|
bold: ["1", "22"],
|
|
971
970
|
dim: ["2", "22"],
|
|
@@ -1508,18 +1507,20 @@ function objDisplay$1(obj, options = {}) {
|
|
|
1508
1507
|
if (typeof options.truncate === "undefined") options.truncate = 40;
|
|
1509
1508
|
const str = inspect$2(obj, options);
|
|
1510
1509
|
const type = Object.prototype.toString.call(obj);
|
|
1511
|
-
if (options.truncate && str.length >= options.truncate)
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1510
|
+
if (options.truncate && str.length >= options.truncate) {
|
|
1511
|
+
if (type === "[object Function]") {
|
|
1512
|
+
const fn = obj;
|
|
1513
|
+
return !fn.name ? "[Function]" : `[Function: ${fn.name}]`;
|
|
1514
|
+
} else if (type === "[object Array]") return `[ Array(${obj.length}) ]`;
|
|
1515
|
+
else if (type === "[object Object]") {
|
|
1516
|
+
const keys = Object.keys(obj);
|
|
1517
|
+
return `{ Object (${keys.length > 2 ? `${keys.splice(0, 2).join(", ")}, ...` : keys.join(", ")}) }`;
|
|
1518
|
+
} else return str;
|
|
1519
|
+
}
|
|
1519
1520
|
return str;
|
|
1520
1521
|
}
|
|
1521
1522
|
//#endregion
|
|
1522
|
-
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.
|
|
1523
|
+
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.11/node_modules/@vitest/utils/dist/helpers.js
|
|
1523
1524
|
/**
|
|
1524
1525
|
* Get original stacktrace without source map support the most performant way.
|
|
1525
1526
|
* - Create only 1 stack frame.
|
|
@@ -1553,11 +1554,13 @@ function filterOutComments(s) {
|
|
|
1553
1554
|
if (s[i] === "\n") commentState = "none";
|
|
1554
1555
|
} else if (commentState === "multiline") {
|
|
1555
1556
|
if (s[i - 1] === "*" && s[i] === "/") commentState = "none";
|
|
1556
|
-
} else if (commentState === "none")
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1557
|
+
} else if (commentState === "none") {
|
|
1558
|
+
if (s[i] === "/" && s[i + 1] === "/") commentState = "singleline";
|
|
1559
|
+
else if (s[i] === "/" && s[i + 1] === "*") {
|
|
1560
|
+
commentState = "multiline";
|
|
1561
|
+
i += 2;
|
|
1562
|
+
} else result.push(s[i]);
|
|
1563
|
+
}
|
|
1561
1564
|
return result.join("");
|
|
1562
1565
|
}
|
|
1563
1566
|
function toArray(array) {
|
|
@@ -1681,7 +1684,7 @@ function getCallLastIndex(code) {
|
|
|
1681
1684
|
}
|
|
1682
1685
|
function isNegativeNaN(val) {
|
|
1683
1686
|
if (!Number.isNaN(val)) return false;
|
|
1684
|
-
const f64 = new Float64Array(1);
|
|
1687
|
+
const f64 = /* @__PURE__ */ new Float64Array(1);
|
|
1685
1688
|
f64[0] = val;
|
|
1686
1689
|
return new Uint32Array(f64.buffer)[1] >>> 31 === 1;
|
|
1687
1690
|
}
|
|
@@ -1975,7 +1978,6 @@ function diff_cleanupMerge(diffs) {
|
|
|
1975
1978
|
count_delete = 0;
|
|
1976
1979
|
text_delete = "";
|
|
1977
1980
|
text_insert = "";
|
|
1978
|
-
break;
|
|
1979
1981
|
}
|
|
1980
1982
|
if (diffs.at(-1)?.[1] === "") diffs.pop();
|
|
1981
1983
|
let changes = false;
|
|
@@ -2335,7 +2337,7 @@ function requireBuild() {
|
|
|
2335
2337
|
}
|
|
2336
2338
|
return build;
|
|
2337
2339
|
}
|
|
2338
|
-
var diffSequences =
|
|
2340
|
+
var diffSequences = /*@__PURE__*/ getDefaultExportFromCjs$1(/* @__PURE__ */ requireBuild());
|
|
2339
2341
|
function formatTrailingSpaces(line, trailingSpaceFormatter) {
|
|
2340
2342
|
return line.replace(/\s+$/, (match) => trailingSpaceFormatter(match));
|
|
2341
2343
|
}
|
|
@@ -2365,22 +2367,24 @@ function joinAlignedDiffsNoExpand(diffs, options) {
|
|
|
2365
2367
|
while (i !== iLength) {
|
|
2366
2368
|
const iStart = i;
|
|
2367
2369
|
while (i !== iLength && diffs[i][0] === 0) i += 1;
|
|
2368
|
-
if (iStart !== i)
|
|
2369
|
-
if (
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2370
|
+
if (iStart !== i) {
|
|
2371
|
+
if (iStart === 0) {
|
|
2372
|
+
if (i > nContextLines) {
|
|
2373
|
+
jLength -= i - nContextLines;
|
|
2374
|
+
hasExcessAtStartOrEnd = true;
|
|
2375
|
+
}
|
|
2376
|
+
} else if (i === iLength) {
|
|
2377
|
+
const n = i - iStart;
|
|
2378
|
+
if (n > nContextLines) {
|
|
2379
|
+
jLength -= n - nContextLines;
|
|
2380
|
+
hasExcessAtStartOrEnd = true;
|
|
2381
|
+
}
|
|
2382
|
+
} else {
|
|
2383
|
+
const n = i - iStart;
|
|
2384
|
+
if (n > nContextLines2) {
|
|
2385
|
+
jLength -= n - nContextLines2;
|
|
2386
|
+
nExcessesBetweenChanges += 1;
|
|
2387
|
+
}
|
|
2384
2388
|
}
|
|
2385
2389
|
}
|
|
2386
2390
|
while (i !== iLength && diffs[i][0] !== 0) i += 1;
|
|
@@ -2416,33 +2420,35 @@ function joinAlignedDiffsNoExpand(diffs, options) {
|
|
|
2416
2420
|
while (i !== iLength) {
|
|
2417
2421
|
let iStart = i;
|
|
2418
2422
|
while (i !== iLength && diffs[i][0] === 0) i += 1;
|
|
2419
|
-
if (iStart !== i)
|
|
2420
|
-
if (
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
} else {
|
|
2432
|
-
const nCommon = i - iStart;
|
|
2433
|
-
if (nCommon > nContextLines2) {
|
|
2434
|
-
const iEnd = iStart + nContextLines;
|
|
2423
|
+
if (iStart !== i) {
|
|
2424
|
+
if (iStart === 0) {
|
|
2425
|
+
if (i > nContextLines) {
|
|
2426
|
+
iStart = i - nContextLines;
|
|
2427
|
+
aStart = iStart;
|
|
2428
|
+
bStart = iStart;
|
|
2429
|
+
aEnd = aStart;
|
|
2430
|
+
bEnd = bStart;
|
|
2431
|
+
}
|
|
2432
|
+
for (let iCommon = iStart; iCommon !== i; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
2433
|
+
} else if (i === iLength) {
|
|
2434
|
+
const iEnd = i - iStart > nContextLines ? iStart + nContextLines : i;
|
|
2435
2435
|
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2436
|
+
} else {
|
|
2437
|
+
const nCommon = i - iStart;
|
|
2438
|
+
if (nCommon > nContextLines2) {
|
|
2439
|
+
const iEnd = iStart + nContextLines;
|
|
2440
|
+
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
2441
|
+
lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options);
|
|
2442
|
+
jPatchMark = lines.length;
|
|
2443
|
+
lines.push("");
|
|
2444
|
+
const nOmit = nCommon - nContextLines2;
|
|
2445
|
+
aStart = aEnd + nOmit;
|
|
2446
|
+
bStart = bEnd + nOmit;
|
|
2447
|
+
aEnd = aStart;
|
|
2448
|
+
bEnd = bStart;
|
|
2449
|
+
for (let iCommon = i - nContextLines; iCommon !== i; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
2450
|
+
} else for (let iCommon = iStart; iCommon !== i; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
2451
|
+
}
|
|
2446
2452
|
}
|
|
2447
2453
|
while (i !== iLength && diffs[i][0] === -1) {
|
|
2448
2454
|
pushDeleteLine(diffs[i][1]);
|
|
@@ -2521,9 +2527,7 @@ function countChanges(diffs) {
|
|
|
2521
2527
|
case -1:
|
|
2522
2528
|
a += 1;
|
|
2523
2529
|
break;
|
|
2524
|
-
case 1:
|
|
2525
|
-
b += 1;
|
|
2526
|
-
break;
|
|
2530
|
+
case 1: b += 1;
|
|
2527
2531
|
}
|
|
2528
2532
|
});
|
|
2529
2533
|
return {
|
|
@@ -2821,13 +2825,14 @@ const FALLBACK_FORMAT_OPTIONS = {
|
|
|
2821
2825
|
maxDepth: 8,
|
|
2822
2826
|
plugins: PLUGINS$1
|
|
2823
2827
|
};
|
|
2828
|
+
const DEFAULT_MEMORIZE = (_, v) => v;
|
|
2824
2829
|
/**
|
|
2825
2830
|
* @param a Expected value
|
|
2826
2831
|
* @param b Received value
|
|
2827
2832
|
* @param options Diff options
|
|
2828
2833
|
* @returns {string | null} a string diff
|
|
2829
2834
|
*/
|
|
2830
|
-
function diff(a, b, options) {
|
|
2835
|
+
function diff(a, b, options, memorize = DEFAULT_MEMORIZE) {
|
|
2831
2836
|
if (Object.is(a, b)) return "";
|
|
2832
2837
|
const aType = getType(a);
|
|
2833
2838
|
let expectedType = aType;
|
|
@@ -2847,23 +2852,29 @@ function diff(a, b, options) {
|
|
|
2847
2852
|
function truncate(s) {
|
|
2848
2853
|
return s.length <= MAX_LENGTH ? s : `${s.slice(0, MAX_LENGTH)}...`;
|
|
2849
2854
|
}
|
|
2850
|
-
aDisplay = truncate(aDisplay);
|
|
2851
|
-
bDisplay = truncate(bDisplay);
|
|
2855
|
+
aDisplay = memorize("expected", truncate(aDisplay));
|
|
2856
|
+
bDisplay = memorize("actual", truncate(bDisplay));
|
|
2852
2857
|
return `${`${aColor(`${aIndicator} ${aAnnotation}:`)}\n${aDisplay}`}\n\n${`${bColor(`${bIndicator} ${bAnnotation}:`)}\n${bDisplay}`}`;
|
|
2853
2858
|
}
|
|
2854
2859
|
if (omitDifference) return;
|
|
2855
2860
|
switch (aType) {
|
|
2856
2861
|
case "string": return diffLinesUnified(a.split("\n"), b.split("\n"), options);
|
|
2857
2862
|
case "boolean":
|
|
2858
|
-
case "number": return comparePrimitive(a, b, options);
|
|
2859
|
-
case "map": return compareObjects(sortMap(a), sortMap(b), options);
|
|
2860
|
-
case "set": return compareObjects(sortSet(a), sortSet(b), options);
|
|
2861
|
-
default: return compareObjects(a, b, options);
|
|
2863
|
+
case "number": return comparePrimitive(a, b, options, memorize);
|
|
2864
|
+
case "map": return compareObjects(sortMap(a), sortMap(b), options, memorize);
|
|
2865
|
+
case "set": return compareObjects(sortSet(a), sortSet(b), options, memorize);
|
|
2866
|
+
default: return compareObjects(a, b, options, memorize);
|
|
2862
2867
|
}
|
|
2863
2868
|
}
|
|
2864
|
-
function
|
|
2865
|
-
|
|
2866
|
-
|
|
2869
|
+
function createMemorize(memory) {
|
|
2870
|
+
return (pointer, stringifiedValue) => {
|
|
2871
|
+
memory[pointer] = stringifiedValue;
|
|
2872
|
+
return stringifiedValue;
|
|
2873
|
+
};
|
|
2874
|
+
}
|
|
2875
|
+
function comparePrimitive(a, b, options, memorize = DEFAULT_MEMORIZE) {
|
|
2876
|
+
const aFormat = memorize("expected", format$1(a, FORMAT_OPTIONS));
|
|
2877
|
+
const bFormat = memorize("actual", format$1(b, FORMAT_OPTIONS));
|
|
2867
2878
|
return aFormat === bFormat ? "" : diffLinesUnified(aFormat.split("\n"), bFormat.split("\n"), options);
|
|
2868
2879
|
}
|
|
2869
2880
|
function sortMap(map) {
|
|
@@ -2872,21 +2883,24 @@ function sortMap(map) {
|
|
|
2872
2883
|
function sortSet(set) {
|
|
2873
2884
|
return new Set(Array.from(set.values()).sort());
|
|
2874
2885
|
}
|
|
2875
|
-
function compareObjects(a, b, options) {
|
|
2886
|
+
function compareObjects(a, b, options, memorize = DEFAULT_MEMORIZE) {
|
|
2876
2887
|
let difference;
|
|
2877
2888
|
let hasThrown = false;
|
|
2878
2889
|
try {
|
|
2879
|
-
difference = getObjectsDifference(a, b, getFormatOptions(FORMAT_OPTIONS, options), options);
|
|
2890
|
+
difference = getObjectsDifference(a, b, getFormatOptions(FORMAT_OPTIONS, options), options, memorize);
|
|
2880
2891
|
} catch {
|
|
2881
2892
|
hasThrown = true;
|
|
2882
2893
|
}
|
|
2883
2894
|
const noDiffMessage = getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
2884
2895
|
if (difference === void 0 || difference === noDiffMessage) {
|
|
2885
|
-
difference = getObjectsDifference(a, b, getFormatOptions(FALLBACK_FORMAT_OPTIONS, options), options);
|
|
2896
|
+
difference = getObjectsDifference(a, b, getFormatOptions(FALLBACK_FORMAT_OPTIONS, options), options, memorize);
|
|
2886
2897
|
if (difference !== noDiffMessage && !hasThrown) difference = `${getCommonMessage(SIMILAR_MESSAGE, options)}\n\n${difference}`;
|
|
2887
2898
|
}
|
|
2888
2899
|
return difference;
|
|
2889
2900
|
}
|
|
2901
|
+
function getDefaultFormatOptions(options) {
|
|
2902
|
+
return getFormatOptions(FORMAT_OPTIONS, options);
|
|
2903
|
+
}
|
|
2890
2904
|
function getFormatOptions(formatOptions, options) {
|
|
2891
2905
|
const { compareKeys, printBasicPrototype, maxDepth } = normalizeDiffOptions(options);
|
|
2892
2906
|
return {
|
|
@@ -2896,7 +2910,7 @@ function getFormatOptions(formatOptions, options) {
|
|
|
2896
2910
|
maxDepth: maxDepth ?? formatOptions.maxDepth
|
|
2897
2911
|
};
|
|
2898
2912
|
}
|
|
2899
|
-
function getObjectsDifference(a, b, formatOptions, options) {
|
|
2913
|
+
function getObjectsDifference(a, b, formatOptions, options, memorize = DEFAULT_MEMORIZE) {
|
|
2900
2914
|
const formatOptionsZeroIndent = {
|
|
2901
2915
|
...formatOptions,
|
|
2902
2916
|
indent: 0
|
|
@@ -2905,8 +2919,8 @@ function getObjectsDifference(a, b, formatOptions, options) {
|
|
|
2905
2919
|
const bCompare = format$1(b, formatOptionsZeroIndent);
|
|
2906
2920
|
if (aCompare === bCompare) return getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
2907
2921
|
else {
|
|
2908
|
-
const aDisplay = format$1(a, formatOptions);
|
|
2909
|
-
const bDisplay = format$1(b, formatOptions);
|
|
2922
|
+
const aDisplay = memorize("expected", format$1(a, formatOptions));
|
|
2923
|
+
const bDisplay = memorize("actual", format$1(b, formatOptions));
|
|
2910
2924
|
return diffLinesUnified2(aDisplay.split("\n"), bDisplay.split("\n"), aCompare.split("\n"), bCompare.split("\n"), options);
|
|
2911
2925
|
}
|
|
2912
2926
|
}
|
|
@@ -2918,7 +2932,7 @@ function isReplaceable(obj1, obj2) {
|
|
|
2918
2932
|
const obj1Type = getType$1(obj1);
|
|
2919
2933
|
return obj1Type === getType$1(obj2) && (obj1Type === "Object" || obj1Type === "Array");
|
|
2920
2934
|
}
|
|
2921
|
-
function printDiffOrStringify(received, expected, options) {
|
|
2935
|
+
function printDiffOrStringify(received, expected, options, memory) {
|
|
2922
2936
|
const { aAnnotation, bAnnotation } = normalizeDiffOptions(options);
|
|
2923
2937
|
if (typeof expected === "string" && typeof received === "string" && expected.length > 0 && received.length > 0 && expected.length <= MAX_DIFF_STRING_LENGTH && received.length <= MAX_DIFF_STRING_LENGTH && expected !== received) {
|
|
2924
2938
|
if (expected.includes("\n") || received.includes("\n")) return diffStringsUnified(expected, received, options);
|
|
@@ -2929,7 +2943,7 @@ function printDiffOrStringify(received, expected, options) {
|
|
|
2929
2943
|
}
|
|
2930
2944
|
const clonedExpected = deepClone(expected, { forceWritable: true });
|
|
2931
2945
|
const { replacedExpected, replacedActual } = replaceAsymmetricMatcher(deepClone(received, { forceWritable: true }), clonedExpected);
|
|
2932
|
-
return diff(replacedExpected, replacedActual, options);
|
|
2946
|
+
return diff(replacedExpected, replacedActual, options, memory ? createMemorize(memory) : DEFAULT_MEMORIZE);
|
|
2933
2947
|
}
|
|
2934
2948
|
function replaceAsymmetricMatcher(actual, expected, actualReplaced = /* @__PURE__ */ new WeakSet(), expectedReplaced = /* @__PURE__ */ new WeakSet()) {
|
|
2935
2949
|
if (actual instanceof Error && expected instanceof Error && typeof actual.cause !== "undefined" && typeof expected.cause === "undefined") {
|
|
@@ -2995,7 +3009,7 @@ function getCommonAndChangedSubstrings(diffs, op, hasCommonDiff) {
|
|
|
2995
3009
|
return diffs.reduce((reduced, diff) => reduced + (diff[0] === 0 ? diff[1] : diff[0] === op ? hasCommonDiff ? y.inverse(diff[1]) : diff[1] : ""), "");
|
|
2996
3010
|
}
|
|
2997
3011
|
//#endregion
|
|
2998
|
-
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.
|
|
3012
|
+
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.11/node_modules/@vitest/utils/dist/serialize.js
|
|
2999
3013
|
const IS_RECORD_SYMBOL$1 = "@@__IMMUTABLE_RECORD__@@";
|
|
3000
3014
|
const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
3001
3015
|
function isImmutable(v) {
|
|
@@ -3069,16 +3083,19 @@ function normalizeErrorMessage(message) {
|
|
|
3069
3083
|
return message.replace(/\(0\s?,\s?__vite_ssr_import_\d+__.(\w+)\)/g, "$1").replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "").replace(/getByTestId('__vitest_\d+__')/g, "page");
|
|
3070
3084
|
}
|
|
3071
3085
|
//#endregion
|
|
3072
|
-
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.
|
|
3086
|
+
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.11/node_modules/@vitest/utils/dist/error.js
|
|
3073
3087
|
function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
|
|
3074
3088
|
if (!_err || typeof _err !== "object") return { message: String(_err) };
|
|
3075
3089
|
const err = _err;
|
|
3076
|
-
if (err.showDiff || err.showDiff === void 0 && err.expected !== void 0 && err.actual !== void 0)
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3090
|
+
if (err.showDiff || err.showDiff === void 0 && err.expected !== void 0 && err.actual !== void 0) {
|
|
3091
|
+
const options = {
|
|
3092
|
+
...diffOptions,
|
|
3093
|
+
...err.diffOptions
|
|
3094
|
+
};
|
|
3095
|
+
err.diff = printDiffOrStringify(err.actual, err.expected, options, err);
|
|
3096
|
+
err.expected = prettifyValue(err.expected, options);
|
|
3097
|
+
err.actual = prettifyValue(err.actual, options);
|
|
3098
|
+
}
|
|
3082
3099
|
try {
|
|
3083
3100
|
if (!seen.has(err) && typeof err.cause === "object") {
|
|
3084
3101
|
seen.add(err);
|
|
@@ -3091,8 +3108,12 @@ function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
|
|
|
3091
3108
|
return serializeValue(/* @__PURE__ */ new Error(`Failed to fully serialize error: ${e?.message}\nInner error message: ${err?.message}`));
|
|
3092
3109
|
}
|
|
3093
3110
|
}
|
|
3111
|
+
function prettifyValue(value, options) {
|
|
3112
|
+
if (typeof value !== "string") return format$1(value, getDefaultFormatOptions(options));
|
|
3113
|
+
return value;
|
|
3114
|
+
}
|
|
3094
3115
|
//#endregion
|
|
3095
|
-
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.
|
|
3116
|
+
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.11/node_modules/@vitest/utils/dist/timers.js
|
|
3096
3117
|
const SAFE_TIMERS_SYMBOL = Symbol("vitest:SAFE_TIMERS");
|
|
3097
3118
|
function getSafeTimers() {
|
|
3098
3119
|
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
|
|
@@ -3126,7 +3147,7 @@ function delay(timeout, scheduler = setTimeout) {
|
|
|
3126
3147
|
return new Promise((resolve) => scheduler(resolve, timeout));
|
|
3127
3148
|
}
|
|
3128
3149
|
//#endregion
|
|
3129
|
-
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.
|
|
3150
|
+
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.11/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
|
|
3130
3151
|
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
3131
3152
|
function normalizeWindowsPath(input = "") {
|
|
3132
3153
|
if (!input) return input;
|
|
@@ -3205,22 +3226,22 @@ const isAbsolute = function(p) {
|
|
|
3205
3226
|
return _IS_ABSOLUTE_RE.test(p);
|
|
3206
3227
|
};
|
|
3207
3228
|
//#endregion
|
|
3208
|
-
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.
|
|
3209
|
-
var comma
|
|
3210
|
-
var chars
|
|
3211
|
-
var intToChar
|
|
3212
|
-
var charToInt
|
|
3213
|
-
for (let i = 0; i < chars
|
|
3214
|
-
const c = chars
|
|
3215
|
-
intToChar
|
|
3216
|
-
charToInt
|
|
3229
|
+
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.11/node_modules/@vitest/utils/dist/source-map.js
|
|
3230
|
+
var comma = ",".charCodeAt(0);
|
|
3231
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
3232
|
+
var intToChar = /* @__PURE__ */ new Uint8Array(64);
|
|
3233
|
+
var charToInt = /* @__PURE__ */ new Uint8Array(128);
|
|
3234
|
+
for (let i = 0; i < chars.length; i++) {
|
|
3235
|
+
const c = chars.charCodeAt(i);
|
|
3236
|
+
intToChar[i] = c;
|
|
3237
|
+
charToInt[c] = i;
|
|
3217
3238
|
}
|
|
3218
3239
|
function decodeInteger(reader, relative) {
|
|
3219
3240
|
let value = 0;
|
|
3220
3241
|
let shift = 0;
|
|
3221
3242
|
let integer = 0;
|
|
3222
3243
|
do {
|
|
3223
|
-
integer = charToInt
|
|
3244
|
+
integer = charToInt[reader.next()];
|
|
3224
3245
|
value |= (integer & 31) << shift;
|
|
3225
3246
|
shift += 5;
|
|
3226
3247
|
} while (integer & 32);
|
|
@@ -3231,7 +3252,7 @@ function decodeInteger(reader, relative) {
|
|
|
3231
3252
|
}
|
|
3232
3253
|
function hasMoreVlq(reader, max) {
|
|
3233
3254
|
if (reader.pos >= max) return false;
|
|
3234
|
-
return reader.peek() !== comma
|
|
3255
|
+
return reader.peek() !== comma;
|
|
3235
3256
|
}
|
|
3236
3257
|
var StringReader = class {
|
|
3237
3258
|
constructor(buffer) {
|
|
@@ -3573,7 +3594,7 @@ function getOriginalPosition(map, needle) {
|
|
|
3573
3594
|
return result;
|
|
3574
3595
|
}
|
|
3575
3596
|
//#endregion
|
|
3576
|
-
//#region ../../../node_modules/.pnpm/@vitest+runner@4.1.
|
|
3597
|
+
//#region ../../../node_modules/.pnpm/@vitest+runner@4.1.11/node_modules/@vitest/runner/dist/chunk-artifact.js
|
|
3577
3598
|
var PendingError = class extends Error {
|
|
3578
3599
|
code = "VITEST_PENDING";
|
|
3579
3600
|
taskId;
|
|
@@ -3656,7 +3677,8 @@ var TestFixtures = class TestFixtures {
|
|
|
3656
3677
|
extend(runner, userFixtures) {
|
|
3657
3678
|
const { suite } = getCurrentSuite();
|
|
3658
3679
|
const isTopLevel = !suite || suite.file === suite;
|
|
3659
|
-
|
|
3680
|
+
const registrations = this.parseUserFixtures(runner, userFixtures, isTopLevel);
|
|
3681
|
+
return new TestFixtures(registrations);
|
|
3660
3682
|
}
|
|
3661
3683
|
get(suite) {
|
|
3662
3684
|
let currentSuite = suite;
|
|
@@ -3875,8 +3897,10 @@ function resolveDeps(usedFixtures, registrations, depSet = /* @__PURE__ */ new S
|
|
|
3875
3897
|
pendingFixtures.push(fixture);
|
|
3876
3898
|
return;
|
|
3877
3899
|
}
|
|
3878
|
-
if (depSet.has(fixture))
|
|
3879
|
-
|
|
3900
|
+
if (depSet.has(fixture)) {
|
|
3901
|
+
if (fixture.parent) fixture = fixture.parent;
|
|
3902
|
+
else throw new Error(`Circular fixture dependency detected: ${fixture.name} <- ${[...depSet].reverse().map((d) => d.name).join(" <- ")}`);
|
|
3903
|
+
}
|
|
3880
3904
|
depSet.add(fixture);
|
|
3881
3905
|
resolveDeps([...fixture.deps].map((n) => n === fixture.name ? fixture.parent : registrations.get(n)).filter((n) => !!n), registrations, depSet, pendingFixtures);
|
|
3882
3906
|
pendingFixtures.push(fixture);
|
|
@@ -3950,10 +3974,6 @@ function splitByComma(s) {
|
|
|
3950
3974
|
if (lastToken) result.push(lastToken);
|
|
3951
3975
|
return result;
|
|
3952
3976
|
}
|
|
3953
|
-
let _test;
|
|
3954
|
-
function getCurrentTest() {
|
|
3955
|
-
return _test;
|
|
3956
|
-
}
|
|
3957
3977
|
const kChainableContext = Symbol("kChainableContext");
|
|
3958
3978
|
function getChainableContext(chainable) {
|
|
3959
3979
|
return chainable?.[kChainableContext];
|
|
@@ -4100,14 +4120,6 @@ function afterEach(fn, timeout) {
|
|
|
4100
4120
|
};
|
|
4101
4121
|
return getCurrentSuite().on("afterEach", withTimeout(wrapper, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
4102
4122
|
}
|
|
4103
|
-
createTestHook("onTestFailed", (test, handler, timeout) => {
|
|
4104
|
-
test.onFailed ||= [];
|
|
4105
|
-
test.onFailed.push(withTimeout(handler, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
4106
|
-
});
|
|
4107
|
-
createTestHook("onTestFinished", (test, handler, timeout) => {
|
|
4108
|
-
test.onFinished ||= [];
|
|
4109
|
-
test.onFinished.push(withTimeout(handler, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
4110
|
-
});
|
|
4111
4123
|
/**
|
|
4112
4124
|
* Registers a callback function that wraps around all tests within the current suite.
|
|
4113
4125
|
* The callback receives a `runSuite` function that must be called to run the suite's tests.
|
|
@@ -4207,14 +4219,6 @@ function withSuiteFixtures(suiteHook, fn, context, stackTraceError, contextIndex
|
|
|
4207
4219
|
})();
|
|
4208
4220
|
};
|
|
4209
4221
|
}
|
|
4210
|
-
function createTestHook(name, handler) {
|
|
4211
|
-
return (fn, timeout) => {
|
|
4212
|
-
assertTypes(fn, `"${name}" callback`, ["function"]);
|
|
4213
|
-
const current = getCurrentTest();
|
|
4214
|
-
if (!current) throw new Error(`Hook ${name}() can only be called inside a test`);
|
|
4215
|
-
return handler(current, fn, timeout);
|
|
4216
|
-
};
|
|
4217
|
-
}
|
|
4218
4222
|
function findTestFileStackTrace(testFilePath, error) {
|
|
4219
4223
|
const lines = error.split("\n").slice(1);
|
|
4220
4224
|
for (const line of lines) {
|
|
@@ -4305,7 +4309,6 @@ const suite = createSuite();
|
|
|
4305
4309
|
* ```
|
|
4306
4310
|
*/
|
|
4307
4311
|
const test$2 = createTest(function(name, optionsOrFn, optionsOrTest) {
|
|
4308
|
-
if (getCurrentTest()) throw new Error("Calling the test function inside another test function is not allowed. Please put it inside \"describe\" or \"suite\" so it can be properly collected.");
|
|
4309
4312
|
getCurrentSuite().test.fn.call(this, formatName(name), optionsOrFn, optionsOrTest);
|
|
4310
4313
|
});
|
|
4311
4314
|
/**
|
|
@@ -4382,7 +4385,6 @@ function assert$3(condition, message) {
|
|
|
4382
4385
|
}
|
|
4383
4386
|
function getRunner() {
|
|
4384
4387
|
assert$3(runner, "the runner");
|
|
4385
|
-
return runner;
|
|
4386
4388
|
}
|
|
4387
4389
|
function getCurrentSuite() {
|
|
4388
4390
|
const currentSuite = collectorContext.currentSuite || defaultSuite;
|
|
@@ -4466,7 +4468,7 @@ function createSuiteCollector(name, factory = () => {}, mode, each, suiteOptions
|
|
|
4466
4468
|
};
|
|
4467
4469
|
const handler = options.handler;
|
|
4468
4470
|
if (task.mode === "run" && !handler) task.mode = "todo";
|
|
4469
|
-
if (options.concurrent
|
|
4471
|
+
if (options.concurrent ?? (!options.sequential && runner.config.sequence.concurrent)) task.concurrent = true;
|
|
4470
4472
|
task.shuffle = suiteOptions?.shuffle;
|
|
4471
4473
|
const context = createTestContext(task, runner);
|
|
4472
4474
|
Object.defineProperty(task, "context", {
|
|
@@ -4572,7 +4574,6 @@ function withAwaitAsyncAssertions(fn, task) {
|
|
|
4572
4574
|
}
|
|
4573
4575
|
function createSuite() {
|
|
4574
4576
|
function suiteFn(name, factoryOrOptions, optionsOrFactory) {
|
|
4575
|
-
if (getCurrentTest()) throw new Error("Calling the suite function inside test function is not allowed. It can be only called at the top level or inside another suite function.");
|
|
4576
4577
|
const currentSuite = collectorContext.currentSuite || defaultSuite;
|
|
4577
4578
|
let { options, handler: factory } = parseArguments(factoryOrOptions, optionsOrFactory);
|
|
4578
4579
|
const isConcurrentSpecified = options.concurrent || this.concurrent || options.sequential === false;
|
|
@@ -4582,7 +4583,7 @@ function createSuite() {
|
|
|
4582
4583
|
...parentOptions,
|
|
4583
4584
|
...options
|
|
4584
4585
|
};
|
|
4585
|
-
const shuffle = this.shuffle ?? options.shuffle ?? currentSuite?.options?.shuffle ??
|
|
4586
|
+
const shuffle = this.shuffle ?? options.shuffle ?? currentSuite?.options?.shuffle ?? void 0;
|
|
4586
4587
|
if (shuffle != null) options.shuffle = shuffle;
|
|
4587
4588
|
let mode = this.only ?? options.only ? "only" : this.skip ?? options.skip ? "skip" : this.todo ?? options.todo ? "todo" : "run";
|
|
4588
4589
|
if (mode === "run" && !factory) mode = "todo";
|
|
@@ -4605,9 +4606,10 @@ function createSuite() {
|
|
|
4605
4606
|
const fnFirst = typeof optionsOrFn === "function";
|
|
4606
4607
|
cases.forEach((i, idx) => {
|
|
4607
4608
|
const items = Array.isArray(i) ? i : [i];
|
|
4608
|
-
if (fnFirst)
|
|
4609
|
-
|
|
4610
|
-
|
|
4609
|
+
if (fnFirst) {
|
|
4610
|
+
if (arrayOnlyCases) suite(formatTitle(_name, items, idx), handler ? () => handler(...items) : void 0, options.timeout);
|
|
4611
|
+
else suite(formatTitle(_name, items, idx), handler ? () => handler(i) : void 0, options.timeout);
|
|
4612
|
+
} else if (arrayOnlyCases) suite(formatTitle(_name, items, idx), options, handler ? () => handler(...items) : void 0);
|
|
4611
4613
|
else suite(formatTitle(_name, items, idx), options, handler ? () => handler(i) : void 0);
|
|
4612
4614
|
});
|
|
4613
4615
|
context.setContext("each", void 0);
|
|
@@ -4648,9 +4650,10 @@ function createTaskCollector(fn) {
|
|
|
4648
4650
|
const fnFirst = typeof optionsOrFn === "function";
|
|
4649
4651
|
cases.forEach((i, idx) => {
|
|
4650
4652
|
const items = Array.isArray(i) ? i : [i];
|
|
4651
|
-
if (fnFirst)
|
|
4652
|
-
|
|
4653
|
-
|
|
4653
|
+
if (fnFirst) {
|
|
4654
|
+
if (arrayOnlyCases) test(formatTitle(_name, items, idx), handler ? () => handler(...items) : void 0, options.timeout);
|
|
4655
|
+
else test(formatTitle(_name, items, idx), handler ? () => handler(i) : void 0, options.timeout);
|
|
4656
|
+
} else if (arrayOnlyCases) test(formatTitle(_name, items, idx), options, handler ? () => handler(...items) : void 0);
|
|
4654
4657
|
else test(formatTitle(_name, items, idx), options, handler ? () => handler(i) : void 0);
|
|
4655
4658
|
});
|
|
4656
4659
|
context.setContext("each", void 0);
|
|
@@ -4774,7 +4777,7 @@ function formatTitle(template, items, idx) {
|
|
|
4774
4777
|
const isArrayKey = /^\d+$/.test(key);
|
|
4775
4778
|
if (!isObjectItem && !isArrayKey) return `$${key}`;
|
|
4776
4779
|
const arrayElement = isArrayKey ? objectAttr(items, key) : void 0;
|
|
4777
|
-
return objDisplay$1(isObjectItem ? objectAttr(items[0], key, arrayElement) : arrayElement, { truncate:
|
|
4780
|
+
return objDisplay$1(isObjectItem ? objectAttr(items[0], key, arrayElement) : arrayElement, { truncate: void 0 });
|
|
4778
4781
|
});
|
|
4779
4782
|
}
|
|
4780
4783
|
let output = "";
|
|
@@ -4943,8 +4946,8 @@ function makeTimeoutError(isHook, timeout, stackTraceError) {
|
|
|
4943
4946
|
}
|
|
4944
4947
|
globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
4945
4948
|
globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
4946
|
-
|
|
4947
|
-
const { clearTimeout
|
|
4949
|
+
Date.now;
|
|
4950
|
+
const { clearTimeout, setTimeout: setTimeout$1 } = getSafeTimers();
|
|
4948
4951
|
const packs = /* @__PURE__ */ new Map();
|
|
4949
4952
|
const eventsPacks = [];
|
|
4950
4953
|
const pendingTasksUpdates = [];
|
|
@@ -4970,21 +4973,6 @@ async function finishSendTasksUpdate(runner) {
|
|
|
4970
4973
|
sendTasksUpdate(runner);
|
|
4971
4974
|
await Promise.all(pendingTasksUpdates);
|
|
4972
4975
|
}
|
|
4973
|
-
function throttle(fn, ms) {
|
|
4974
|
-
let last = 0;
|
|
4975
|
-
let pendingCall;
|
|
4976
|
-
return function call(...args) {
|
|
4977
|
-
const now = unixNow();
|
|
4978
|
-
if (now - last > ms) {
|
|
4979
|
-
last = now;
|
|
4980
|
-
clearTimeout$1(pendingCall);
|
|
4981
|
-
pendingCall = void 0;
|
|
4982
|
-
return fn.apply(this, args);
|
|
4983
|
-
}
|
|
4984
|
-
pendingCall ??= setTimeout$1(() => call.bind(this)(...args), ms);
|
|
4985
|
-
};
|
|
4986
|
-
}
|
|
4987
|
-
throttle(sendTasksUpdate, 100);
|
|
4988
4976
|
/**
|
|
4989
4977
|
* @experimental
|
|
4990
4978
|
* @advanced
|
|
@@ -5107,7 +5095,7 @@ function manageArtifactAttachment(attachment) {
|
|
|
5107
5095
|
if (attachment.body != null) attachment.bodyEncoding ??= "base64";
|
|
5108
5096
|
}
|
|
5109
5097
|
//#endregion
|
|
5110
|
-
//#region ../../../node_modules/.pnpm/vitest@4.1.
|
|
5098
|
+
//#region ../../../node_modules/.pnpm/vitest@4.1.11_@types+node@26.2.0_vite@7.3.2_@types+node@26.2.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.23.12_yaml@2.9.0_/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.js
|
|
5111
5099
|
const NAME_WORKER_STATE = "__vitest_worker__";
|
|
5112
5100
|
function getWorkerState() {
|
|
5113
5101
|
const workerState = globalThis[NAME_WORKER_STATE];
|
|
@@ -5147,7 +5135,7 @@ async function waitForImportsToResolve() {
|
|
|
5147
5135
|
await waitForImportsToResolve();
|
|
5148
5136
|
}
|
|
5149
5137
|
//#endregion
|
|
5150
|
-
//#region ../../../node_modules/.pnpm/@vitest+spy@4.1.
|
|
5138
|
+
//#region ../../../node_modules/.pnpm/@vitest+spy@4.1.11/node_modules/@vitest/spy/dist/index.js
|
|
5151
5139
|
function isMockFunction(fn) {
|
|
5152
5140
|
return typeof fn === "function" && "_isMockFunction" in fn && fn._isMockFunction === true;
|
|
5153
5141
|
}
|
|
@@ -5471,7 +5459,7 @@ function copyOriginalStaticProperties(mock, original) {
|
|
|
5471
5459
|
Object.defineProperty(mock, key, descriptor);
|
|
5472
5460
|
}
|
|
5473
5461
|
}
|
|
5474
|
-
const ignoreProperties = new Set([
|
|
5462
|
+
const ignoreProperties = /* @__PURE__ */ new Set([
|
|
5475
5463
|
"length",
|
|
5476
5464
|
"name",
|
|
5477
5465
|
"prototype",
|
|
@@ -6267,13 +6255,14 @@ function inspect2(obj, showHidden, depth, colors) {
|
|
|
6267
6255
|
__name(inspect2, "inspect");
|
|
6268
6256
|
function objDisplay(obj) {
|
|
6269
6257
|
let str = inspect2(obj), type3 = Object.prototype.toString.call(obj);
|
|
6270
|
-
if (config.truncateThreshold && str.length >= config.truncateThreshold)
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6258
|
+
if (config.truncateThreshold && str.length >= config.truncateThreshold) {
|
|
6259
|
+
if (type3 === "[object Function]") return !obj.name || obj.name === "" ? "[Function]" : "[Function: " + obj.name + "]";
|
|
6260
|
+
else if (type3 === "[object Array]") return "[ Array(" + obj.length + ") ]";
|
|
6261
|
+
else if (type3 === "[object Object]") {
|
|
6262
|
+
let keys = Object.keys(obj);
|
|
6263
|
+
return "{ Object (" + (keys.length > 2 ? keys.splice(0, 2).join(", ") + ", ..." : keys.join(", ")) + ") }";
|
|
6264
|
+
} else return str;
|
|
6275
6265
|
} else return str;
|
|
6276
|
-
else return str;
|
|
6277
6266
|
}
|
|
6278
6267
|
__name(objDisplay, "objDisplay");
|
|
6279
6268
|
function getMessage2(obj, args) {
|
|
@@ -6956,7 +6945,8 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
6956
6945
|
Object.setPrototypeOf(chainableMethodWrapper, prototype);
|
|
6957
6946
|
} else Object.getOwnPropertyNames(ctx).forEach(function(asserterName) {
|
|
6958
6947
|
if (excludeNames.indexOf(asserterName) !== -1) return;
|
|
6959
|
-
|
|
6948
|
+
let pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
|
|
6949
|
+
Object.defineProperty(chainableMethodWrapper, asserterName, pd);
|
|
6960
6950
|
});
|
|
6961
6951
|
transferFlags(this, chainableMethodWrapper);
|
|
6962
6952
|
return proxify(chainableMethodWrapper);
|
|
@@ -7588,17 +7578,23 @@ function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
|
7588
7578
|
}
|
|
7589
7579
|
if (errorLike && caughtErr) {
|
|
7590
7580
|
if (errorLike instanceof Error) {
|
|
7591
|
-
if (check_error_exports.compatibleInstance(caughtErr, errorLike) === negate)
|
|
7592
|
-
|
|
7581
|
+
if (check_error_exports.compatibleInstance(caughtErr, errorLike) === negate) {
|
|
7582
|
+
if (everyArgIsDefined && negate) errorLikeFail = true;
|
|
7583
|
+
else this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr && !negate ? " but #{act} was thrown" : ""), errorLike.toString(), caughtErr.toString());
|
|
7584
|
+
}
|
|
7585
|
+
}
|
|
7586
|
+
if (check_error_exports.compatibleConstructor(caughtErr, errorLike) === negate) {
|
|
7587
|
+
if (everyArgIsDefined && negate) errorLikeFail = true;
|
|
7588
|
+
else this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), errorLike instanceof Error ? errorLike.toString() : errorLike && check_error_exports.getConstructorName(errorLike), caughtErr instanceof Error ? caughtErr.toString() : caughtErr && check_error_exports.getConstructorName(caughtErr));
|
|
7593
7589
|
}
|
|
7594
|
-
if (check_error_exports.compatibleConstructor(caughtErr, errorLike) === negate) if (everyArgIsDefined && negate) errorLikeFail = true;
|
|
7595
|
-
else this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), errorLike instanceof Error ? errorLike.toString() : errorLike && check_error_exports.getConstructorName(errorLike), caughtErr instanceof Error ? caughtErr.toString() : caughtErr && check_error_exports.getConstructorName(caughtErr));
|
|
7596
7590
|
}
|
|
7597
7591
|
if (caughtErr && errMsgMatcher !== void 0 && errMsgMatcher !== null) {
|
|
7598
7592
|
let placeholder = "including";
|
|
7599
7593
|
if (isRegExp2(errMsgMatcher)) placeholder = "matching";
|
|
7600
|
-
if (check_error_exports.compatibleMessage(caughtErr, errMsgMatcher) === negate)
|
|
7601
|
-
|
|
7594
|
+
if (check_error_exports.compatibleMessage(caughtErr, errMsgMatcher) === negate) {
|
|
7595
|
+
if (everyArgIsDefined && negate) errMsgMatcherFail = true;
|
|
7596
|
+
else this.assert(negate, "expected #{this} to throw error " + placeholder + " #{exp} but got #{act}", "expected #{this} to throw error not " + placeholder + " #{exp}", errMsgMatcher, check_error_exports.getMessage(caughtErr));
|
|
7597
|
+
}
|
|
7602
7598
|
}
|
|
7603
7599
|
if (errorLikeFail && errMsgMatcherFail) this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), errorLike instanceof Error ? errorLike.toString() : errorLike && check_error_exports.getConstructorName(errorLike), caughtErr instanceof Error ? caughtErr.toString() : caughtErr && check_error_exports.getConstructorName(caughtErr));
|
|
7604
7600
|
flag2(this, "object", caughtErr);
|
|
@@ -7828,8 +7824,10 @@ function compareSubset(expected, actual) {
|
|
|
7828
7824
|
});
|
|
7829
7825
|
});
|
|
7830
7826
|
}
|
|
7831
|
-
if (expected instanceof Date)
|
|
7832
|
-
|
|
7827
|
+
if (expected instanceof Date) {
|
|
7828
|
+
if (actual instanceof Date) return expected.getTime() === actual.getTime();
|
|
7829
|
+
else return false;
|
|
7830
|
+
}
|
|
7833
7831
|
return Object.keys(expected).every(function(key) {
|
|
7834
7832
|
let expectedValue = expected[key];
|
|
7835
7833
|
let actualValue = actual[key];
|
|
@@ -8500,7 +8498,7 @@ function use(fn) {
|
|
|
8500
8498
|
}
|
|
8501
8499
|
__name(use, "use");
|
|
8502
8500
|
//#endregion
|
|
8503
|
-
//#region ../../../node_modules/.pnpm/@vitest+expect@4.1.
|
|
8501
|
+
//#region ../../../node_modules/.pnpm/@vitest+expect@4.1.11/node_modules/@vitest/expect/dist/index.js
|
|
8504
8502
|
const ChaiStyleAssertions = (chai, utils) => {
|
|
8505
8503
|
function defProperty(name, delegateTo) {
|
|
8506
8504
|
utils.addProperty(chai.Assertion.prototype, name, function() {
|
|
@@ -9339,8 +9337,12 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9339
9337
|
if (promise === "rejects") utils.flag(this, "object", () => {
|
|
9340
9338
|
throw object;
|
|
9341
9339
|
});
|
|
9342
|
-
else if (promise === "resolves" && typeof object !== "function")
|
|
9343
|
-
|
|
9340
|
+
else if (promise === "resolves" && typeof object !== "function") {
|
|
9341
|
+
if (!isNot) {
|
|
9342
|
+
const message = utils.flag(this, "message") || "expected promise to throw an error, but it didn't";
|
|
9343
|
+
throw new AssertionError(message, { showDiff: false }, utils.flag(this, "ssfi"));
|
|
9344
|
+
} else return;
|
|
9345
|
+
}
|
|
9344
9346
|
_super.apply(this, args);
|
|
9345
9347
|
};
|
|
9346
9348
|
});
|
|
@@ -9399,7 +9401,8 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9399
9401
|
actualSubset,
|
|
9400
9402
|
false
|
|
9401
9403
|
]);
|
|
9402
|
-
|
|
9404
|
+
const message = stripped === 0 ? msg : `${msg}\n(${stripped} matching ${stripped === 1 ? "property" : "properties"} omitted from actual)`;
|
|
9405
|
+
throw new AssertionError(message, {
|
|
9403
9406
|
showDiff: true,
|
|
9404
9407
|
expected,
|
|
9405
9408
|
actual: actualSubset
|
|
@@ -9632,9 +9635,12 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9632
9635
|
const isNot = utils.flag(this, "negate");
|
|
9633
9636
|
let thrown = null;
|
|
9634
9637
|
if (promise === "rejects") thrown = obj;
|
|
9635
|
-
else if (promise === "resolves" && typeof obj !== "function")
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
+
else if (promise === "resolves" && typeof obj !== "function") {
|
|
9639
|
+
if (!isNot) {
|
|
9640
|
+
const message = utils.flag(this, "message") || "expected promise to throw an error, but it didn't";
|
|
9641
|
+
throw new AssertionError(message, { showDiff: false }, utils.flag(this, "ssfi"));
|
|
9642
|
+
} else return;
|
|
9643
|
+
} else {
|
|
9638
9644
|
let isThrow = false;
|
|
9639
9645
|
try {
|
|
9640
9646
|
obj();
|
|
@@ -9642,7 +9648,10 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9642
9648
|
isThrow = true;
|
|
9643
9649
|
thrown = err;
|
|
9644
9650
|
}
|
|
9645
|
-
if (!isThrow && !isNot)
|
|
9651
|
+
if (!isThrow && !isNot) {
|
|
9652
|
+
const message = utils.flag(this, "message") || "expected function to throw an error, but it didn't";
|
|
9653
|
+
throw new AssertionError(message, { showDiff: false }, utils.flag(this, "ssfi"));
|
|
9654
|
+
}
|
|
9646
9655
|
}
|
|
9647
9656
|
if (typeof expected === "function") {
|
|
9648
9657
|
const name = expected.name || expected.prototype.constructor.name;
|
|
@@ -9712,7 +9721,8 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9712
9721
|
`expected "${spyName}" to not ${action} with: #{exp}`,
|
|
9713
9722
|
value
|
|
9714
9723
|
]);
|
|
9715
|
-
|
|
9724
|
+
const results = action === "return" ? spy.mock.results : spy.mock.settledResults;
|
|
9725
|
+
throw new AssertionError(formatReturns(spy, results, msg, value));
|
|
9716
9726
|
}
|
|
9717
9727
|
});
|
|
9718
9728
|
});
|
|
@@ -9778,7 +9788,7 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9778
9788
|
if (typeof result !== "function") return result instanceof chai.Assertion ? proxy : result;
|
|
9779
9789
|
return (...args) => {
|
|
9780
9790
|
utils.flag(this, "_name", key);
|
|
9781
|
-
|
|
9791
|
+
const promise = Promise.resolve(obj).then((value) => {
|
|
9782
9792
|
utils.flag(this, "object", value);
|
|
9783
9793
|
return result.call(this, ...args);
|
|
9784
9794
|
}, (err) => {
|
|
@@ -9788,7 +9798,8 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9788
9798
|
}).catch((err) => {
|
|
9789
9799
|
if (isError(err) && error.stack) err.stack = error.stack.replace(error.message, err.message);
|
|
9790
9800
|
throw err;
|
|
9791
|
-
})
|
|
9801
|
+
});
|
|
9802
|
+
return recordAsyncExpect(test, promise, createAssertionMessage(utils, this, !!args.length), error, utils.flag(this, "soft"));
|
|
9792
9803
|
};
|
|
9793
9804
|
} });
|
|
9794
9805
|
return proxy;
|
|
@@ -9807,7 +9818,7 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9807
9818
|
if (typeof result !== "function") return result instanceof chai.Assertion ? proxy : result;
|
|
9808
9819
|
return (...args) => {
|
|
9809
9820
|
utils.flag(this, "_name", key);
|
|
9810
|
-
|
|
9821
|
+
const promise = Promise.resolve(wrapper).then((value) => {
|
|
9811
9822
|
throw new AssertionError(`promise resolved "${utils.inspect(value)}" instead of rejecting`, {
|
|
9812
9823
|
showDiff: true,
|
|
9813
9824
|
expected: /* @__PURE__ */ new Error("rejected promise"),
|
|
@@ -9819,7 +9830,8 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9819
9830
|
}).catch((err) => {
|
|
9820
9831
|
if (isError(err) && error.stack) err.stack = error.stack.replace(error.message, err.message);
|
|
9821
9832
|
throw err;
|
|
9822
|
-
})
|
|
9833
|
+
});
|
|
9834
|
+
return recordAsyncExpect(test, promise, createAssertionMessage(utils, this, !!args.length), error, utils.flag(this, "soft"));
|
|
9823
9835
|
};
|
|
9824
9836
|
} });
|
|
9825
9837
|
return proxy;
|
|
@@ -9962,7 +9974,7 @@ const JestExtend = (chai, utils) => {
|
|
|
9962
9974
|
});
|
|
9963
9975
|
};
|
|
9964
9976
|
//#endregion
|
|
9965
|
-
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.
|
|
9977
|
+
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.11/node_modules/@vitest/utils/dist/offset.js
|
|
9966
9978
|
const lineSplitRE = /\r?\n/;
|
|
9967
9979
|
function positionToOffset(source, lineNumber, columnNumber) {
|
|
9968
9980
|
const lines = source.split(lineSplitRE);
|
|
@@ -9986,10 +9998,10 @@ function offsetToLineNumber(source, offset) {
|
|
|
9986
9998
|
return line + 1;
|
|
9987
9999
|
}
|
|
9988
10000
|
//#endregion
|
|
9989
|
-
//#region ../../../node_modules/.pnpm/vitest@4.1.
|
|
10001
|
+
//#region ../../../node_modules/.pnpm/vitest@4.1.11_@types+node@26.2.0_vite@7.3.2_@types+node@26.2.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.23.12_yaml@2.9.0_/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js
|
|
9990
10002
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
9991
10003
|
//#endregion
|
|
9992
|
-
//#region ../../../node_modules/.pnpm/vitest@4.1.
|
|
10004
|
+
//#region ../../../node_modules/.pnpm/vitest@4.1.11_@types+node@26.2.0_vite@7.3.2_@types+node@26.2.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.23.12_yaml@2.9.0_/node_modules/vitest/dist/chunks/rpc.MzXet3jl.js
|
|
9993
10005
|
const RealDate = Date;
|
|
9994
10006
|
let now = null;
|
|
9995
10007
|
var MockDate = class MockDate extends RealDate {
|
|
@@ -10011,7 +10023,6 @@ var MockDate = class MockDate extends RealDate {
|
|
|
10011
10023
|
s = s || 0;
|
|
10012
10024
|
ms = ms || 0;
|
|
10013
10025
|
date = new RealDate(y, m, d, h, M, s, ms);
|
|
10014
|
-
break;
|
|
10015
10026
|
}
|
|
10016
10027
|
Object.setPrototypeOf(date, MockDate.prototype);
|
|
10017
10028
|
return date;
|
|
@@ -10038,7 +10049,7 @@ function resetDate() {
|
|
|
10038
10049
|
}
|
|
10039
10050
|
const { get } = Reflect;
|
|
10040
10051
|
//#endregion
|
|
10041
|
-
//#region ../../../node_modules/.pnpm/@vitest+snapshot@4.1.
|
|
10052
|
+
//#region ../../../node_modules/.pnpm/@vitest+snapshot@4.1.11/node_modules/@vitest/snapshot/dist/index.js
|
|
10042
10053
|
function getDefaultExportFromCjs(x) {
|
|
10043
10054
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
10044
10055
|
}
|
|
@@ -10083,7 +10094,7 @@ function requireNaturalCompare() {
|
|
|
10083
10094
|
}
|
|
10084
10095
|
return naturalCompare$1.exports;
|
|
10085
10096
|
}
|
|
10086
|
-
var naturalCompare =
|
|
10097
|
+
var naturalCompare = /*@__PURE__*/ getDefaultExportFromCjs(requireNaturalCompare());
|
|
10087
10098
|
const serialize$1 = (val, config, indentation, depth, refs, printer) => {
|
|
10088
10099
|
const name = val.getMockName();
|
|
10089
10100
|
const nameString = name === "vi.fn()" ? "" : ` ${name}`;
|
|
@@ -10196,9 +10207,10 @@ function deepMergeSnapshot(target, source) {
|
|
|
10196
10207
|
if (isObject(target) && isObject(source)) {
|
|
10197
10208
|
const mergedOutput = { ...target };
|
|
10198
10209
|
Object.keys(source).forEach((key) => {
|
|
10199
|
-
if (isObject(source[key]) && !source[key].$$typeof)
|
|
10200
|
-
|
|
10201
|
-
|
|
10210
|
+
if (isObject(source[key]) && !source[key].$$typeof) {
|
|
10211
|
+
if (!(key in target)) Object.assign(mergedOutput, { [key]: source[key] });
|
|
10212
|
+
else mergedOutput[key] = deepMergeSnapshot(target[key], source[key]);
|
|
10213
|
+
} else if (Array.isArray(source[key])) mergedOutput[key] = deepMergeArray(target[key], source[key]);
|
|
10202
10214
|
else Object.assign(mergedOutput, { [key]: source[key] });
|
|
10203
10215
|
});
|
|
10204
10216
|
return mergedOutput;
|
|
@@ -10243,7 +10255,7 @@ function memo(fn) {
|
|
|
10243
10255
|
};
|
|
10244
10256
|
}
|
|
10245
10257
|
async function saveInlineSnapshots(environment, snapshots) {
|
|
10246
|
-
const MagicString = (await import("./magic-string.es-
|
|
10258
|
+
const MagicString = (await import("./magic-string.es-CUAnjKYC.mjs")).default;
|
|
10247
10259
|
const files = new Set(snapshots.map((i) => i.file));
|
|
10248
10260
|
await Promise.all(Array.from(files).map(async (file) => {
|
|
10249
10261
|
const snaps = snapshots.filter((i) => i.file === file);
|
|
@@ -10425,7 +10437,8 @@ var SnapshotState = class SnapshotState {
|
|
|
10425
10437
|
}
|
|
10426
10438
|
static async create(testFilePath, options) {
|
|
10427
10439
|
const snapshotPath = await options.snapshotEnvironment.resolvePath(testFilePath);
|
|
10428
|
-
|
|
10440
|
+
const content = await options.snapshotEnvironment.readSnapshotFile(snapshotPath);
|
|
10441
|
+
return new SnapshotState(testFilePath, snapshotPath, content, options);
|
|
10429
10442
|
}
|
|
10430
10443
|
get snapshotUpdateState() {
|
|
10431
10444
|
return this._updateSnapshot;
|
|
@@ -10521,17 +10534,18 @@ var SnapshotState = class SnapshotState {
|
|
|
10521
10534
|
}
|
|
10522
10535
|
_reconcile(opts) {
|
|
10523
10536
|
if (opts.hasSnapshot && this._updateSnapshot === "all" || (!opts.hasSnapshot || !opts.snapshotIsPersisted) && (this._updateSnapshot === "new" || this._updateSnapshot === "all")) {
|
|
10524
|
-
if (this._updateSnapshot === "all")
|
|
10525
|
-
if (opts.
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10537
|
+
if (this._updateSnapshot === "all") {
|
|
10538
|
+
if (!opts.pass) {
|
|
10539
|
+
if (opts.hasSnapshot) this.updated.increment(opts.testId);
|
|
10540
|
+
else this.added.increment(opts.testId);
|
|
10541
|
+
this._addSnapshot(opts.key, opts.addValue, {
|
|
10542
|
+
stack: opts.stack,
|
|
10543
|
+
testId: opts.testId,
|
|
10544
|
+
rawSnapshot: opts.rawSnapshot,
|
|
10545
|
+
assertionName: opts.assertionName
|
|
10546
|
+
});
|
|
10547
|
+
} else this.matched.increment(opts.testId);
|
|
10548
|
+
} else {
|
|
10535
10549
|
this._addSnapshot(opts.key, opts.addValue, {
|
|
10536
10550
|
stack: opts.stack,
|
|
10537
10551
|
testId: opts.testId,
|
|
@@ -10952,7 +10966,7 @@ function raceWith(promise, other) {
|
|
|
10952
10966
|
}))]);
|
|
10953
10967
|
}
|
|
10954
10968
|
//#endregion
|
|
10955
|
-
//#region ../../../node_modules/.pnpm/vitest@4.1.
|
|
10969
|
+
//#region ../../../node_modules/.pnpm/vitest@4.1.11_@types+node@26.2.0_vite@7.3.2_@types+node@26.2.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.23.12_yaml@2.9.0_/node_modules/vitest/dist/chunks/test.DNmyFkvJ.js
|
|
10956
10970
|
var fakeTimersSrc = {};
|
|
10957
10971
|
var global$1;
|
|
10958
10972
|
var hasRequiredGlobal;
|
|
@@ -12034,7 +12048,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12034
12048
|
const originalPerfDescriptor = Object.getOwnPropertyDescriptor(target, method);
|
|
12035
12049
|
if (originalPerfDescriptor && originalPerfDescriptor.get && !originalPerfDescriptor.set) {
|
|
12036
12050
|
Object.defineProperty(clock, `_${method}`, originalPerfDescriptor);
|
|
12037
|
-
|
|
12051
|
+
const perfDescriptor = Object.getOwnPropertyDescriptor(clock, method);
|
|
12052
|
+
Object.defineProperty(target, method, perfDescriptor);
|
|
12038
12053
|
} else target[method] = clock[method];
|
|
12039
12054
|
} else {
|
|
12040
12055
|
target[method] = function() {
|
|
@@ -12469,7 +12484,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12469
12484
|
clock.next();
|
|
12470
12485
|
checkIsNearInfiniteLimit(clock, i);
|
|
12471
12486
|
}
|
|
12472
|
-
|
|
12487
|
+
const excessJob = firstTimer(clock);
|
|
12488
|
+
throw getInfiniteLoopError(clock, excessJob);
|
|
12473
12489
|
};
|
|
12474
12490
|
clock.runToFrame = function runToFrame() {
|
|
12475
12491
|
return clock.tick(getTimeToNextFrame());
|
|
@@ -12503,7 +12519,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12503
12519
|
checkIsNearInfiniteLimit(clock, i);
|
|
12504
12520
|
return;
|
|
12505
12521
|
}
|
|
12506
|
-
|
|
12522
|
+
const excessJob = firstTimer(clock);
|
|
12523
|
+
reject(getInfiniteLoopError(clock, excessJob));
|
|
12507
12524
|
} catch (e) {
|
|
12508
12525
|
reject(e);
|
|
12509
12526
|
}
|
|
@@ -12574,7 +12591,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12574
12591
|
return clock;
|
|
12575
12592
|
}
|
|
12576
12593
|
function createIntervalTick(clock, delta) {
|
|
12577
|
-
|
|
12594
|
+
const intervalTick = doIntervalTick.bind(null, clock, delta);
|
|
12595
|
+
clock.attachedInterval = originalSetInterval(intervalTick, delta);
|
|
12578
12596
|
}
|
|
12579
12597
|
/**
|
|
12580
12598
|
* @param {Config=} [config] Optional config
|
|
@@ -12664,10 +12682,12 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12664
12682
|
}
|
|
12665
12683
|
resolve(value);
|
|
12666
12684
|
}, delay);
|
|
12667
|
-
if (options.signal)
|
|
12668
|
-
|
|
12669
|
-
|
|
12670
|
-
|
|
12685
|
+
if (options.signal) {
|
|
12686
|
+
if (options.signal.aborted) abort();
|
|
12687
|
+
else {
|
|
12688
|
+
options.signal.addEventListener("abort", abort);
|
|
12689
|
+
clock.abortListenerMap.set(abort, options.signal);
|
|
12690
|
+
}
|
|
12671
12691
|
}
|
|
12672
12692
|
});
|
|
12673
12693
|
} else if (nameOfMethodToReplace === "setImmediate") {
|
|
@@ -12689,10 +12709,12 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12689
12709
|
}
|
|
12690
12710
|
resolve(value);
|
|
12691
12711
|
});
|
|
12692
|
-
if (options.signal)
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12712
|
+
if (options.signal) {
|
|
12713
|
+
if (options.signal.aborted) abort();
|
|
12714
|
+
else {
|
|
12715
|
+
options.signal.addEventListener("abort", abort);
|
|
12716
|
+
clock.abortListenerMap.set(abort, options.signal);
|
|
12717
|
+
}
|
|
12696
12718
|
}
|
|
12697
12719
|
});
|
|
12698
12720
|
} else if (nameOfMethodToReplace === "setInterval") {
|
|
@@ -12727,10 +12749,12 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12727
12749
|
done = true;
|
|
12728
12750
|
for (const resolvable of nextQueue) resolvable.resolve();
|
|
12729
12751
|
};
|
|
12730
|
-
if (options.signal)
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12752
|
+
if (options.signal) {
|
|
12753
|
+
if (options.signal.aborted) done = true;
|
|
12754
|
+
else {
|
|
12755
|
+
options.signal.addEventListener("abort", abort);
|
|
12756
|
+
clock.abortListenerMap.set(abort, options.signal);
|
|
12757
|
+
}
|
|
12734
12758
|
}
|
|
12735
12759
|
return {
|
|
12736
12760
|
next: async () => {
|
|
@@ -13570,7 +13594,7 @@ function createExpect(test) {
|
|
|
13570
13594
|
const { assertionCalls } = getState(expect$1);
|
|
13571
13595
|
setState({ assertionCalls: assertionCalls + 1 }, expect$1);
|
|
13572
13596
|
const assert = expect(value, message);
|
|
13573
|
-
const _test = test ||
|
|
13597
|
+
const _test = test || void 0;
|
|
13574
13598
|
if (_test) return assert.withTest(_test);
|
|
13575
13599
|
else return assert;
|
|
13576
13600
|
});
|
|
@@ -13629,154 +13653,6 @@ Object.defineProperty(globalThis, GLOBAL_EXPECT, {
|
|
|
13629
13653
|
configurable: true
|
|
13630
13654
|
});
|
|
13631
13655
|
//#endregion
|
|
13632
|
-
|
|
13633
|
-
let SOURCEMAPPING_URL = "sourceMa";
|
|
13634
|
-
SOURCEMAPPING_URL += "ppingURL";
|
|
13635
|
-
typeof process < "u" && process.platform;
|
|
13636
|
-
(async function() {}).constructor;
|
|
13637
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
|
|
13638
|
-
for (let i = 0; i < chars.length; i++) {
|
|
13639
|
-
let c = chars.charCodeAt(i);
|
|
13640
|
-
intToChar[i] = c, charToInt[c] = i;
|
|
13641
|
-
}
|
|
13642
|
-
`${SOURCEMAPPING_URL}`;
|
|
13643
|
-
const retrieveFileHandlers = /* @__PURE__ */ new Set(), retrieveSourceMapHandlers = /* @__PURE__ */ new Set(), createExecHandlers = (handlers) => ((...args) => {
|
|
13644
|
-
for (let handler of handlers) {
|
|
13645
|
-
let result = handler(...args);
|
|
13646
|
-
if (result) return result;
|
|
13647
|
-
}
|
|
13648
|
-
return null;
|
|
13649
|
-
});
|
|
13650
|
-
createExecHandlers(retrieveFileHandlers);
|
|
13651
|
-
createExecHandlers(retrieveSourceMapHandlers);
|
|
13652
|
-
Error.prepareStackTrace;
|
|
13653
|
-
const customizationHookNamespace = "vite-module-runner:import-meta-resolve/v1/";
|
|
13654
|
-
`${JSON.stringify(customizationHookNamespace)}${JSON.stringify(customizationHookNamespace)}`;
|
|
13655
|
-
`${customizationHookNamespace}`;
|
|
13656
|
-
new Proxy({}, { get(_, p) {
|
|
13657
|
-
throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`);
|
|
13658
|
-
} });
|
|
13659
|
-
//#endregion
|
|
13660
|
-
//#region ../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/branding.js
|
|
13661
|
-
var require_branding = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13662
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13663
|
-
}));
|
|
13664
|
-
//#endregion
|
|
13665
|
-
//#region ../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/messages.js
|
|
13666
|
-
var require_messages = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13667
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13668
|
-
}));
|
|
13669
|
-
//#endregion
|
|
13670
|
-
//#region ../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/overloads.js
|
|
13671
|
-
var require_overloads = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13672
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13673
|
-
}));
|
|
13674
|
-
//#endregion
|
|
13675
|
-
//#region ../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/utils.js
|
|
13676
|
-
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13677
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13678
|
-
}));
|
|
13679
|
-
//#endregion
|
|
13680
|
-
//#region ../../../node_modules/.pnpm/vitest@4.1.5_@types+node@25.6.0_vite@7.3.2_@types+node@25.6.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.21.0_yaml@2.9.0_/node_modules/vitest/dist/index.js
|
|
13681
|
-
var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13682
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
13683
|
-
if (k2 === void 0) k2 = k;
|
|
13684
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13685
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
13686
|
-
enumerable: true,
|
|
13687
|
-
get: function() {
|
|
13688
|
-
return m[k];
|
|
13689
|
-
}
|
|
13690
|
-
};
|
|
13691
|
-
Object.defineProperty(o, k2, desc);
|
|
13692
|
-
}) : (function(o, m, k, k2) {
|
|
13693
|
-
if (k2 === void 0) k2 = k;
|
|
13694
|
-
o[k2] = m[k];
|
|
13695
|
-
}));
|
|
13696
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
|
|
13697
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
|
|
13698
|
-
};
|
|
13699
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13700
|
-
exports.expectTypeOf = void 0;
|
|
13701
|
-
__exportStar(require_branding(), exports);
|
|
13702
|
-
__exportStar(require_messages(), exports);
|
|
13703
|
-
__exportStar(require_overloads(), exports);
|
|
13704
|
-
__exportStar(require_utils(), exports);
|
|
13705
|
-
const fn = () => true;
|
|
13706
|
-
/**
|
|
13707
|
-
* Similar to Jest's `expect`, but with type-awareness.
|
|
13708
|
-
* Gives you access to a number of type-matchers that let you make assertions about the
|
|
13709
|
-
* form of a reference or generic type parameter.
|
|
13710
|
-
*
|
|
13711
|
-
* @example
|
|
13712
|
-
* ```ts
|
|
13713
|
-
* import { foo, bar } from '../foo'
|
|
13714
|
-
* import { expectTypeOf } from 'expect-type'
|
|
13715
|
-
*
|
|
13716
|
-
* test('foo types', () => {
|
|
13717
|
-
* // make sure `foo` has type { a: number }
|
|
13718
|
-
* expectTypeOf(foo).toMatchTypeOf({ a: 1 })
|
|
13719
|
-
* expectTypeOf(foo).toHaveProperty('a').toBeNumber()
|
|
13720
|
-
*
|
|
13721
|
-
* // make sure `bar` is a function taking a string:
|
|
13722
|
-
* expectTypeOf(bar).parameter(0).toBeString()
|
|
13723
|
-
* expectTypeOf(bar).returns.not.toBeAny()
|
|
13724
|
-
* })
|
|
13725
|
-
* ```
|
|
13726
|
-
*
|
|
13727
|
-
* @description
|
|
13728
|
-
* See the [full docs](https://npmjs.com/package/expect-type#documentation) for lots more examples.
|
|
13729
|
-
*/
|
|
13730
|
-
const expectTypeOf = (_actual) => {
|
|
13731
|
-
const nonFunctionProperties = [
|
|
13732
|
-
"parameters",
|
|
13733
|
-
"returns",
|
|
13734
|
-
"resolves",
|
|
13735
|
-
"not",
|
|
13736
|
-
"items",
|
|
13737
|
-
"constructorParameters",
|
|
13738
|
-
"thisParameter",
|
|
13739
|
-
"instance",
|
|
13740
|
-
"guards",
|
|
13741
|
-
"asserts",
|
|
13742
|
-
"branded"
|
|
13743
|
-
];
|
|
13744
|
-
const obj = {
|
|
13745
|
-
toBeAny: fn,
|
|
13746
|
-
toBeUnknown: fn,
|
|
13747
|
-
toBeNever: fn,
|
|
13748
|
-
toBeFunction: fn,
|
|
13749
|
-
toBeObject: fn,
|
|
13750
|
-
toBeArray: fn,
|
|
13751
|
-
toBeString: fn,
|
|
13752
|
-
toBeNumber: fn,
|
|
13753
|
-
toBeBoolean: fn,
|
|
13754
|
-
toBeVoid: fn,
|
|
13755
|
-
toBeSymbol: fn,
|
|
13756
|
-
toBeNull: fn,
|
|
13757
|
-
toBeUndefined: fn,
|
|
13758
|
-
toBeNullable: fn,
|
|
13759
|
-
toBeBigInt: fn,
|
|
13760
|
-
toMatchTypeOf: fn,
|
|
13761
|
-
toEqualTypeOf: fn,
|
|
13762
|
-
toBeConstructibleWith: fn,
|
|
13763
|
-
toMatchObjectType: fn,
|
|
13764
|
-
toExtend: fn,
|
|
13765
|
-
map: exports.expectTypeOf,
|
|
13766
|
-
toBeCallableWith: exports.expectTypeOf,
|
|
13767
|
-
extract: exports.expectTypeOf,
|
|
13768
|
-
exclude: exports.expectTypeOf,
|
|
13769
|
-
pick: exports.expectTypeOf,
|
|
13770
|
-
omit: exports.expectTypeOf,
|
|
13771
|
-
toHaveProperty: exports.expectTypeOf,
|
|
13772
|
-
parameter: exports.expectTypeOf
|
|
13773
|
-
};
|
|
13774
|
-
nonFunctionProperties.forEach((prop) => Object.defineProperty(obj, prop, { get: () => (0, exports.expectTypeOf)({}) }));
|
|
13775
|
-
return obj;
|
|
13776
|
-
};
|
|
13777
|
-
exports.expectTypeOf = expectTypeOf;
|
|
13778
|
-
})))();
|
|
13779
|
-
//#endregion
|
|
13780
|
-
export { it as i, globalExpect as n, describe as r, import_dist as t };
|
|
13656
|
+
export { describe as n, it as r, globalExpect as t };
|
|
13781
13657
|
|
|
13782
|
-
//# sourceMappingURL=
|
|
13658
|
+
//# sourceMappingURL=test.DNmyFkvJ-N3QqMRwZ.mjs.map
|