@effect-uai/mistral 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Mistral.d.mts +6 -5
- package/dist/Mistral.d.mts.map +1 -1
- package/dist/Mistral.mjs +1 -1
- package/dist/Mistral.mjs.map +1 -1
- package/dist/MistralRealtimeTranscriber.d.mts +1 -3
- package/dist/MistralRealtimeTranscriber.d.mts.map +1 -1
- package/dist/MistralRealtimeTranscriber.mjs +1 -1
- package/dist/MistralRealtimeTranscriber.mjs.map +1 -1
- package/dist/MistralSynthesizer.d.mts +1 -3
- package/dist/MistralSynthesizer.d.mts.map +1 -1
- package/dist/MistralSynthesizer.mjs +4 -2
- package/dist/MistralSynthesizer.mjs.map +1 -1
- package/dist/MistralTranscriber.d.mts +1 -3
- package/dist/MistralTranscriber.d.mts.map +1 -1
- package/dist/MistralTranscriber.mjs +3 -2
- package/dist/MistralTranscriber.mjs.map +1 -1
- package/dist/audioCodec.d.mts +0 -1
- package/dist/audioCodec.d.mts.map +1 -1
- package/dist/audioCodec.mjs.map +1 -1
- package/dist/codec.d.mts +0 -2
- 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 +1 -1
- package/dist/codec.test.mjs.map +1 -1
- package/dist/http.d.mts +0 -1
- package/dist/http.d.mts.map +1 -1
- package/dist/http.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- 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-B1wZuvz5.d.mts → models-gP7kSqeb.d.mts} +1 -1
- package/dist/models-gP7kSqeb.d.mts.map +1 -0
- package/dist/models.d.mts +1 -1
- package/dist/onHalt.test.d.mts +1 -1
- package/dist/onHalt.test.mjs +1 -1
- package/dist/onHalt.test.mjs.map +1 -1
- package/dist/{realtimeStt-BFcctqFC.d.mts → realtimeStt-BcthMc57.d.mts} +3 -3
- package/dist/realtimeStt-BcthMc57.d.mts.map +1 -0
- package/dist/realtimeStt.d.mts +1 -1
- package/dist/realtimeStt.mjs.map +1 -1
- package/dist/{test.DNmyFkvJ-CPKukVWS.mjs → test.DNmyFkvJ-N3QqMRwZ.mjs} +247 -222
- package/dist/test.DNmyFkvJ-N3QqMRwZ.mjs.map +1 -0
- package/package.json +6 -6
- package/src/Mistral.ts +4 -7
- package/src/MistralRealtimeTranscriber.ts +4 -8
- package/src/MistralSynthesizer.ts +8 -12
- package/src/MistralTranscriber.ts +9 -11
- package/src/audioCodec.ts +25 -20
- package/dist/models-B1wZuvz5.d.mts.map +0 -1
- package/dist/realtimeStt-BFcctqFC.d.mts.map +0 -1
- package/dist/test.DNmyFkvJ-CPKukVWS.mjs.map +0 -1
- /package/dist/{chunk-CfYAbeIz.mjs → rolldown-runtime-D7D4PA-g.mjs} +0 -0
|
@@ -81,7 +81,7 @@ function C({ force: e } = {}) {
|
|
|
81
81
|
}
|
|
82
82
|
var y = C();
|
|
83
83
|
//#endregion
|
|
84
|
-
//#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
|
|
85
85
|
function _mergeNamespaces(n, m) {
|
|
86
86
|
m.forEach(function(e) {
|
|
87
87
|
e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
|
|
@@ -235,7 +235,7 @@ const plugin$5 = {
|
|
|
235
235
|
test: test$5
|
|
236
236
|
};
|
|
237
237
|
const SPACE$1 = " ";
|
|
238
|
-
const OBJECT_NAMES = new Set(["DOMStringMap", "NamedNodeMap"]);
|
|
238
|
+
const OBJECT_NAMES = /* @__PURE__ */ new Set(["DOMStringMap", "NamedNodeMap"]);
|
|
239
239
|
const ARRAY_REGEXP = /^(?:HTML\w*Collection|NodeList)$/;
|
|
240
240
|
function testName(name) {
|
|
241
241
|
return OBJECT_NAMES.has(name) || ARRAY_REGEXP.test(name);
|
|
@@ -526,7 +526,7 @@ function requireReactIs$1() {
|
|
|
526
526
|
return reactIs$1.exports;
|
|
527
527
|
}
|
|
528
528
|
var reactIsExports$1 = requireReactIs$1();
|
|
529
|
-
var ReactIs19 =
|
|
529
|
+
var ReactIs19 = /*#__PURE__*/ _mergeNamespaces({
|
|
530
530
|
__proto__: null,
|
|
531
531
|
default: /* @__PURE__ */ getDefaultExportFromCjs$2(reactIsExports$1)
|
|
532
532
|
}, [reactIsExports$1]);
|
|
@@ -638,7 +638,7 @@ function requireReactIs() {
|
|
|
638
638
|
return reactIs.exports;
|
|
639
639
|
}
|
|
640
640
|
var reactIsExports = requireReactIs();
|
|
641
|
-
var ReactIs18 =
|
|
641
|
+
var ReactIs18 = /*#__PURE__*/ _mergeNamespaces({
|
|
642
642
|
__proto__: null,
|
|
643
643
|
default: /* @__PURE__ */ getDefaultExportFromCjs$2(reactIsExports)
|
|
644
644
|
}, [reactIsExports]);
|
|
@@ -964,7 +964,7 @@ const plugins = {
|
|
|
964
964
|
Error: ErrorPlugin
|
|
965
965
|
};
|
|
966
966
|
//#endregion
|
|
967
|
-
//#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
|
|
968
968
|
const ansiColors$1 = {
|
|
969
969
|
bold: ["1", "22"],
|
|
970
970
|
dim: ["2", "22"],
|
|
@@ -1507,18 +1507,20 @@ function objDisplay$1(obj, options = {}) {
|
|
|
1507
1507
|
if (typeof options.truncate === "undefined") options.truncate = 40;
|
|
1508
1508
|
const str = inspect$2(obj, options);
|
|
1509
1509
|
const type = Object.prototype.toString.call(obj);
|
|
1510
|
-
if (options.truncate && str.length >= options.truncate)
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
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
|
+
}
|
|
1518
1520
|
return str;
|
|
1519
1521
|
}
|
|
1520
1522
|
//#endregion
|
|
1521
|
-
//#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
|
|
1522
1524
|
/**
|
|
1523
1525
|
* Get original stacktrace without source map support the most performant way.
|
|
1524
1526
|
* - Create only 1 stack frame.
|
|
@@ -1552,11 +1554,13 @@ function filterOutComments(s) {
|
|
|
1552
1554
|
if (s[i] === "\n") commentState = "none";
|
|
1553
1555
|
} else if (commentState === "multiline") {
|
|
1554
1556
|
if (s[i - 1] === "*" && s[i] === "/") commentState = "none";
|
|
1555
|
-
} else if (commentState === "none")
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
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
|
+
}
|
|
1560
1564
|
return result.join("");
|
|
1561
1565
|
}
|
|
1562
1566
|
function toArray(array) {
|
|
@@ -1680,7 +1684,7 @@ function getCallLastIndex(code) {
|
|
|
1680
1684
|
}
|
|
1681
1685
|
function isNegativeNaN(val) {
|
|
1682
1686
|
if (!Number.isNaN(val)) return false;
|
|
1683
|
-
const f64 = new Float64Array(1);
|
|
1687
|
+
const f64 = /* @__PURE__ */ new Float64Array(1);
|
|
1684
1688
|
f64[0] = val;
|
|
1685
1689
|
return new Uint32Array(f64.buffer)[1] >>> 31 === 1;
|
|
1686
1690
|
}
|
|
@@ -1974,7 +1978,6 @@ function diff_cleanupMerge(diffs) {
|
|
|
1974
1978
|
count_delete = 0;
|
|
1975
1979
|
text_delete = "";
|
|
1976
1980
|
text_insert = "";
|
|
1977
|
-
break;
|
|
1978
1981
|
}
|
|
1979
1982
|
if (diffs.at(-1)?.[1] === "") diffs.pop();
|
|
1980
1983
|
let changes = false;
|
|
@@ -2334,7 +2337,7 @@ function requireBuild() {
|
|
|
2334
2337
|
}
|
|
2335
2338
|
return build;
|
|
2336
2339
|
}
|
|
2337
|
-
var diffSequences =
|
|
2340
|
+
var diffSequences = /*@__PURE__*/ getDefaultExportFromCjs$1(/* @__PURE__ */ requireBuild());
|
|
2338
2341
|
function formatTrailingSpaces(line, trailingSpaceFormatter) {
|
|
2339
2342
|
return line.replace(/\s+$/, (match) => trailingSpaceFormatter(match));
|
|
2340
2343
|
}
|
|
@@ -2364,22 +2367,24 @@ function joinAlignedDiffsNoExpand(diffs, options) {
|
|
|
2364
2367
|
while (i !== iLength) {
|
|
2365
2368
|
const iStart = i;
|
|
2366
2369
|
while (i !== iLength && diffs[i][0] === 0) i += 1;
|
|
2367
|
-
if (iStart !== i)
|
|
2368
|
-
if (
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
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
|
+
}
|
|
2383
2388
|
}
|
|
2384
2389
|
}
|
|
2385
2390
|
while (i !== iLength && diffs[i][0] !== 0) i += 1;
|
|
@@ -2415,33 +2420,35 @@ function joinAlignedDiffsNoExpand(diffs, options) {
|
|
|
2415
2420
|
while (i !== iLength) {
|
|
2416
2421
|
let iStart = i;
|
|
2417
2422
|
while (i !== iLength && diffs[i][0] === 0) i += 1;
|
|
2418
|
-
if (iStart !== i)
|
|
2419
|
-
if (
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
} else {
|
|
2431
|
-
const nCommon = i - iStart;
|
|
2432
|
-
if (nCommon > nContextLines2) {
|
|
2433
|
-
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;
|
|
2434
2435
|
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
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
|
+
}
|
|
2445
2452
|
}
|
|
2446
2453
|
while (i !== iLength && diffs[i][0] === -1) {
|
|
2447
2454
|
pushDeleteLine(diffs[i][1]);
|
|
@@ -2520,9 +2527,7 @@ function countChanges(diffs) {
|
|
|
2520
2527
|
case -1:
|
|
2521
2528
|
a += 1;
|
|
2522
2529
|
break;
|
|
2523
|
-
case 1:
|
|
2524
|
-
b += 1;
|
|
2525
|
-
break;
|
|
2530
|
+
case 1: b += 1;
|
|
2526
2531
|
}
|
|
2527
2532
|
});
|
|
2528
2533
|
return {
|
|
@@ -2820,13 +2825,14 @@ const FALLBACK_FORMAT_OPTIONS = {
|
|
|
2820
2825
|
maxDepth: 8,
|
|
2821
2826
|
plugins: PLUGINS$1
|
|
2822
2827
|
};
|
|
2828
|
+
const DEFAULT_MEMORIZE = (_, v) => v;
|
|
2823
2829
|
/**
|
|
2824
2830
|
* @param a Expected value
|
|
2825
2831
|
* @param b Received value
|
|
2826
2832
|
* @param options Diff options
|
|
2827
2833
|
* @returns {string | null} a string diff
|
|
2828
2834
|
*/
|
|
2829
|
-
function diff(a, b, options) {
|
|
2835
|
+
function diff(a, b, options, memorize = DEFAULT_MEMORIZE) {
|
|
2830
2836
|
if (Object.is(a, b)) return "";
|
|
2831
2837
|
const aType = getType(a);
|
|
2832
2838
|
let expectedType = aType;
|
|
@@ -2846,23 +2852,29 @@ function diff(a, b, options) {
|
|
|
2846
2852
|
function truncate(s) {
|
|
2847
2853
|
return s.length <= MAX_LENGTH ? s : `${s.slice(0, MAX_LENGTH)}...`;
|
|
2848
2854
|
}
|
|
2849
|
-
aDisplay = truncate(aDisplay);
|
|
2850
|
-
bDisplay = truncate(bDisplay);
|
|
2855
|
+
aDisplay = memorize("expected", truncate(aDisplay));
|
|
2856
|
+
bDisplay = memorize("actual", truncate(bDisplay));
|
|
2851
2857
|
return `${`${aColor(`${aIndicator} ${aAnnotation}:`)}\n${aDisplay}`}\n\n${`${bColor(`${bIndicator} ${bAnnotation}:`)}\n${bDisplay}`}`;
|
|
2852
2858
|
}
|
|
2853
2859
|
if (omitDifference) return;
|
|
2854
2860
|
switch (aType) {
|
|
2855
2861
|
case "string": return diffLinesUnified(a.split("\n"), b.split("\n"), options);
|
|
2856
2862
|
case "boolean":
|
|
2857
|
-
case "number": return comparePrimitive(a, b, options);
|
|
2858
|
-
case "map": return compareObjects(sortMap(a), sortMap(b), options);
|
|
2859
|
-
case "set": return compareObjects(sortSet(a), sortSet(b), options);
|
|
2860
|
-
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);
|
|
2861
2867
|
}
|
|
2862
2868
|
}
|
|
2863
|
-
function
|
|
2864
|
-
|
|
2865
|
-
|
|
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));
|
|
2866
2878
|
return aFormat === bFormat ? "" : diffLinesUnified(aFormat.split("\n"), bFormat.split("\n"), options);
|
|
2867
2879
|
}
|
|
2868
2880
|
function sortMap(map) {
|
|
@@ -2871,21 +2883,24 @@ function sortMap(map) {
|
|
|
2871
2883
|
function sortSet(set) {
|
|
2872
2884
|
return new Set(Array.from(set.values()).sort());
|
|
2873
2885
|
}
|
|
2874
|
-
function compareObjects(a, b, options) {
|
|
2886
|
+
function compareObjects(a, b, options, memorize = DEFAULT_MEMORIZE) {
|
|
2875
2887
|
let difference;
|
|
2876
2888
|
let hasThrown = false;
|
|
2877
2889
|
try {
|
|
2878
|
-
difference = getObjectsDifference(a, b, getFormatOptions(FORMAT_OPTIONS, options), options);
|
|
2890
|
+
difference = getObjectsDifference(a, b, getFormatOptions(FORMAT_OPTIONS, options), options, memorize);
|
|
2879
2891
|
} catch {
|
|
2880
2892
|
hasThrown = true;
|
|
2881
2893
|
}
|
|
2882
2894
|
const noDiffMessage = getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
2883
2895
|
if (difference === void 0 || difference === noDiffMessage) {
|
|
2884
|
-
difference = getObjectsDifference(a, b, getFormatOptions(FALLBACK_FORMAT_OPTIONS, options), options);
|
|
2896
|
+
difference = getObjectsDifference(a, b, getFormatOptions(FALLBACK_FORMAT_OPTIONS, options), options, memorize);
|
|
2885
2897
|
if (difference !== noDiffMessage && !hasThrown) difference = `${getCommonMessage(SIMILAR_MESSAGE, options)}\n\n${difference}`;
|
|
2886
2898
|
}
|
|
2887
2899
|
return difference;
|
|
2888
2900
|
}
|
|
2901
|
+
function getDefaultFormatOptions(options) {
|
|
2902
|
+
return getFormatOptions(FORMAT_OPTIONS, options);
|
|
2903
|
+
}
|
|
2889
2904
|
function getFormatOptions(formatOptions, options) {
|
|
2890
2905
|
const { compareKeys, printBasicPrototype, maxDepth } = normalizeDiffOptions(options);
|
|
2891
2906
|
return {
|
|
@@ -2895,7 +2910,7 @@ function getFormatOptions(formatOptions, options) {
|
|
|
2895
2910
|
maxDepth: maxDepth ?? formatOptions.maxDepth
|
|
2896
2911
|
};
|
|
2897
2912
|
}
|
|
2898
|
-
function getObjectsDifference(a, b, formatOptions, options) {
|
|
2913
|
+
function getObjectsDifference(a, b, formatOptions, options, memorize = DEFAULT_MEMORIZE) {
|
|
2899
2914
|
const formatOptionsZeroIndent = {
|
|
2900
2915
|
...formatOptions,
|
|
2901
2916
|
indent: 0
|
|
@@ -2904,8 +2919,8 @@ function getObjectsDifference(a, b, formatOptions, options) {
|
|
|
2904
2919
|
const bCompare = format$1(b, formatOptionsZeroIndent);
|
|
2905
2920
|
if (aCompare === bCompare) return getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
2906
2921
|
else {
|
|
2907
|
-
const aDisplay = format$1(a, formatOptions);
|
|
2908
|
-
const bDisplay = format$1(b, formatOptions);
|
|
2922
|
+
const aDisplay = memorize("expected", format$1(a, formatOptions));
|
|
2923
|
+
const bDisplay = memorize("actual", format$1(b, formatOptions));
|
|
2909
2924
|
return diffLinesUnified2(aDisplay.split("\n"), bDisplay.split("\n"), aCompare.split("\n"), bCompare.split("\n"), options);
|
|
2910
2925
|
}
|
|
2911
2926
|
}
|
|
@@ -2917,7 +2932,7 @@ function isReplaceable(obj1, obj2) {
|
|
|
2917
2932
|
const obj1Type = getType$1(obj1);
|
|
2918
2933
|
return obj1Type === getType$1(obj2) && (obj1Type === "Object" || obj1Type === "Array");
|
|
2919
2934
|
}
|
|
2920
|
-
function printDiffOrStringify(received, expected, options) {
|
|
2935
|
+
function printDiffOrStringify(received, expected, options, memory) {
|
|
2921
2936
|
const { aAnnotation, bAnnotation } = normalizeDiffOptions(options);
|
|
2922
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) {
|
|
2923
2938
|
if (expected.includes("\n") || received.includes("\n")) return diffStringsUnified(expected, received, options);
|
|
@@ -2928,7 +2943,7 @@ function printDiffOrStringify(received, expected, options) {
|
|
|
2928
2943
|
}
|
|
2929
2944
|
const clonedExpected = deepClone(expected, { forceWritable: true });
|
|
2930
2945
|
const { replacedExpected, replacedActual } = replaceAsymmetricMatcher(deepClone(received, { forceWritable: true }), clonedExpected);
|
|
2931
|
-
return diff(replacedExpected, replacedActual, options);
|
|
2946
|
+
return diff(replacedExpected, replacedActual, options, memory ? createMemorize(memory) : DEFAULT_MEMORIZE);
|
|
2932
2947
|
}
|
|
2933
2948
|
function replaceAsymmetricMatcher(actual, expected, actualReplaced = /* @__PURE__ */ new WeakSet(), expectedReplaced = /* @__PURE__ */ new WeakSet()) {
|
|
2934
2949
|
if (actual instanceof Error && expected instanceof Error && typeof actual.cause !== "undefined" && typeof expected.cause === "undefined") {
|
|
@@ -2994,7 +3009,7 @@ function getCommonAndChangedSubstrings(diffs, op, hasCommonDiff) {
|
|
|
2994
3009
|
return diffs.reduce((reduced, diff) => reduced + (diff[0] === 0 ? diff[1] : diff[0] === op ? hasCommonDiff ? y.inverse(diff[1]) : diff[1] : ""), "");
|
|
2995
3010
|
}
|
|
2996
3011
|
//#endregion
|
|
2997
|
-
//#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
|
|
2998
3013
|
const IS_RECORD_SYMBOL$1 = "@@__IMMUTABLE_RECORD__@@";
|
|
2999
3014
|
const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
3000
3015
|
function isImmutable(v) {
|
|
@@ -3068,16 +3083,19 @@ function normalizeErrorMessage(message) {
|
|
|
3068
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");
|
|
3069
3084
|
}
|
|
3070
3085
|
//#endregion
|
|
3071
|
-
//#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
|
|
3072
3087
|
function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
|
|
3073
3088
|
if (!_err || typeof _err !== "object") return { message: String(_err) };
|
|
3074
3089
|
const err = _err;
|
|
3075
|
-
if (err.showDiff || err.showDiff === void 0 && err.expected !== void 0 && err.actual !== void 0)
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
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
|
+
}
|
|
3081
3099
|
try {
|
|
3082
3100
|
if (!seen.has(err) && typeof err.cause === "object") {
|
|
3083
3101
|
seen.add(err);
|
|
@@ -3090,8 +3108,12 @@ function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
|
|
|
3090
3108
|
return serializeValue(/* @__PURE__ */ new Error(`Failed to fully serialize error: ${e?.message}\nInner error message: ${err?.message}`));
|
|
3091
3109
|
}
|
|
3092
3110
|
}
|
|
3111
|
+
function prettifyValue(value, options) {
|
|
3112
|
+
if (typeof value !== "string") return format$1(value, getDefaultFormatOptions(options));
|
|
3113
|
+
return value;
|
|
3114
|
+
}
|
|
3093
3115
|
//#endregion
|
|
3094
|
-
//#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
|
|
3095
3117
|
const SAFE_TIMERS_SYMBOL = Symbol("vitest:SAFE_TIMERS");
|
|
3096
3118
|
function getSafeTimers() {
|
|
3097
3119
|
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
|
|
@@ -3125,7 +3147,7 @@ function delay(timeout, scheduler = setTimeout) {
|
|
|
3125
3147
|
return new Promise((resolve) => scheduler(resolve, timeout));
|
|
3126
3148
|
}
|
|
3127
3149
|
//#endregion
|
|
3128
|
-
//#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
|
|
3129
3151
|
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
3130
3152
|
function normalizeWindowsPath(input = "") {
|
|
3131
3153
|
if (!input) return input;
|
|
@@ -3204,11 +3226,11 @@ const isAbsolute = function(p) {
|
|
|
3204
3226
|
return _IS_ABSOLUTE_RE.test(p);
|
|
3205
3227
|
};
|
|
3206
3228
|
//#endregion
|
|
3207
|
-
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.
|
|
3229
|
+
//#region ../../../node_modules/.pnpm/@vitest+utils@4.1.11/node_modules/@vitest/utils/dist/source-map.js
|
|
3208
3230
|
var comma = ",".charCodeAt(0);
|
|
3209
3231
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
3210
|
-
var intToChar = new Uint8Array(64);
|
|
3211
|
-
var charToInt = new Uint8Array(128);
|
|
3232
|
+
var intToChar = /* @__PURE__ */ new Uint8Array(64);
|
|
3233
|
+
var charToInt = /* @__PURE__ */ new Uint8Array(128);
|
|
3212
3234
|
for (let i = 0; i < chars.length; i++) {
|
|
3213
3235
|
const c = chars.charCodeAt(i);
|
|
3214
3236
|
intToChar[i] = c;
|
|
@@ -3572,7 +3594,7 @@ function getOriginalPosition(map, needle) {
|
|
|
3572
3594
|
return result;
|
|
3573
3595
|
}
|
|
3574
3596
|
//#endregion
|
|
3575
|
-
//#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
|
|
3576
3598
|
var PendingError = class extends Error {
|
|
3577
3599
|
code = "VITEST_PENDING";
|
|
3578
3600
|
taskId;
|
|
@@ -3655,7 +3677,8 @@ var TestFixtures = class TestFixtures {
|
|
|
3655
3677
|
extend(runner, userFixtures) {
|
|
3656
3678
|
const { suite } = getCurrentSuite();
|
|
3657
3679
|
const isTopLevel = !suite || suite.file === suite;
|
|
3658
|
-
|
|
3680
|
+
const registrations = this.parseUserFixtures(runner, userFixtures, isTopLevel);
|
|
3681
|
+
return new TestFixtures(registrations);
|
|
3659
3682
|
}
|
|
3660
3683
|
get(suite) {
|
|
3661
3684
|
let currentSuite = suite;
|
|
@@ -3874,8 +3897,10 @@ function resolveDeps(usedFixtures, registrations, depSet = /* @__PURE__ */ new S
|
|
|
3874
3897
|
pendingFixtures.push(fixture);
|
|
3875
3898
|
return;
|
|
3876
3899
|
}
|
|
3877
|
-
if (depSet.has(fixture))
|
|
3878
|
-
|
|
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
|
+
}
|
|
3879
3904
|
depSet.add(fixture);
|
|
3880
3905
|
resolveDeps([...fixture.deps].map((n) => n === fixture.name ? fixture.parent : registrations.get(n)).filter((n) => !!n), registrations, depSet, pendingFixtures);
|
|
3881
3906
|
pendingFixtures.push(fixture);
|
|
@@ -3949,10 +3974,6 @@ function splitByComma(s) {
|
|
|
3949
3974
|
if (lastToken) result.push(lastToken);
|
|
3950
3975
|
return result;
|
|
3951
3976
|
}
|
|
3952
|
-
let _test;
|
|
3953
|
-
function getCurrentTest() {
|
|
3954
|
-
return _test;
|
|
3955
|
-
}
|
|
3956
3977
|
const kChainableContext = Symbol("kChainableContext");
|
|
3957
3978
|
function getChainableContext(chainable) {
|
|
3958
3979
|
return chainable?.[kChainableContext];
|
|
@@ -4099,14 +4120,6 @@ function afterEach(fn, timeout) {
|
|
|
4099
4120
|
};
|
|
4100
4121
|
return getCurrentSuite().on("afterEach", withTimeout(wrapper, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
4101
4122
|
}
|
|
4102
|
-
createTestHook("onTestFailed", (test, handler, timeout) => {
|
|
4103
|
-
test.onFailed ||= [];
|
|
4104
|
-
test.onFailed.push(withTimeout(handler, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
4105
|
-
});
|
|
4106
|
-
createTestHook("onTestFinished", (test, handler, timeout) => {
|
|
4107
|
-
test.onFinished ||= [];
|
|
4108
|
-
test.onFinished.push(withTimeout(handler, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
4109
|
-
});
|
|
4110
4123
|
/**
|
|
4111
4124
|
* Registers a callback function that wraps around all tests within the current suite.
|
|
4112
4125
|
* The callback receives a `runSuite` function that must be called to run the suite's tests.
|
|
@@ -4206,14 +4219,6 @@ function withSuiteFixtures(suiteHook, fn, context, stackTraceError, contextIndex
|
|
|
4206
4219
|
})();
|
|
4207
4220
|
};
|
|
4208
4221
|
}
|
|
4209
|
-
function createTestHook(name, handler) {
|
|
4210
|
-
return (fn, timeout) => {
|
|
4211
|
-
assertTypes(fn, `"${name}" callback`, ["function"]);
|
|
4212
|
-
const current = getCurrentTest();
|
|
4213
|
-
if (!current) throw new Error(`Hook ${name}() can only be called inside a test`);
|
|
4214
|
-
return handler(current, fn, timeout);
|
|
4215
|
-
};
|
|
4216
|
-
}
|
|
4217
4222
|
function findTestFileStackTrace(testFilePath, error) {
|
|
4218
4223
|
const lines = error.split("\n").slice(1);
|
|
4219
4224
|
for (const line of lines) {
|
|
@@ -4304,7 +4309,6 @@ const suite = createSuite();
|
|
|
4304
4309
|
* ```
|
|
4305
4310
|
*/
|
|
4306
4311
|
const test$2 = createTest(function(name, optionsOrFn, optionsOrTest) {
|
|
4307
|
-
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.");
|
|
4308
4312
|
getCurrentSuite().test.fn.call(this, formatName(name), optionsOrFn, optionsOrTest);
|
|
4309
4313
|
});
|
|
4310
4314
|
/**
|
|
@@ -4381,7 +4385,6 @@ function assert$3(condition, message) {
|
|
|
4381
4385
|
}
|
|
4382
4386
|
function getRunner() {
|
|
4383
4387
|
assert$3(runner, "the runner");
|
|
4384
|
-
return runner;
|
|
4385
4388
|
}
|
|
4386
4389
|
function getCurrentSuite() {
|
|
4387
4390
|
const currentSuite = collectorContext.currentSuite || defaultSuite;
|
|
@@ -4465,7 +4468,7 @@ function createSuiteCollector(name, factory = () => {}, mode, each, suiteOptions
|
|
|
4465
4468
|
};
|
|
4466
4469
|
const handler = options.handler;
|
|
4467
4470
|
if (task.mode === "run" && !handler) task.mode = "todo";
|
|
4468
|
-
if (options.concurrent
|
|
4471
|
+
if (options.concurrent ?? (!options.sequential && runner.config.sequence.concurrent)) task.concurrent = true;
|
|
4469
4472
|
task.shuffle = suiteOptions?.shuffle;
|
|
4470
4473
|
const context = createTestContext(task, runner);
|
|
4471
4474
|
Object.defineProperty(task, "context", {
|
|
@@ -4571,7 +4574,6 @@ function withAwaitAsyncAssertions(fn, task) {
|
|
|
4571
4574
|
}
|
|
4572
4575
|
function createSuite() {
|
|
4573
4576
|
function suiteFn(name, factoryOrOptions, optionsOrFactory) {
|
|
4574
|
-
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.");
|
|
4575
4577
|
const currentSuite = collectorContext.currentSuite || defaultSuite;
|
|
4576
4578
|
let { options, handler: factory } = parseArguments(factoryOrOptions, optionsOrFactory);
|
|
4577
4579
|
const isConcurrentSpecified = options.concurrent || this.concurrent || options.sequential === false;
|
|
@@ -4581,7 +4583,7 @@ function createSuite() {
|
|
|
4581
4583
|
...parentOptions,
|
|
4582
4584
|
...options
|
|
4583
4585
|
};
|
|
4584
|
-
const shuffle = this.shuffle ?? options.shuffle ?? currentSuite?.options?.shuffle ??
|
|
4586
|
+
const shuffle = this.shuffle ?? options.shuffle ?? currentSuite?.options?.shuffle ?? void 0;
|
|
4585
4587
|
if (shuffle != null) options.shuffle = shuffle;
|
|
4586
4588
|
let mode = this.only ?? options.only ? "only" : this.skip ?? options.skip ? "skip" : this.todo ?? options.todo ? "todo" : "run";
|
|
4587
4589
|
if (mode === "run" && !factory) mode = "todo";
|
|
@@ -4604,9 +4606,10 @@ function createSuite() {
|
|
|
4604
4606
|
const fnFirst = typeof optionsOrFn === "function";
|
|
4605
4607
|
cases.forEach((i, idx) => {
|
|
4606
4608
|
const items = Array.isArray(i) ? i : [i];
|
|
4607
|
-
if (fnFirst)
|
|
4608
|
-
|
|
4609
|
-
|
|
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);
|
|
4610
4613
|
else suite(formatTitle(_name, items, idx), options, handler ? () => handler(i) : void 0);
|
|
4611
4614
|
});
|
|
4612
4615
|
context.setContext("each", void 0);
|
|
@@ -4647,9 +4650,10 @@ function createTaskCollector(fn) {
|
|
|
4647
4650
|
const fnFirst = typeof optionsOrFn === "function";
|
|
4648
4651
|
cases.forEach((i, idx) => {
|
|
4649
4652
|
const items = Array.isArray(i) ? i : [i];
|
|
4650
|
-
if (fnFirst)
|
|
4651
|
-
|
|
4652
|
-
|
|
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);
|
|
4653
4657
|
else test(formatTitle(_name, items, idx), options, handler ? () => handler(i) : void 0);
|
|
4654
4658
|
});
|
|
4655
4659
|
context.setContext("each", void 0);
|
|
@@ -4773,7 +4777,7 @@ function formatTitle(template, items, idx) {
|
|
|
4773
4777
|
const isArrayKey = /^\d+$/.test(key);
|
|
4774
4778
|
if (!isObjectItem && !isArrayKey) return `$${key}`;
|
|
4775
4779
|
const arrayElement = isArrayKey ? objectAttr(items, key) : void 0;
|
|
4776
|
-
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 });
|
|
4777
4781
|
});
|
|
4778
4782
|
}
|
|
4779
4783
|
let output = "";
|
|
@@ -4942,7 +4946,7 @@ function makeTimeoutError(isHook, timeout, stackTraceError) {
|
|
|
4942
4946
|
}
|
|
4943
4947
|
globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
4944
4948
|
globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
4945
|
-
|
|
4949
|
+
Date.now;
|
|
4946
4950
|
const { clearTimeout, setTimeout: setTimeout$1 } = getSafeTimers();
|
|
4947
4951
|
const packs = /* @__PURE__ */ new Map();
|
|
4948
4952
|
const eventsPacks = [];
|
|
@@ -4969,21 +4973,6 @@ async function finishSendTasksUpdate(runner) {
|
|
|
4969
4973
|
sendTasksUpdate(runner);
|
|
4970
4974
|
await Promise.all(pendingTasksUpdates);
|
|
4971
4975
|
}
|
|
4972
|
-
function throttle(fn, ms) {
|
|
4973
|
-
let last = 0;
|
|
4974
|
-
let pendingCall;
|
|
4975
|
-
return function call(...args) {
|
|
4976
|
-
const now = unixNow();
|
|
4977
|
-
if (now - last > ms) {
|
|
4978
|
-
last = now;
|
|
4979
|
-
clearTimeout(pendingCall);
|
|
4980
|
-
pendingCall = void 0;
|
|
4981
|
-
return fn.apply(this, args);
|
|
4982
|
-
}
|
|
4983
|
-
pendingCall ??= setTimeout$1(() => call.bind(this)(...args), ms);
|
|
4984
|
-
};
|
|
4985
|
-
}
|
|
4986
|
-
throttle(sendTasksUpdate, 100);
|
|
4987
4976
|
/**
|
|
4988
4977
|
* @experimental
|
|
4989
4978
|
* @advanced
|
|
@@ -5106,7 +5095,7 @@ function manageArtifactAttachment(attachment) {
|
|
|
5106
5095
|
if (attachment.body != null) attachment.bodyEncoding ??= "base64";
|
|
5107
5096
|
}
|
|
5108
5097
|
//#endregion
|
|
5109
|
-
//#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
|
|
5110
5099
|
const NAME_WORKER_STATE = "__vitest_worker__";
|
|
5111
5100
|
function getWorkerState() {
|
|
5112
5101
|
const workerState = globalThis[NAME_WORKER_STATE];
|
|
@@ -5146,7 +5135,7 @@ async function waitForImportsToResolve() {
|
|
|
5146
5135
|
await waitForImportsToResolve();
|
|
5147
5136
|
}
|
|
5148
5137
|
//#endregion
|
|
5149
|
-
//#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
|
|
5150
5139
|
function isMockFunction(fn) {
|
|
5151
5140
|
return typeof fn === "function" && "_isMockFunction" in fn && fn._isMockFunction === true;
|
|
5152
5141
|
}
|
|
@@ -5470,7 +5459,7 @@ function copyOriginalStaticProperties(mock, original) {
|
|
|
5470
5459
|
Object.defineProperty(mock, key, descriptor);
|
|
5471
5460
|
}
|
|
5472
5461
|
}
|
|
5473
|
-
const ignoreProperties = new Set([
|
|
5462
|
+
const ignoreProperties = /* @__PURE__ */ new Set([
|
|
5474
5463
|
"length",
|
|
5475
5464
|
"name",
|
|
5476
5465
|
"prototype",
|
|
@@ -6266,13 +6255,14 @@ function inspect2(obj, showHidden, depth, colors) {
|
|
|
6266
6255
|
__name(inspect2, "inspect");
|
|
6267
6256
|
function objDisplay(obj) {
|
|
6268
6257
|
let str = inspect2(obj), type3 = Object.prototype.toString.call(obj);
|
|
6269
|
-
if (config.truncateThreshold && str.length >= config.truncateThreshold)
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
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;
|
|
6274
6265
|
} else return str;
|
|
6275
|
-
else return str;
|
|
6276
6266
|
}
|
|
6277
6267
|
__name(objDisplay, "objDisplay");
|
|
6278
6268
|
function getMessage2(obj, args) {
|
|
@@ -6955,7 +6945,8 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
6955
6945
|
Object.setPrototypeOf(chainableMethodWrapper, prototype);
|
|
6956
6946
|
} else Object.getOwnPropertyNames(ctx).forEach(function(asserterName) {
|
|
6957
6947
|
if (excludeNames.indexOf(asserterName) !== -1) return;
|
|
6958
|
-
|
|
6948
|
+
let pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
|
|
6949
|
+
Object.defineProperty(chainableMethodWrapper, asserterName, pd);
|
|
6959
6950
|
});
|
|
6960
6951
|
transferFlags(this, chainableMethodWrapper);
|
|
6961
6952
|
return proxify(chainableMethodWrapper);
|
|
@@ -7587,17 +7578,23 @@ function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
|
7587
7578
|
}
|
|
7588
7579
|
if (errorLike && caughtErr) {
|
|
7589
7580
|
if (errorLike instanceof Error) {
|
|
7590
|
-
if (check_error_exports.compatibleInstance(caughtErr, errorLike) === negate)
|
|
7591
|
-
|
|
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));
|
|
7592
7589
|
}
|
|
7593
|
-
if (check_error_exports.compatibleConstructor(caughtErr, errorLike) === negate) if (everyArgIsDefined && negate) errorLikeFail = true;
|
|
7594
|
-
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));
|
|
7595
7590
|
}
|
|
7596
7591
|
if (caughtErr && errMsgMatcher !== void 0 && errMsgMatcher !== null) {
|
|
7597
7592
|
let placeholder = "including";
|
|
7598
7593
|
if (isRegExp2(errMsgMatcher)) placeholder = "matching";
|
|
7599
|
-
if (check_error_exports.compatibleMessage(caughtErr, errMsgMatcher) === negate)
|
|
7600
|
-
|
|
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
|
+
}
|
|
7601
7598
|
}
|
|
7602
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));
|
|
7603
7600
|
flag2(this, "object", caughtErr);
|
|
@@ -7827,8 +7824,10 @@ function compareSubset(expected, actual) {
|
|
|
7827
7824
|
});
|
|
7828
7825
|
});
|
|
7829
7826
|
}
|
|
7830
|
-
if (expected instanceof Date)
|
|
7831
|
-
|
|
7827
|
+
if (expected instanceof Date) {
|
|
7828
|
+
if (actual instanceof Date) return expected.getTime() === actual.getTime();
|
|
7829
|
+
else return false;
|
|
7830
|
+
}
|
|
7832
7831
|
return Object.keys(expected).every(function(key) {
|
|
7833
7832
|
let expectedValue = expected[key];
|
|
7834
7833
|
let actualValue = actual[key];
|
|
@@ -8499,7 +8498,7 @@ function use(fn) {
|
|
|
8499
8498
|
}
|
|
8500
8499
|
__name(use, "use");
|
|
8501
8500
|
//#endregion
|
|
8502
|
-
//#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
|
|
8503
8502
|
const ChaiStyleAssertions = (chai, utils) => {
|
|
8504
8503
|
function defProperty(name, delegateTo) {
|
|
8505
8504
|
utils.addProperty(chai.Assertion.prototype, name, function() {
|
|
@@ -9338,8 +9337,12 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9338
9337
|
if (promise === "rejects") utils.flag(this, "object", () => {
|
|
9339
9338
|
throw object;
|
|
9340
9339
|
});
|
|
9341
|
-
else if (promise === "resolves" && typeof object !== "function")
|
|
9342
|
-
|
|
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
|
+
}
|
|
9343
9346
|
_super.apply(this, args);
|
|
9344
9347
|
};
|
|
9345
9348
|
});
|
|
@@ -9398,7 +9401,8 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9398
9401
|
actualSubset,
|
|
9399
9402
|
false
|
|
9400
9403
|
]);
|
|
9401
|
-
|
|
9404
|
+
const message = stripped === 0 ? msg : `${msg}\n(${stripped} matching ${stripped === 1 ? "property" : "properties"} omitted from actual)`;
|
|
9405
|
+
throw new AssertionError(message, {
|
|
9402
9406
|
showDiff: true,
|
|
9403
9407
|
expected,
|
|
9404
9408
|
actual: actualSubset
|
|
@@ -9631,9 +9635,12 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9631
9635
|
const isNot = utils.flag(this, "negate");
|
|
9632
9636
|
let thrown = null;
|
|
9633
9637
|
if (promise === "rejects") thrown = obj;
|
|
9634
|
-
else if (promise === "resolves" && typeof obj !== "function")
|
|
9635
|
-
|
|
9636
|
-
|
|
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 {
|
|
9637
9644
|
let isThrow = false;
|
|
9638
9645
|
try {
|
|
9639
9646
|
obj();
|
|
@@ -9641,7 +9648,10 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9641
9648
|
isThrow = true;
|
|
9642
9649
|
thrown = err;
|
|
9643
9650
|
}
|
|
9644
|
-
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
|
+
}
|
|
9645
9655
|
}
|
|
9646
9656
|
if (typeof expected === "function") {
|
|
9647
9657
|
const name = expected.name || expected.prototype.constructor.name;
|
|
@@ -9711,7 +9721,8 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9711
9721
|
`expected "${spyName}" to not ${action} with: #{exp}`,
|
|
9712
9722
|
value
|
|
9713
9723
|
]);
|
|
9714
|
-
|
|
9724
|
+
const results = action === "return" ? spy.mock.results : spy.mock.settledResults;
|
|
9725
|
+
throw new AssertionError(formatReturns(spy, results, msg, value));
|
|
9715
9726
|
}
|
|
9716
9727
|
});
|
|
9717
9728
|
});
|
|
@@ -9777,7 +9788,7 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9777
9788
|
if (typeof result !== "function") return result instanceof chai.Assertion ? proxy : result;
|
|
9778
9789
|
return (...args) => {
|
|
9779
9790
|
utils.flag(this, "_name", key);
|
|
9780
|
-
|
|
9791
|
+
const promise = Promise.resolve(obj).then((value) => {
|
|
9781
9792
|
utils.flag(this, "object", value);
|
|
9782
9793
|
return result.call(this, ...args);
|
|
9783
9794
|
}, (err) => {
|
|
@@ -9787,7 +9798,8 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9787
9798
|
}).catch((err) => {
|
|
9788
9799
|
if (isError(err) && error.stack) err.stack = error.stack.replace(error.message, err.message);
|
|
9789
9800
|
throw err;
|
|
9790
|
-
})
|
|
9801
|
+
});
|
|
9802
|
+
return recordAsyncExpect(test, promise, createAssertionMessage(utils, this, !!args.length), error, utils.flag(this, "soft"));
|
|
9791
9803
|
};
|
|
9792
9804
|
} });
|
|
9793
9805
|
return proxy;
|
|
@@ -9806,7 +9818,7 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9806
9818
|
if (typeof result !== "function") return result instanceof chai.Assertion ? proxy : result;
|
|
9807
9819
|
return (...args) => {
|
|
9808
9820
|
utils.flag(this, "_name", key);
|
|
9809
|
-
|
|
9821
|
+
const promise = Promise.resolve(wrapper).then((value) => {
|
|
9810
9822
|
throw new AssertionError(`promise resolved "${utils.inspect(value)}" instead of rejecting`, {
|
|
9811
9823
|
showDiff: true,
|
|
9812
9824
|
expected: /* @__PURE__ */ new Error("rejected promise"),
|
|
@@ -9818,7 +9830,8 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
9818
9830
|
}).catch((err) => {
|
|
9819
9831
|
if (isError(err) && error.stack) err.stack = error.stack.replace(error.message, err.message);
|
|
9820
9832
|
throw err;
|
|
9821
|
-
})
|
|
9833
|
+
});
|
|
9834
|
+
return recordAsyncExpect(test, promise, createAssertionMessage(utils, this, !!args.length), error, utils.flag(this, "soft"));
|
|
9822
9835
|
};
|
|
9823
9836
|
} });
|
|
9824
9837
|
return proxy;
|
|
@@ -9961,7 +9974,7 @@ const JestExtend = (chai, utils) => {
|
|
|
9961
9974
|
});
|
|
9962
9975
|
};
|
|
9963
9976
|
//#endregion
|
|
9964
|
-
//#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
|
|
9965
9978
|
const lineSplitRE = /\r?\n/;
|
|
9966
9979
|
function positionToOffset(source, lineNumber, columnNumber) {
|
|
9967
9980
|
const lines = source.split(lineSplitRE);
|
|
@@ -9985,10 +9998,10 @@ function offsetToLineNumber(source, offset) {
|
|
|
9985
9998
|
return line + 1;
|
|
9986
9999
|
}
|
|
9987
10000
|
//#endregion
|
|
9988
|
-
//#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
|
|
9989
10002
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
9990
10003
|
//#endregion
|
|
9991
|
-
//#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
|
|
9992
10005
|
const RealDate = Date;
|
|
9993
10006
|
let now = null;
|
|
9994
10007
|
var MockDate = class MockDate extends RealDate {
|
|
@@ -10010,7 +10023,6 @@ var MockDate = class MockDate extends RealDate {
|
|
|
10010
10023
|
s = s || 0;
|
|
10011
10024
|
ms = ms || 0;
|
|
10012
10025
|
date = new RealDate(y, m, d, h, M, s, ms);
|
|
10013
|
-
break;
|
|
10014
10026
|
}
|
|
10015
10027
|
Object.setPrototypeOf(date, MockDate.prototype);
|
|
10016
10028
|
return date;
|
|
@@ -10037,7 +10049,7 @@ function resetDate() {
|
|
|
10037
10049
|
}
|
|
10038
10050
|
const { get } = Reflect;
|
|
10039
10051
|
//#endregion
|
|
10040
|
-
//#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
|
|
10041
10053
|
function getDefaultExportFromCjs(x) {
|
|
10042
10054
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
10043
10055
|
}
|
|
@@ -10082,7 +10094,7 @@ function requireNaturalCompare() {
|
|
|
10082
10094
|
}
|
|
10083
10095
|
return naturalCompare$1.exports;
|
|
10084
10096
|
}
|
|
10085
|
-
var naturalCompare =
|
|
10097
|
+
var naturalCompare = /*@__PURE__*/ getDefaultExportFromCjs(requireNaturalCompare());
|
|
10086
10098
|
const serialize$1 = (val, config, indentation, depth, refs, printer) => {
|
|
10087
10099
|
const name = val.getMockName();
|
|
10088
10100
|
const nameString = name === "vi.fn()" ? "" : ` ${name}`;
|
|
@@ -10195,9 +10207,10 @@ function deepMergeSnapshot(target, source) {
|
|
|
10195
10207
|
if (isObject(target) && isObject(source)) {
|
|
10196
10208
|
const mergedOutput = { ...target };
|
|
10197
10209
|
Object.keys(source).forEach((key) => {
|
|
10198
|
-
if (isObject(source[key]) && !source[key].$$typeof)
|
|
10199
|
-
|
|
10200
|
-
|
|
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]);
|
|
10201
10214
|
else Object.assign(mergedOutput, { [key]: source[key] });
|
|
10202
10215
|
});
|
|
10203
10216
|
return mergedOutput;
|
|
@@ -10242,7 +10255,7 @@ function memo(fn) {
|
|
|
10242
10255
|
};
|
|
10243
10256
|
}
|
|
10244
10257
|
async function saveInlineSnapshots(environment, snapshots) {
|
|
10245
|
-
const MagicString = (await import("./magic-string.es-
|
|
10258
|
+
const MagicString = (await import("./magic-string.es-CUAnjKYC.mjs")).default;
|
|
10246
10259
|
const files = new Set(snapshots.map((i) => i.file));
|
|
10247
10260
|
await Promise.all(Array.from(files).map(async (file) => {
|
|
10248
10261
|
const snaps = snapshots.filter((i) => i.file === file);
|
|
@@ -10424,7 +10437,8 @@ var SnapshotState = class SnapshotState {
|
|
|
10424
10437
|
}
|
|
10425
10438
|
static async create(testFilePath, options) {
|
|
10426
10439
|
const snapshotPath = await options.snapshotEnvironment.resolvePath(testFilePath);
|
|
10427
|
-
|
|
10440
|
+
const content = await options.snapshotEnvironment.readSnapshotFile(snapshotPath);
|
|
10441
|
+
return new SnapshotState(testFilePath, snapshotPath, content, options);
|
|
10428
10442
|
}
|
|
10429
10443
|
get snapshotUpdateState() {
|
|
10430
10444
|
return this._updateSnapshot;
|
|
@@ -10520,17 +10534,18 @@ var SnapshotState = class SnapshotState {
|
|
|
10520
10534
|
}
|
|
10521
10535
|
_reconcile(opts) {
|
|
10522
10536
|
if (opts.hasSnapshot && this._updateSnapshot === "all" || (!opts.hasSnapshot || !opts.snapshotIsPersisted) && (this._updateSnapshot === "new" || this._updateSnapshot === "all")) {
|
|
10523
|
-
if (this._updateSnapshot === "all")
|
|
10524
|
-
if (opts.
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
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 {
|
|
10534
10549
|
this._addSnapshot(opts.key, opts.addValue, {
|
|
10535
10550
|
stack: opts.stack,
|
|
10536
10551
|
testId: opts.testId,
|
|
@@ -10951,7 +10966,7 @@ function raceWith(promise, other) {
|
|
|
10951
10966
|
}))]);
|
|
10952
10967
|
}
|
|
10953
10968
|
//#endregion
|
|
10954
|
-
//#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
|
|
10955
10970
|
var fakeTimersSrc = {};
|
|
10956
10971
|
var global$1;
|
|
10957
10972
|
var hasRequiredGlobal;
|
|
@@ -12033,7 +12048,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12033
12048
|
const originalPerfDescriptor = Object.getOwnPropertyDescriptor(target, method);
|
|
12034
12049
|
if (originalPerfDescriptor && originalPerfDescriptor.get && !originalPerfDescriptor.set) {
|
|
12035
12050
|
Object.defineProperty(clock, `_${method}`, originalPerfDescriptor);
|
|
12036
|
-
|
|
12051
|
+
const perfDescriptor = Object.getOwnPropertyDescriptor(clock, method);
|
|
12052
|
+
Object.defineProperty(target, method, perfDescriptor);
|
|
12037
12053
|
} else target[method] = clock[method];
|
|
12038
12054
|
} else {
|
|
12039
12055
|
target[method] = function() {
|
|
@@ -12468,7 +12484,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12468
12484
|
clock.next();
|
|
12469
12485
|
checkIsNearInfiniteLimit(clock, i);
|
|
12470
12486
|
}
|
|
12471
|
-
|
|
12487
|
+
const excessJob = firstTimer(clock);
|
|
12488
|
+
throw getInfiniteLoopError(clock, excessJob);
|
|
12472
12489
|
};
|
|
12473
12490
|
clock.runToFrame = function runToFrame() {
|
|
12474
12491
|
return clock.tick(getTimeToNextFrame());
|
|
@@ -12502,7 +12519,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12502
12519
|
checkIsNearInfiniteLimit(clock, i);
|
|
12503
12520
|
return;
|
|
12504
12521
|
}
|
|
12505
|
-
|
|
12522
|
+
const excessJob = firstTimer(clock);
|
|
12523
|
+
reject(getInfiniteLoopError(clock, excessJob));
|
|
12506
12524
|
} catch (e) {
|
|
12507
12525
|
reject(e);
|
|
12508
12526
|
}
|
|
@@ -12573,7 +12591,8 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12573
12591
|
return clock;
|
|
12574
12592
|
}
|
|
12575
12593
|
function createIntervalTick(clock, delta) {
|
|
12576
|
-
|
|
12594
|
+
const intervalTick = doIntervalTick.bind(null, clock, delta);
|
|
12595
|
+
clock.attachedInterval = originalSetInterval(intervalTick, delta);
|
|
12577
12596
|
}
|
|
12578
12597
|
/**
|
|
12579
12598
|
* @param {Config=} [config] Optional config
|
|
@@ -12663,10 +12682,12 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12663
12682
|
}
|
|
12664
12683
|
resolve(value);
|
|
12665
12684
|
}, delay);
|
|
12666
|
-
if (options.signal)
|
|
12667
|
-
|
|
12668
|
-
|
|
12669
|
-
|
|
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
|
+
}
|
|
12670
12691
|
}
|
|
12671
12692
|
});
|
|
12672
12693
|
} else if (nameOfMethodToReplace === "setImmediate") {
|
|
@@ -12688,10 +12709,12 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12688
12709
|
}
|
|
12689
12710
|
resolve(value);
|
|
12690
12711
|
});
|
|
12691
|
-
if (options.signal)
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
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
|
+
}
|
|
12695
12718
|
}
|
|
12696
12719
|
});
|
|
12697
12720
|
} else if (nameOfMethodToReplace === "setInterval") {
|
|
@@ -12726,10 +12749,12 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`);
|
|
|
12726
12749
|
done = true;
|
|
12727
12750
|
for (const resolvable of nextQueue) resolvable.resolve();
|
|
12728
12751
|
};
|
|
12729
|
-
if (options.signal)
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
|
|
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
|
+
}
|
|
12733
12758
|
}
|
|
12734
12759
|
return {
|
|
12735
12760
|
next: async () => {
|
|
@@ -13569,7 +13594,7 @@ function createExpect(test) {
|
|
|
13569
13594
|
const { assertionCalls } = getState(expect$1);
|
|
13570
13595
|
setState({ assertionCalls: assertionCalls + 1 }, expect$1);
|
|
13571
13596
|
const assert = expect(value, message);
|
|
13572
|
-
const _test = test ||
|
|
13597
|
+
const _test = test || void 0;
|
|
13573
13598
|
if (_test) return assert.withTest(_test);
|
|
13574
13599
|
else return assert;
|
|
13575
13600
|
});
|
|
@@ -13630,4 +13655,4 @@ Object.defineProperty(globalThis, GLOBAL_EXPECT, {
|
|
|
13630
13655
|
//#endregion
|
|
13631
13656
|
export { describe as n, it as r, globalExpect as t };
|
|
13632
13657
|
|
|
13633
|
-
//# sourceMappingURL=test.DNmyFkvJ-
|
|
13658
|
+
//# sourceMappingURL=test.DNmyFkvJ-N3QqMRwZ.mjs.map
|