@mastra/evals 0.14.0-alpha.0 → 0.14.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/CHANGELOG.md +32 -0
- package/dist/{dist-PGA5XTSX.cjs → dist-IEBPVOY3.cjs} +1199 -1207
- package/dist/dist-IEBPVOY3.cjs.map +1 -0
- package/dist/{dist-EKFCQ7IX.js → dist-U76IQBNC.js} +1199 -1207
- package/dist/dist-U76IQBNC.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{magic-string.es-NZ2XWFKN.cjs → magic-string.es-VZN2EYER.cjs} +5 -20
- package/dist/magic-string.es-VZN2EYER.cjs.map +1 -0
- package/dist/{magic-string.es-7ORA5OGR.js → magic-string.es-WQRLTQPQ.js} +5 -20
- package/dist/magic-string.es-WQRLTQPQ.js.map +1 -0
- package/package.json +4 -4
- package/dist/dist-EKFCQ7IX.js.map +0 -1
- package/dist/dist-PGA5XTSX.cjs.map +0 -1
- package/dist/magic-string.es-7ORA5OGR.js.map +0 -1
- package/dist/magic-string.es-NZ2XWFKN.cjs.map +0 -1
|
@@ -420,49 +420,49 @@ var require_js_tokens = __commonJS({
|
|
|
420
420
|
}
|
|
421
421
|
});
|
|
422
422
|
|
|
423
|
-
// ../../node_modules/.pnpm/expect-type@1.2.
|
|
423
|
+
// ../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/branding.js
|
|
424
424
|
var require_branding = __commonJS({
|
|
425
|
-
"../../node_modules/.pnpm/expect-type@1.2.
|
|
425
|
+
"../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/branding.js"(exports) {
|
|
426
426
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
427
427
|
}
|
|
428
428
|
});
|
|
429
429
|
|
|
430
|
-
// ../../node_modules/.pnpm/expect-type@1.2.
|
|
430
|
+
// ../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/messages.js
|
|
431
431
|
var require_messages = __commonJS({
|
|
432
|
-
"../../node_modules/.pnpm/expect-type@1.2.
|
|
432
|
+
"../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/messages.js"(exports) {
|
|
433
433
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
434
434
|
}
|
|
435
435
|
});
|
|
436
436
|
|
|
437
|
-
// ../../node_modules/.pnpm/expect-type@1.2.
|
|
437
|
+
// ../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/overloads.js
|
|
438
438
|
var require_overloads = __commonJS({
|
|
439
|
-
"../../node_modules/.pnpm/expect-type@1.2.
|
|
439
|
+
"../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/overloads.js"(exports) {
|
|
440
440
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
441
441
|
}
|
|
442
442
|
});
|
|
443
443
|
|
|
444
|
-
// ../../node_modules/.pnpm/expect-type@1.2.
|
|
444
|
+
// ../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/utils.js
|
|
445
445
|
var require_utils = __commonJS({
|
|
446
|
-
"../../node_modules/.pnpm/expect-type@1.2.
|
|
446
|
+
"../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/utils.js"(exports) {
|
|
447
447
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
448
448
|
}
|
|
449
449
|
});
|
|
450
450
|
|
|
451
|
-
// ../../node_modules/.pnpm/expect-type@1.2.
|
|
451
|
+
// ../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/index.js
|
|
452
452
|
var require_dist = __commonJS({
|
|
453
|
-
"../../node_modules/.pnpm/expect-type@1.2.
|
|
454
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m2,
|
|
455
|
-
if (
|
|
456
|
-
var desc = Object.getOwnPropertyDescriptor(m2,
|
|
453
|
+
"../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/index.js"(exports) {
|
|
454
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m2, k, k2) {
|
|
455
|
+
if (k2 === void 0) k2 = k;
|
|
456
|
+
var desc = Object.getOwnPropertyDescriptor(m2, k);
|
|
457
457
|
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
458
458
|
desc = { enumerable: true, get: function() {
|
|
459
|
-
return m2[
|
|
459
|
+
return m2[k];
|
|
460
460
|
} };
|
|
461
461
|
}
|
|
462
|
-
Object.defineProperty(o,
|
|
463
|
-
}) : (function(o, m2,
|
|
464
|
-
if (
|
|
465
|
-
o[
|
|
462
|
+
Object.defineProperty(o, k2, desc);
|
|
463
|
+
}) : (function(o, m2, k, k2) {
|
|
464
|
+
if (k2 === void 0) k2 = k;
|
|
465
|
+
o[k2] = m2[k];
|
|
466
466
|
}));
|
|
467
467
|
var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
|
|
468
468
|
for (var p3 in m2) if (p3 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p3)) __createBinding(exports2, m2, p3);
|
|
@@ -583,27 +583,27 @@ function C(n = false) {
|
|
|
583
583
|
}
|
|
584
584
|
function p(n = false) {
|
|
585
585
|
let e = C(n), i = (r2, t, c, o) => {
|
|
586
|
-
let
|
|
586
|
+
let l = "", s2 = 0;
|
|
587
587
|
do
|
|
588
|
-
|
|
588
|
+
l += r2.substring(s2, o) + c, s2 = o + t.length, o = r2.indexOf(t, s2);
|
|
589
589
|
while (~o);
|
|
590
|
-
return
|
|
590
|
+
return l + r2.substring(s2);
|
|
591
591
|
}, g = (r2, t, c = r2) => {
|
|
592
|
-
let o = (
|
|
593
|
-
let s2 = String(
|
|
594
|
-
return ~
|
|
592
|
+
let o = (l) => {
|
|
593
|
+
let s2 = String(l), b = s2.indexOf(t, r2.length);
|
|
594
|
+
return ~b ? r2 + i(s2, t, c, b) + t : r2 + s2 + t;
|
|
595
595
|
};
|
|
596
596
|
return o.open = r2, o.close = t, o;
|
|
597
|
-
},
|
|
597
|
+
}, u2 = {
|
|
598
598
|
isColorSupported: e
|
|
599
599
|
}, d = (r2) => `\x1B[${r2}m`;
|
|
600
600
|
for (let [r2, t] of h)
|
|
601
|
-
|
|
601
|
+
u2[r2] = e ? g(
|
|
602
602
|
d(t[0]),
|
|
603
603
|
d(t[1]),
|
|
604
604
|
t[2]
|
|
605
605
|
) : a;
|
|
606
|
-
return
|
|
606
|
+
return u2;
|
|
607
607
|
}
|
|
608
608
|
var r = process.env.FORCE_TTY !== void 0 || isatty(1);
|
|
609
609
|
var u = p(r);
|
|
@@ -611,13 +611,13 @@ var u = p(r);
|
|
|
611
611
|
// ../../node_modules/.pnpm/@vitest+pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js
|
|
612
612
|
function _mergeNamespaces(n, m2) {
|
|
613
613
|
m2.forEach(function(e) {
|
|
614
|
-
e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(
|
|
615
|
-
if (
|
|
616
|
-
var d = Object.getOwnPropertyDescriptor(e,
|
|
617
|
-
Object.defineProperty(n,
|
|
614
|
+
e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
|
|
615
|
+
if (k !== "default" && !(k in n)) {
|
|
616
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
617
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
618
618
|
enumerable: true,
|
|
619
619
|
get: function() {
|
|
620
|
-
return e[
|
|
620
|
+
return e[k];
|
|
621
621
|
}
|
|
622
622
|
});
|
|
623
623
|
}
|
|
@@ -692,7 +692,7 @@ function printIteratorValues(iterator, config2, indentation, depth, refs, printe
|
|
|
692
692
|
function printListItems(list, config2, indentation, depth, refs, printer2) {
|
|
693
693
|
let result = "";
|
|
694
694
|
list = list instanceof ArrayBuffer ? new DataView(list) : list;
|
|
695
|
-
const isDataView = (
|
|
695
|
+
const isDataView = (l) => l instanceof DataView;
|
|
696
696
|
const length = isDataView(list) ? list.byteLength : list.length;
|
|
697
697
|
if (length > 0) {
|
|
698
698
|
result += config2.spacingOuter;
|
|
@@ -953,8 +953,8 @@ var plugin$2 = {
|
|
|
953
953
|
serialize: serialize$2,
|
|
954
954
|
test: test$2
|
|
955
955
|
};
|
|
956
|
-
function getDefaultExportFromCjs(
|
|
957
|
-
return
|
|
956
|
+
function getDefaultExportFromCjs(x) {
|
|
957
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
958
958
|
}
|
|
959
959
|
var reactIs$1 = { exports: {} };
|
|
960
960
|
var reactIs_production = {};
|
|
@@ -1166,25 +1166,25 @@ var hasRequiredReactIs_production_min;
|
|
|
1166
1166
|
function requireReactIs_production_min() {
|
|
1167
1167
|
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
1168
1168
|
hasRequiredReactIs_production_min = 1;
|
|
1169
|
-
var
|
|
1170
|
-
|
|
1171
|
-
function
|
|
1169
|
+
var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f3 = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h3 = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m2 = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p3 = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u2;
|
|
1170
|
+
u2 = Symbol.for("react.module.reference");
|
|
1171
|
+
function v(a3) {
|
|
1172
1172
|
if ("object" === typeof a3 && null !== a3) {
|
|
1173
1173
|
var r2 = a3.$$typeof;
|
|
1174
1174
|
switch (r2) {
|
|
1175
|
-
case
|
|
1175
|
+
case b:
|
|
1176
1176
|
switch (a3 = a3.type, a3) {
|
|
1177
1177
|
case d:
|
|
1178
|
-
case
|
|
1178
|
+
case f3:
|
|
1179
1179
|
case e:
|
|
1180
1180
|
case m2:
|
|
1181
1181
|
case n:
|
|
1182
1182
|
return a3;
|
|
1183
1183
|
default:
|
|
1184
1184
|
switch (a3 = a3 && a3.$$typeof, a3) {
|
|
1185
|
-
case
|
|
1186
|
-
case
|
|
1187
|
-
case
|
|
1185
|
+
case k:
|
|
1186
|
+
case h3:
|
|
1187
|
+
case l:
|
|
1188
1188
|
case q:
|
|
1189
1189
|
case p3:
|
|
1190
1190
|
case g:
|
|
@@ -1198,15 +1198,15 @@ function requireReactIs_production_min() {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
1200
|
}
|
|
1201
|
-
reactIs_production_min.ContextConsumer =
|
|
1201
|
+
reactIs_production_min.ContextConsumer = h3;
|
|
1202
1202
|
reactIs_production_min.ContextProvider = g;
|
|
1203
|
-
reactIs_production_min.Element =
|
|
1204
|
-
reactIs_production_min.ForwardRef =
|
|
1203
|
+
reactIs_production_min.Element = b;
|
|
1204
|
+
reactIs_production_min.ForwardRef = l;
|
|
1205
1205
|
reactIs_production_min.Fragment = d;
|
|
1206
1206
|
reactIs_production_min.Lazy = q;
|
|
1207
1207
|
reactIs_production_min.Memo = p3;
|
|
1208
1208
|
reactIs_production_min.Portal = c;
|
|
1209
|
-
reactIs_production_min.Profiler =
|
|
1209
|
+
reactIs_production_min.Profiler = f3;
|
|
1210
1210
|
reactIs_production_min.StrictMode = e;
|
|
1211
1211
|
reactIs_production_min.Suspense = m2;
|
|
1212
1212
|
reactIs_production_min.SuspenseList = n;
|
|
@@ -1217,45 +1217,45 @@ function requireReactIs_production_min() {
|
|
|
1217
1217
|
return false;
|
|
1218
1218
|
};
|
|
1219
1219
|
reactIs_production_min.isContextConsumer = function(a3) {
|
|
1220
|
-
return
|
|
1220
|
+
return v(a3) === h3;
|
|
1221
1221
|
};
|
|
1222
1222
|
reactIs_production_min.isContextProvider = function(a3) {
|
|
1223
|
-
return
|
|
1223
|
+
return v(a3) === g;
|
|
1224
1224
|
};
|
|
1225
1225
|
reactIs_production_min.isElement = function(a3) {
|
|
1226
|
-
return "object" === typeof a3 && null !== a3 && a3.$$typeof ===
|
|
1226
|
+
return "object" === typeof a3 && null !== a3 && a3.$$typeof === b;
|
|
1227
1227
|
};
|
|
1228
1228
|
reactIs_production_min.isForwardRef = function(a3) {
|
|
1229
|
-
return
|
|
1229
|
+
return v(a3) === l;
|
|
1230
1230
|
};
|
|
1231
1231
|
reactIs_production_min.isFragment = function(a3) {
|
|
1232
|
-
return
|
|
1232
|
+
return v(a3) === d;
|
|
1233
1233
|
};
|
|
1234
1234
|
reactIs_production_min.isLazy = function(a3) {
|
|
1235
|
-
return
|
|
1235
|
+
return v(a3) === q;
|
|
1236
1236
|
};
|
|
1237
1237
|
reactIs_production_min.isMemo = function(a3) {
|
|
1238
|
-
return
|
|
1238
|
+
return v(a3) === p3;
|
|
1239
1239
|
};
|
|
1240
1240
|
reactIs_production_min.isPortal = function(a3) {
|
|
1241
|
-
return
|
|
1241
|
+
return v(a3) === c;
|
|
1242
1242
|
};
|
|
1243
1243
|
reactIs_production_min.isProfiler = function(a3) {
|
|
1244
|
-
return
|
|
1244
|
+
return v(a3) === f3;
|
|
1245
1245
|
};
|
|
1246
1246
|
reactIs_production_min.isStrictMode = function(a3) {
|
|
1247
|
-
return
|
|
1247
|
+
return v(a3) === e;
|
|
1248
1248
|
};
|
|
1249
1249
|
reactIs_production_min.isSuspense = function(a3) {
|
|
1250
|
-
return
|
|
1250
|
+
return v(a3) === m2;
|
|
1251
1251
|
};
|
|
1252
1252
|
reactIs_production_min.isSuspenseList = function(a3) {
|
|
1253
|
-
return
|
|
1253
|
+
return v(a3) === n;
|
|
1254
1254
|
};
|
|
1255
1255
|
reactIs_production_min.isValidElementType = function(a3) {
|
|
1256
|
-
return "string" === typeof a3 || "function" === typeof a3 || a3 === d || a3 ===
|
|
1256
|
+
return "string" === typeof a3 || "function" === typeof a3 || a3 === d || a3 === f3 || a3 === e || a3 === m2 || a3 === n || a3 === t || "object" === typeof a3 && null !== a3 && (a3.$$typeof === q || a3.$$typeof === p3 || a3.$$typeof === g || a3.$$typeof === h3 || a3.$$typeof === l || a3.$$typeof === u2 || void 0 !== a3.getModuleId) ? true : false;
|
|
1257
1257
|
};
|
|
1258
|
-
reactIs_production_min.typeOf =
|
|
1258
|
+
reactIs_production_min.typeOf = v;
|
|
1259
1259
|
return reactIs_production_min;
|
|
1260
1260
|
}
|
|
1261
1261
|
var reactIs_development = {};
|
|
@@ -1473,7 +1473,7 @@ var reactIsMethods = [
|
|
|
1473
1473
|
"isSuspenseList",
|
|
1474
1474
|
"isValidElementType"
|
|
1475
1475
|
];
|
|
1476
|
-
var ReactIs = Object.fromEntries(reactIsMethods.map((m2) => [m2, (
|
|
1476
|
+
var ReactIs = Object.fromEntries(reactIsMethods.map((m2) => [m2, (v) => ReactIs18[m2](v) || ReactIs19[m2](v)]));
|
|
1477
1477
|
function getChildren(arg, children = []) {
|
|
1478
1478
|
if (Array.isArray(arg)) {
|
|
1479
1479
|
for (const item of arg) {
|
|
@@ -1840,7 +1840,7 @@ var plugins = {
|
|
|
1840
1840
|
Error: ErrorPlugin
|
|
1841
1841
|
};
|
|
1842
1842
|
|
|
1843
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
1843
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/helpers.js
|
|
1844
1844
|
var ansiColors = {
|
|
1845
1845
|
bold: ["1", "22"],
|
|
1846
1846
|
dim: ["2", "22"],
|
|
@@ -1995,7 +1995,7 @@ function inspectProperty([key, value], options) {
|
|
|
1995
1995
|
return `${key}: ${value}`;
|
|
1996
1996
|
}
|
|
1997
1997
|
|
|
1998
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
1998
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/array.js
|
|
1999
1999
|
function inspectArray(array2, options) {
|
|
2000
2000
|
const nonIndexProperties = Object.keys(array2).slice(array2.length);
|
|
2001
2001
|
if (!array2.length && !nonIndexProperties.length)
|
|
@@ -2010,7 +2010,7 @@ function inspectArray(array2, options) {
|
|
|
2010
2010
|
return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`;
|
|
2011
2011
|
}
|
|
2012
2012
|
|
|
2013
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2013
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/typedarray.js
|
|
2014
2014
|
var getArrayName = (array2) => {
|
|
2015
2015
|
if (typeof Buffer === "function" && array2 instanceof Buffer) {
|
|
2016
2016
|
return "Buffer";
|
|
@@ -2043,7 +2043,7 @@ function inspectTypedArray(array2, options) {
|
|
|
2043
2043
|
return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ""} ]`;
|
|
2044
2044
|
}
|
|
2045
2045
|
|
|
2046
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2046
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/date.js
|
|
2047
2047
|
function inspectDate(dateObject, options) {
|
|
2048
2048
|
const stringRepresentation = dateObject.toJSON();
|
|
2049
2049
|
if (stringRepresentation === null) {
|
|
@@ -2054,7 +2054,7 @@ function inspectDate(dateObject, options) {
|
|
|
2054
2054
|
return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, "date");
|
|
2055
2055
|
}
|
|
2056
2056
|
|
|
2057
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2057
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/function.js
|
|
2058
2058
|
function inspectFunction(func, options) {
|
|
2059
2059
|
const functionType = func[Symbol.toStringTag] || "Function";
|
|
2060
2060
|
const name = func.name;
|
|
@@ -2064,7 +2064,7 @@ function inspectFunction(func, options) {
|
|
|
2064
2064
|
return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, "special");
|
|
2065
2065
|
}
|
|
2066
2066
|
|
|
2067
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2067
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/map.js
|
|
2068
2068
|
function inspectMapEntry([key, value], options) {
|
|
2069
2069
|
options.truncate -= 4;
|
|
2070
2070
|
key = options.inspect(key, options);
|
|
@@ -2086,7 +2086,7 @@ function inspectMap(map2, options) {
|
|
|
2086
2086
|
return `Map{ ${inspectList(mapToEntries(map2), options, inspectMapEntry)} }`;
|
|
2087
2087
|
}
|
|
2088
2088
|
|
|
2089
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2089
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/number.js
|
|
2090
2090
|
var isNaN = Number.isNaN || ((i) => i !== i);
|
|
2091
2091
|
function inspectNumber(number, options) {
|
|
2092
2092
|
if (isNaN(number)) {
|
|
@@ -2104,7 +2104,7 @@ function inspectNumber(number, options) {
|
|
|
2104
2104
|
return options.stylize(truncate(String(number), options.truncate), "number");
|
|
2105
2105
|
}
|
|
2106
2106
|
|
|
2107
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2107
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/bigint.js
|
|
2108
2108
|
function inspectBigInt(number, options) {
|
|
2109
2109
|
let nums = truncate(number.toString(), options.truncate - 1);
|
|
2110
2110
|
if (nums !== truncator)
|
|
@@ -2112,7 +2112,7 @@ function inspectBigInt(number, options) {
|
|
|
2112
2112
|
return options.stylize(nums, "bigint");
|
|
2113
2113
|
}
|
|
2114
2114
|
|
|
2115
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2115
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/regexp.js
|
|
2116
2116
|
function inspectRegExp(value, options) {
|
|
2117
2117
|
const flags = value.toString().split("/")[2];
|
|
2118
2118
|
const sourceLength = options.truncate - (2 + flags.length);
|
|
@@ -2120,7 +2120,7 @@ function inspectRegExp(value, options) {
|
|
|
2120
2120
|
return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, "regexp");
|
|
2121
2121
|
}
|
|
2122
2122
|
|
|
2123
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2123
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/set.js
|
|
2124
2124
|
function arrayFromSet(set3) {
|
|
2125
2125
|
const values = [];
|
|
2126
2126
|
set3.forEach((value) => {
|
|
@@ -2135,7 +2135,7 @@ function inspectSet(set3, options) {
|
|
|
2135
2135
|
return `Set{ ${inspectList(arrayFromSet(set3), options)} }`;
|
|
2136
2136
|
}
|
|
2137
2137
|
|
|
2138
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2138
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/string.js
|
|
2139
2139
|
var stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g");
|
|
2140
2140
|
var escapeCharacters = {
|
|
2141
2141
|
"\b": "\\b",
|
|
@@ -2157,7 +2157,7 @@ function inspectString(string2, options) {
|
|
|
2157
2157
|
return options.stylize(`'${truncate(string2, options.truncate - 2)}'`, "string");
|
|
2158
2158
|
}
|
|
2159
2159
|
|
|
2160
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2160
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/symbol.js
|
|
2161
2161
|
function inspectSymbol(value) {
|
|
2162
2162
|
if ("description" in Symbol.prototype) {
|
|
2163
2163
|
return value.description ? `Symbol(${value.description})` : "Symbol()";
|
|
@@ -2165,11 +2165,24 @@ function inspectSymbol(value) {
|
|
|
2165
2165
|
return value.toString();
|
|
2166
2166
|
}
|
|
2167
2167
|
|
|
2168
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2168
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/promise.js
|
|
2169
2169
|
var getPromiseValue = () => "Promise{\u2026}";
|
|
2170
|
+
try {
|
|
2171
|
+
const { getPromiseDetails, kPending, kRejected } = process.binding("util");
|
|
2172
|
+
if (Array.isArray(getPromiseDetails(Promise.resolve()))) {
|
|
2173
|
+
getPromiseValue = (value, options) => {
|
|
2174
|
+
const [state, innerValue] = getPromiseDetails(value);
|
|
2175
|
+
if (state === kPending) {
|
|
2176
|
+
return "Promise{<pending>}";
|
|
2177
|
+
}
|
|
2178
|
+
return `Promise${state === kRejected ? "!" : ""}{${options.inspect(innerValue, options)}}`;
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
} catch (notNode) {
|
|
2182
|
+
}
|
|
2170
2183
|
var promise_default = getPromiseValue;
|
|
2171
2184
|
|
|
2172
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2185
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/object.js
|
|
2173
2186
|
function inspectObject(object2, options) {
|
|
2174
2187
|
const properties = Object.getOwnPropertyNames(object2);
|
|
2175
2188
|
const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object2) : [];
|
|
@@ -2192,7 +2205,7 @@ function inspectObject(object2, options) {
|
|
|
2192
2205
|
return `{ ${propertyContents}${sep2}${symbolContents} }`;
|
|
2193
2206
|
}
|
|
2194
2207
|
|
|
2195
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2208
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/class.js
|
|
2196
2209
|
var toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false;
|
|
2197
2210
|
function inspectClass(value, options) {
|
|
2198
2211
|
let name = "";
|
|
@@ -2207,7 +2220,7 @@ function inspectClass(value, options) {
|
|
|
2207
2220
|
return `${name}${inspectObject(value, options)}`;
|
|
2208
2221
|
}
|
|
2209
2222
|
|
|
2210
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2223
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/arguments.js
|
|
2211
2224
|
function inspectArguments(args, options) {
|
|
2212
2225
|
if (args.length === 0)
|
|
2213
2226
|
return "Arguments[]";
|
|
@@ -2215,7 +2228,7 @@ function inspectArguments(args, options) {
|
|
|
2215
2228
|
return `Arguments[ ${inspectList(args, options)} ]`;
|
|
2216
2229
|
}
|
|
2217
2230
|
|
|
2218
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2231
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/error.js
|
|
2219
2232
|
var errorKeys = [
|
|
2220
2233
|
"stack",
|
|
2221
2234
|
"line",
|
|
@@ -2250,7 +2263,7 @@ function inspectObject2(error, options) {
|
|
|
2250
2263
|
return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`;
|
|
2251
2264
|
}
|
|
2252
2265
|
|
|
2253
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2266
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/html.js
|
|
2254
2267
|
function inspectAttribute([key, value], options) {
|
|
2255
2268
|
options.truncate -= 3;
|
|
2256
2269
|
if (!value) {
|
|
@@ -2292,7 +2305,7 @@ function inspectHTML(element, options) {
|
|
|
2292
2305
|
return `${head}${propertyContents}${headClose}${children}${tail}`;
|
|
2293
2306
|
}
|
|
2294
2307
|
|
|
2295
|
-
// ../../node_modules/.pnpm/loupe@3.
|
|
2308
|
+
// ../../node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/index.js
|
|
2296
2309
|
var symbolsSupported = typeof Symbol === "function" && typeof Symbol.for === "function";
|
|
2297
2310
|
var chaiInspect = symbolsSupported ? Symbol.for("chai/inspect") : "@@chai/inspect";
|
|
2298
2311
|
var nodeInspect = Symbol.for("nodejs.util.inspect.custom");
|
|
@@ -2340,12 +2353,12 @@ var baseTypesMap = {
|
|
|
2340
2353
|
HTMLCollection: inspectNodeCollection,
|
|
2341
2354
|
NodeList: inspectNodeCollection
|
|
2342
2355
|
};
|
|
2343
|
-
var inspectCustom = (value, options, type3
|
|
2356
|
+
var inspectCustom = (value, options, type3) => {
|
|
2344
2357
|
if (chaiInspect in value && typeof value[chaiInspect] === "function") {
|
|
2345
2358
|
return value[chaiInspect](options);
|
|
2346
2359
|
}
|
|
2347
2360
|
if (nodeInspect in value && typeof value[nodeInspect] === "function") {
|
|
2348
|
-
return value[nodeInspect](options.depth, options
|
|
2361
|
+
return value[nodeInspect](options.depth, options);
|
|
2349
2362
|
}
|
|
2350
2363
|
if ("inspect" in value && typeof value.inspect === "function") {
|
|
2351
2364
|
return value.inspect(options.depth, options);
|
|
@@ -2370,7 +2383,7 @@ function inspect(value, opts = {}) {
|
|
|
2370
2383
|
return baseTypesMap[type3](value, options);
|
|
2371
2384
|
}
|
|
2372
2385
|
if (customInspect && value) {
|
|
2373
|
-
const output = inspectCustom(value, options, type3
|
|
2386
|
+
const output = inspectCustom(value, options, type3);
|
|
2374
2387
|
if (output) {
|
|
2375
2388
|
if (typeof output === "string")
|
|
2376
2389
|
return output;
|
|
@@ -2445,14 +2458,14 @@ function format2(...args) {
|
|
|
2445
2458
|
const len = args.length;
|
|
2446
2459
|
let i = 1;
|
|
2447
2460
|
const template = args[0];
|
|
2448
|
-
let str = String(template).replace(formatRegExp, (
|
|
2449
|
-
if (
|
|
2461
|
+
let str = String(template).replace(formatRegExp, (x) => {
|
|
2462
|
+
if (x === "%%") {
|
|
2450
2463
|
return "%";
|
|
2451
2464
|
}
|
|
2452
2465
|
if (i >= len) {
|
|
2453
|
-
return
|
|
2466
|
+
return x;
|
|
2454
2467
|
}
|
|
2455
|
-
switch (
|
|
2468
|
+
switch (x) {
|
|
2456
2469
|
case "%s": {
|
|
2457
2470
|
const value = args[i++];
|
|
2458
2471
|
if (typeof value === "bigint") {
|
|
@@ -2510,14 +2523,14 @@ function format2(...args) {
|
|
|
2510
2523
|
throw err;
|
|
2511
2524
|
}
|
|
2512
2525
|
default:
|
|
2513
|
-
return
|
|
2526
|
+
return x;
|
|
2514
2527
|
}
|
|
2515
2528
|
});
|
|
2516
|
-
for (let
|
|
2517
|
-
if (
|
|
2518
|
-
str += ` ${
|
|
2529
|
+
for (let x = args[i]; i < len; x = args[++i]) {
|
|
2530
|
+
if (x === null || typeof x !== "object") {
|
|
2531
|
+
str += ` ${x}`;
|
|
2519
2532
|
} else {
|
|
2520
|
-
str += ` ${inspect2(
|
|
2533
|
+
str += ` ${inspect2(x)}`;
|
|
2521
2534
|
}
|
|
2522
2535
|
}
|
|
2523
2536
|
return str;
|
|
@@ -2550,8 +2563,8 @@ function objDisplay(obj, options = {}) {
|
|
|
2550
2563
|
}
|
|
2551
2564
|
return str;
|
|
2552
2565
|
}
|
|
2553
|
-
function getDefaultExportFromCjs2(
|
|
2554
|
-
return
|
|
2566
|
+
function getDefaultExportFromCjs2(x) {
|
|
2567
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
2555
2568
|
}
|
|
2556
2569
|
|
|
2557
2570
|
// ../../node_modules/.pnpm/@vitest+utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js
|
|
@@ -2611,15 +2624,15 @@ function deepClone(val, options = defaultCloneOptions) {
|
|
|
2611
2624
|
return clone(val, seen, options);
|
|
2612
2625
|
}
|
|
2613
2626
|
function clone(val, seen, options = defaultCloneOptions) {
|
|
2614
|
-
let
|
|
2627
|
+
let k, out;
|
|
2615
2628
|
if (seen.has(val)) {
|
|
2616
2629
|
return seen.get(val);
|
|
2617
2630
|
}
|
|
2618
2631
|
if (Array.isArray(val)) {
|
|
2619
|
-
out = Array.from({ length:
|
|
2632
|
+
out = Array.from({ length: k = val.length });
|
|
2620
2633
|
seen.set(val, out);
|
|
2621
|
-
while (
|
|
2622
|
-
out[
|
|
2634
|
+
while (k--) {
|
|
2635
|
+
out[k] = clone(val[k], seen, options);
|
|
2623
2636
|
}
|
|
2624
2637
|
return out;
|
|
2625
2638
|
}
|
|
@@ -2627,28 +2640,28 @@ function clone(val, seen, options = defaultCloneOptions) {
|
|
|
2627
2640
|
out = Object.create(Object.getPrototypeOf(val));
|
|
2628
2641
|
seen.set(val, out);
|
|
2629
2642
|
const props = getOwnProperties(val);
|
|
2630
|
-
for (const
|
|
2631
|
-
const descriptor = Object.getOwnPropertyDescriptor(val,
|
|
2643
|
+
for (const k2 of props) {
|
|
2644
|
+
const descriptor = Object.getOwnPropertyDescriptor(val, k2);
|
|
2632
2645
|
if (!descriptor) {
|
|
2633
2646
|
continue;
|
|
2634
2647
|
}
|
|
2635
|
-
const cloned = clone(val[
|
|
2648
|
+
const cloned = clone(val[k2], seen, options);
|
|
2636
2649
|
if (options.forceWritable) {
|
|
2637
|
-
Object.defineProperty(out,
|
|
2650
|
+
Object.defineProperty(out, k2, {
|
|
2638
2651
|
enumerable: descriptor.enumerable,
|
|
2639
2652
|
configurable: true,
|
|
2640
2653
|
writable: true,
|
|
2641
2654
|
value: cloned
|
|
2642
2655
|
});
|
|
2643
2656
|
} else if ("get" in descriptor) {
|
|
2644
|
-
Object.defineProperty(out,
|
|
2657
|
+
Object.defineProperty(out, k2, {
|
|
2645
2658
|
...descriptor,
|
|
2646
2659
|
get() {
|
|
2647
2660
|
return cloned;
|
|
2648
2661
|
}
|
|
2649
2662
|
});
|
|
2650
2663
|
} else {
|
|
2651
|
-
Object.defineProperty(out,
|
|
2664
|
+
Object.defineProperty(out, k2, {
|
|
2652
2665
|
...descriptor,
|
|
2653
2666
|
value: cloned
|
|
2654
2667
|
});
|
|
@@ -3641,19 +3654,19 @@ function joinAlignedDiffsNoExpand(diffs, options) {
|
|
|
3641
3654
|
let aEnd = 0;
|
|
3642
3655
|
let bEnd = 0;
|
|
3643
3656
|
const pushCommonLine = (line) => {
|
|
3644
|
-
const
|
|
3645
|
-
lines.push(printCommonLine(line,
|
|
3657
|
+
const j = lines.length;
|
|
3658
|
+
lines.push(printCommonLine(line, j === 0 || j === jLast, options));
|
|
3646
3659
|
aEnd += 1;
|
|
3647
3660
|
bEnd += 1;
|
|
3648
3661
|
};
|
|
3649
3662
|
const pushDeleteLine = (line) => {
|
|
3650
|
-
const
|
|
3651
|
-
lines.push(printDeleteLine(line,
|
|
3663
|
+
const j = lines.length;
|
|
3664
|
+
lines.push(printDeleteLine(line, j === 0 || j === jLast, options));
|
|
3652
3665
|
aEnd += 1;
|
|
3653
3666
|
};
|
|
3654
3667
|
const pushInsertLine = (line) => {
|
|
3655
|
-
const
|
|
3656
|
-
lines.push(printInsertLine(line,
|
|
3668
|
+
const j = lines.length;
|
|
3669
|
+
lines.push(printInsertLine(line, j === 0 || j === jLast, options));
|
|
3657
3670
|
bEnd += 1;
|
|
3658
3671
|
};
|
|
3659
3672
|
i = 0;
|
|
@@ -3780,20 +3793,20 @@ function isEmptyString(lines) {
|
|
|
3780
3793
|
}
|
|
3781
3794
|
function countChanges(diffs) {
|
|
3782
3795
|
let a3 = 0;
|
|
3783
|
-
let
|
|
3796
|
+
let b = 0;
|
|
3784
3797
|
diffs.forEach((diff2) => {
|
|
3785
3798
|
switch (diff2[0]) {
|
|
3786
3799
|
case DIFF_DELETE:
|
|
3787
3800
|
a3 += 1;
|
|
3788
3801
|
break;
|
|
3789
3802
|
case DIFF_INSERT:
|
|
3790
|
-
|
|
3803
|
+
b += 1;
|
|
3791
3804
|
break;
|
|
3792
3805
|
}
|
|
3793
3806
|
});
|
|
3794
3807
|
return {
|
|
3795
3808
|
a: a3,
|
|
3796
|
-
b
|
|
3809
|
+
b
|
|
3797
3810
|
};
|
|
3798
3811
|
}
|
|
3799
3812
|
function printAnnotation({ aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator, includeChangeCounts, omitAnnotationLines }, changeCounts) {
|
|
@@ -3815,9 +3828,9 @@ function printAnnotation({ aAnnotation, aColor, aIndicator, bAnnotation, bColor,
|
|
|
3815
3828
|
bRest = `${bAnnotationPadding} ${bIndicator} ${bCountPadding}${bCount}`;
|
|
3816
3829
|
}
|
|
3817
3830
|
const a3 = `${aIndicator} ${aAnnotation}${aRest}`;
|
|
3818
|
-
const
|
|
3831
|
+
const b = `${bIndicator} ${bAnnotation}${bRest}`;
|
|
3819
3832
|
return `${aColor(a3)}
|
|
3820
|
-
${bColor(
|
|
3833
|
+
${bColor(b)}
|
|
3821
3834
|
|
|
3822
3835
|
`;
|
|
3823
3836
|
}
|
|
@@ -3931,25 +3944,25 @@ function getType3(value) {
|
|
|
3931
3944
|
function getNewLineSymbol(string2) {
|
|
3932
3945
|
return string2.includes("\r\n") ? "\r\n" : "\n";
|
|
3933
3946
|
}
|
|
3934
|
-
function diffStrings(a3,
|
|
3947
|
+
function diffStrings(a3, b, options) {
|
|
3935
3948
|
const truncate3 = (options === null || options === void 0 ? void 0 : options.truncateThreshold) ?? false;
|
|
3936
3949
|
const truncateThreshold = Math.max(Math.floor((options === null || options === void 0 ? void 0 : options.truncateThreshold) ?? 0), 0);
|
|
3937
3950
|
let aLength = a3.length;
|
|
3938
|
-
let bLength =
|
|
3951
|
+
let bLength = b.length;
|
|
3939
3952
|
if (truncate3) {
|
|
3940
3953
|
const aMultipleLines = a3.includes("\n");
|
|
3941
|
-
const bMultipleLines =
|
|
3954
|
+
const bMultipleLines = b.includes("\n");
|
|
3942
3955
|
const aNewLineSymbol = getNewLineSymbol(a3);
|
|
3943
|
-
const bNewLineSymbol = getNewLineSymbol(
|
|
3956
|
+
const bNewLineSymbol = getNewLineSymbol(b);
|
|
3944
3957
|
const _a = aMultipleLines ? `${a3.split(aNewLineSymbol, truncateThreshold).join(aNewLineSymbol)}
|
|
3945
3958
|
` : a3;
|
|
3946
|
-
const _b = bMultipleLines ? `${
|
|
3947
|
-
` :
|
|
3959
|
+
const _b = bMultipleLines ? `${b.split(bNewLineSymbol, truncateThreshold).join(bNewLineSymbol)}
|
|
3960
|
+
` : b;
|
|
3948
3961
|
aLength = _a.length;
|
|
3949
3962
|
bLength = _b.length;
|
|
3950
3963
|
}
|
|
3951
|
-
const truncated = aLength !== a3.length || bLength !==
|
|
3952
|
-
const isCommon = (aIndex2, bIndex2) => a3[aIndex2] ===
|
|
3964
|
+
const truncated = aLength !== a3.length || bLength !== b.length;
|
|
3965
|
+
const isCommon = (aIndex2, bIndex2) => a3[aIndex2] === b[bIndex2];
|
|
3953
3966
|
let aIndex = 0;
|
|
3954
3967
|
let bIndex = 0;
|
|
3955
3968
|
const diffs = [];
|
|
@@ -3958,18 +3971,18 @@ function diffStrings(a3, b2, options) {
|
|
|
3958
3971
|
diffs.push(new Diff(DIFF_DELETE, a3.slice(aIndex, aCommon)));
|
|
3959
3972
|
}
|
|
3960
3973
|
if (bIndex !== bCommon) {
|
|
3961
|
-
diffs.push(new Diff(DIFF_INSERT,
|
|
3974
|
+
diffs.push(new Diff(DIFF_INSERT, b.slice(bIndex, bCommon)));
|
|
3962
3975
|
}
|
|
3963
3976
|
aIndex = aCommon + nCommon;
|
|
3964
3977
|
bIndex = bCommon + nCommon;
|
|
3965
|
-
diffs.push(new Diff(DIFF_EQUAL,
|
|
3978
|
+
diffs.push(new Diff(DIFF_EQUAL, b.slice(bCommon, bIndex)));
|
|
3966
3979
|
};
|
|
3967
3980
|
diffSequences(aLength, bLength, isCommon, foundSubsequence);
|
|
3968
3981
|
if (aIndex !== aLength) {
|
|
3969
3982
|
diffs.push(new Diff(DIFF_DELETE, a3.slice(aIndex)));
|
|
3970
3983
|
}
|
|
3971
3984
|
if (bIndex !== bLength) {
|
|
3972
|
-
diffs.push(new Diff(DIFF_INSERT,
|
|
3985
|
+
diffs.push(new Diff(DIFF_INSERT, b.slice(bIndex)));
|
|
3973
3986
|
}
|
|
3974
3987
|
return [diffs, truncated];
|
|
3975
3988
|
}
|
|
@@ -4111,22 +4124,22 @@ function hasCommonDiff(diffs, isMultiline) {
|
|
|
4111
4124
|
}
|
|
4112
4125
|
return diffs.some((diff2) => diff2[0] === DIFF_EQUAL);
|
|
4113
4126
|
}
|
|
4114
|
-
function diffStringsUnified(a3,
|
|
4115
|
-
if (a3 !==
|
|
4116
|
-
const isMultiline = a3.includes("\n") ||
|
|
4127
|
+
function diffStringsUnified(a3, b, options) {
|
|
4128
|
+
if (a3 !== b && a3.length !== 0 && b.length !== 0) {
|
|
4129
|
+
const isMultiline = a3.includes("\n") || b.includes("\n");
|
|
4117
4130
|
const [diffs, truncated] = diffStringsRaw(isMultiline ? `${a3}
|
|
4118
|
-
` : a3, isMultiline ? `${
|
|
4119
|
-
` :
|
|
4131
|
+
` : a3, isMultiline ? `${b}
|
|
4132
|
+
` : b, true, options);
|
|
4120
4133
|
if (hasCommonDiff(diffs, isMultiline)) {
|
|
4121
4134
|
const optionsNormalized = normalizeDiffOptions(options);
|
|
4122
4135
|
const lines = getAlignedDiffs(diffs, optionsNormalized.changeColor);
|
|
4123
4136
|
return printDiffLines(lines, truncated, optionsNormalized);
|
|
4124
4137
|
}
|
|
4125
4138
|
}
|
|
4126
|
-
return diffLinesUnified(a3.split("\n"),
|
|
4139
|
+
return diffLinesUnified(a3.split("\n"), b.split("\n"), options);
|
|
4127
4140
|
}
|
|
4128
|
-
function diffStringsRaw(a3,
|
|
4129
|
-
const [diffs, truncated] = diffStrings(a3,
|
|
4141
|
+
function diffStringsRaw(a3, b, cleanup, options) {
|
|
4142
|
+
const [diffs, truncated] = diffStrings(a3, b, options);
|
|
4130
4143
|
{
|
|
4131
4144
|
diff_cleanupSemantic(diffs);
|
|
4132
4145
|
}
|
|
@@ -4155,8 +4168,8 @@ var FALLBACK_FORMAT_OPTIONS = {
|
|
|
4155
4168
|
maxDepth: 8,
|
|
4156
4169
|
plugins: PLUGINS2
|
|
4157
4170
|
};
|
|
4158
|
-
function diff(a3,
|
|
4159
|
-
if (Object.is(a3,
|
|
4171
|
+
function diff(a3, b, options) {
|
|
4172
|
+
if (Object.is(a3, b)) {
|
|
4160
4173
|
return "";
|
|
4161
4174
|
}
|
|
4162
4175
|
const aType = getType3(a3);
|
|
@@ -4172,14 +4185,14 @@ function diff(a3, b2, options) {
|
|
|
4172
4185
|
expectedType = a3.getExpectedType();
|
|
4173
4186
|
omitDifference = expectedType === "string";
|
|
4174
4187
|
}
|
|
4175
|
-
if (expectedType !== getType3(
|
|
4188
|
+
if (expectedType !== getType3(b)) {
|
|
4176
4189
|
let truncate4 = function(s2) {
|
|
4177
4190
|
return s2.length <= MAX_LENGTH ? s2 : `${s2.slice(0, MAX_LENGTH)}...`;
|
|
4178
4191
|
};
|
|
4179
4192
|
const { aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator } = normalizeDiffOptions(options);
|
|
4180
4193
|
const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
|
|
4181
4194
|
let aDisplay = format(a3, formatOptions);
|
|
4182
|
-
let bDisplay = format(
|
|
4195
|
+
let bDisplay = format(b, formatOptions);
|
|
4183
4196
|
const MAX_LENGTH = 1e5;
|
|
4184
4197
|
aDisplay = truncate4(aDisplay);
|
|
4185
4198
|
bDisplay = truncate4(bDisplay);
|
|
@@ -4196,21 +4209,21 @@ ${bDiff}`;
|
|
|
4196
4209
|
}
|
|
4197
4210
|
switch (aType) {
|
|
4198
4211
|
case "string":
|
|
4199
|
-
return diffLinesUnified(a3.split("\n"),
|
|
4212
|
+
return diffLinesUnified(a3.split("\n"), b.split("\n"), options);
|
|
4200
4213
|
case "boolean":
|
|
4201
4214
|
case "number":
|
|
4202
|
-
return comparePrimitive(a3,
|
|
4215
|
+
return comparePrimitive(a3, b, options);
|
|
4203
4216
|
case "map":
|
|
4204
|
-
return compareObjects(sortMap(a3), sortMap(
|
|
4217
|
+
return compareObjects(sortMap(a3), sortMap(b), options);
|
|
4205
4218
|
case "set":
|
|
4206
|
-
return compareObjects(sortSet(a3), sortSet(
|
|
4219
|
+
return compareObjects(sortSet(a3), sortSet(b), options);
|
|
4207
4220
|
default:
|
|
4208
|
-
return compareObjects(a3,
|
|
4221
|
+
return compareObjects(a3, b, options);
|
|
4209
4222
|
}
|
|
4210
4223
|
}
|
|
4211
|
-
function comparePrimitive(a3,
|
|
4224
|
+
function comparePrimitive(a3, b, options) {
|
|
4212
4225
|
const aFormat = format(a3, FORMAT_OPTIONS);
|
|
4213
|
-
const bFormat = format(
|
|
4226
|
+
const bFormat = format(b, FORMAT_OPTIONS);
|
|
4214
4227
|
return aFormat === bFormat ? "" : diffLinesUnified(aFormat.split("\n"), bFormat.split("\n"), options);
|
|
4215
4228
|
}
|
|
4216
4229
|
function sortMap(map2) {
|
|
@@ -4219,19 +4232,19 @@ function sortMap(map2) {
|
|
|
4219
4232
|
function sortSet(set3) {
|
|
4220
4233
|
return new Set(Array.from(set3.values()).sort());
|
|
4221
4234
|
}
|
|
4222
|
-
function compareObjects(a3,
|
|
4235
|
+
function compareObjects(a3, b, options) {
|
|
4223
4236
|
let difference;
|
|
4224
4237
|
let hasThrown = false;
|
|
4225
4238
|
try {
|
|
4226
4239
|
const formatOptions = getFormatOptions(FORMAT_OPTIONS, options);
|
|
4227
|
-
difference = getObjectsDifference(a3,
|
|
4240
|
+
difference = getObjectsDifference(a3, b, formatOptions, options);
|
|
4228
4241
|
} catch {
|
|
4229
4242
|
hasThrown = true;
|
|
4230
4243
|
}
|
|
4231
4244
|
const noDiffMessage = getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
4232
4245
|
if (difference === void 0 || difference === noDiffMessage) {
|
|
4233
4246
|
const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
|
|
4234
|
-
difference = getObjectsDifference(a3,
|
|
4247
|
+
difference = getObjectsDifference(a3, b, formatOptions, options);
|
|
4235
4248
|
if (difference !== noDiffMessage && !hasThrown) {
|
|
4236
4249
|
difference = `${getCommonMessage(SIMILAR_MESSAGE, options)}
|
|
4237
4250
|
|
|
@@ -4249,18 +4262,18 @@ function getFormatOptions(formatOptions, options) {
|
|
|
4249
4262
|
maxDepth: maxDepth ?? formatOptions.maxDepth
|
|
4250
4263
|
};
|
|
4251
4264
|
}
|
|
4252
|
-
function getObjectsDifference(a3,
|
|
4265
|
+
function getObjectsDifference(a3, b, formatOptions, options) {
|
|
4253
4266
|
const formatOptionsZeroIndent = {
|
|
4254
4267
|
...formatOptions,
|
|
4255
4268
|
indent: 0
|
|
4256
4269
|
};
|
|
4257
4270
|
const aCompare = format(a3, formatOptionsZeroIndent);
|
|
4258
|
-
const bCompare = format(
|
|
4271
|
+
const bCompare = format(b, formatOptionsZeroIndent);
|
|
4259
4272
|
if (aCompare === bCompare) {
|
|
4260
4273
|
return getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
4261
4274
|
} else {
|
|
4262
4275
|
const aDisplay = format(a3, formatOptions);
|
|
4263
|
-
const bDisplay = format(
|
|
4276
|
+
const bDisplay = format(b, formatOptions);
|
|
4264
4277
|
return diffLinesUnified2(aDisplay.split("\n"), bDisplay.split("\n"), aCompare.split("\n"), bCompare.split("\n"), options);
|
|
4265
4278
|
}
|
|
4266
4279
|
}
|
|
@@ -4356,166 +4369,166 @@ function getCommonAndChangedSubstrings(diffs, op, hasCommonDiff2) {
|
|
|
4356
4369
|
return diffs.reduce((reduced, diff2) => reduced + (diff2[0] === DIFF_EQUAL ? diff2[1] : diff2[0] === op ? hasCommonDiff2 ? u.inverse(diff2[1]) : diff2[1] : ""), "");
|
|
4357
4370
|
}
|
|
4358
4371
|
|
|
4359
|
-
// ../../node_modules/.pnpm/tinyspy@4.0.
|
|
4360
|
-
function
|
|
4361
|
-
if (!
|
|
4362
|
-
throw new Error(
|
|
4372
|
+
// ../../node_modules/.pnpm/tinyspy@4.0.3/node_modules/tinyspy/dist/index.js
|
|
4373
|
+
function assert(condition, message) {
|
|
4374
|
+
if (!condition)
|
|
4375
|
+
throw new Error(message);
|
|
4363
4376
|
}
|
|
4364
|
-
function
|
|
4365
|
-
return typeof
|
|
4377
|
+
function isType(type3, value) {
|
|
4378
|
+
return typeof value === type3;
|
|
4366
4379
|
}
|
|
4367
|
-
function
|
|
4368
|
-
return
|
|
4380
|
+
function isPromise(value) {
|
|
4381
|
+
return value instanceof Promise;
|
|
4369
4382
|
}
|
|
4370
|
-
function
|
|
4371
|
-
Object.defineProperty(
|
|
4383
|
+
function define(obj, key, descriptor) {
|
|
4384
|
+
Object.defineProperty(obj, key, descriptor);
|
|
4372
4385
|
}
|
|
4373
|
-
function
|
|
4374
|
-
|
|
4386
|
+
function defineValue(obj, key, value) {
|
|
4387
|
+
define(obj, key, { value, configurable: true, writable: true });
|
|
4375
4388
|
}
|
|
4376
|
-
var
|
|
4377
|
-
var
|
|
4378
|
-
var
|
|
4379
|
-
|
|
4389
|
+
var SYMBOL_STATE = Symbol.for("tinyspy:spy");
|
|
4390
|
+
var spies = /* @__PURE__ */ new Set();
|
|
4391
|
+
var reset = (state) => {
|
|
4392
|
+
state.called = false, state.callCount = 0, state.calls = [], state.results = [], state.resolves = [], state.next = [];
|
|
4380
4393
|
};
|
|
4381
|
-
var
|
|
4382
|
-
value: { reset: () =>
|
|
4383
|
-
}),
|
|
4384
|
-
var
|
|
4385
|
-
function
|
|
4386
|
-
|
|
4387
|
-
|
|
4394
|
+
var defineState = (spy2) => (define(spy2, SYMBOL_STATE, {
|
|
4395
|
+
value: { reset: () => reset(spy2[SYMBOL_STATE]) }
|
|
4396
|
+
}), spy2[SYMBOL_STATE]);
|
|
4397
|
+
var getInternalState = (spy2) => spy2[SYMBOL_STATE] || defineState(spy2);
|
|
4398
|
+
function createInternalSpy(cb) {
|
|
4399
|
+
assert(
|
|
4400
|
+
isType("function", cb) || isType("undefined", cb),
|
|
4388
4401
|
"cannot spy on a non-function value"
|
|
4389
4402
|
);
|
|
4390
|
-
let
|
|
4391
|
-
let
|
|
4392
|
-
|
|
4393
|
-
let
|
|
4394
|
-
if (
|
|
4395
|
-
|
|
4396
|
-
let [
|
|
4397
|
-
if (
|
|
4398
|
-
return
|
|
4399
|
-
throw
|
|
4400
|
-
}
|
|
4401
|
-
let
|
|
4402
|
-
if (
|
|
4403
|
+
let fn2 = function(...args) {
|
|
4404
|
+
let state2 = getInternalState(fn2);
|
|
4405
|
+
state2.called = true, state2.callCount++, state2.calls.push(args);
|
|
4406
|
+
let next = state2.next.shift();
|
|
4407
|
+
if (next) {
|
|
4408
|
+
state2.results.push(next);
|
|
4409
|
+
let [type22, result2] = next;
|
|
4410
|
+
if (type22 === "ok")
|
|
4411
|
+
return result2;
|
|
4412
|
+
throw result2;
|
|
4413
|
+
}
|
|
4414
|
+
let result, type3 = "ok", resultIndex = state2.results.length;
|
|
4415
|
+
if (state2.impl)
|
|
4403
4416
|
try {
|
|
4404
|
-
new.target ?
|
|
4405
|
-
} catch (
|
|
4406
|
-
throw
|
|
4417
|
+
new.target ? result = Reflect.construct(state2.impl, args, new.target) : result = state2.impl.apply(this, args), type3 = "ok";
|
|
4418
|
+
} catch (err) {
|
|
4419
|
+
throw result = err, type3 = "error", state2.results.push([type3, err]), err;
|
|
4407
4420
|
}
|
|
4408
|
-
let
|
|
4409
|
-
return
|
|
4410
|
-
(
|
|
4411
|
-
(
|
|
4412
|
-
),
|
|
4421
|
+
let resultTuple = [type3, result];
|
|
4422
|
+
return isPromise(result) && result.then(
|
|
4423
|
+
(r2) => state2.resolves[resultIndex] = ["ok", r2],
|
|
4424
|
+
(e) => state2.resolves[resultIndex] = ["error", e]
|
|
4425
|
+
), state2.results.push(resultTuple), result;
|
|
4413
4426
|
};
|
|
4414
|
-
|
|
4415
|
-
let
|
|
4416
|
-
return
|
|
4417
|
-
}
|
|
4418
|
-
function
|
|
4419
|
-
return !!
|
|
4420
|
-
}
|
|
4421
|
-
var
|
|
4422
|
-
let
|
|
4423
|
-
if (
|
|
4424
|
-
return [
|
|
4425
|
-
let
|
|
4426
|
-
for (;
|
|
4427
|
-
let
|
|
4428
|
-
if (
|
|
4429
|
-
return [
|
|
4430
|
-
|
|
4427
|
+
defineValue(fn2, "_isMockFunction", true), defineValue(fn2, "length", cb ? cb.length : 0), defineValue(fn2, "name", cb && cb.name || "spy");
|
|
4428
|
+
let state = getInternalState(fn2);
|
|
4429
|
+
return state.reset(), state.impl = cb, fn2;
|
|
4430
|
+
}
|
|
4431
|
+
function isMockFunction(obj) {
|
|
4432
|
+
return !!obj && obj._isMockFunction === true;
|
|
4433
|
+
}
|
|
4434
|
+
var getDescriptor = (obj, method) => {
|
|
4435
|
+
let objDescriptor = Object.getOwnPropertyDescriptor(obj, method);
|
|
4436
|
+
if (objDescriptor)
|
|
4437
|
+
return [obj, objDescriptor];
|
|
4438
|
+
let currentProto = Object.getPrototypeOf(obj);
|
|
4439
|
+
for (; currentProto !== null; ) {
|
|
4440
|
+
let descriptor = Object.getOwnPropertyDescriptor(currentProto, method);
|
|
4441
|
+
if (descriptor)
|
|
4442
|
+
return [currentProto, descriptor];
|
|
4443
|
+
currentProto = Object.getPrototypeOf(currentProto);
|
|
4431
4444
|
}
|
|
4432
4445
|
};
|
|
4433
|
-
var
|
|
4434
|
-
|
|
4446
|
+
var setPototype = (fn2, val) => {
|
|
4447
|
+
val != null && typeof val == "function" && val.prototype != null && Object.setPrototypeOf(fn2.prototype, val.prototype);
|
|
4435
4448
|
};
|
|
4436
|
-
function
|
|
4437
|
-
|
|
4438
|
-
!
|
|
4449
|
+
function internalSpyOn(obj, methodName, mock) {
|
|
4450
|
+
assert(
|
|
4451
|
+
!isType("undefined", obj),
|
|
4439
4452
|
"spyOn could not find an object to spy upon"
|
|
4440
|
-
),
|
|
4441
|
-
|
|
4453
|
+
), assert(
|
|
4454
|
+
isType("object", obj) || isType("function", obj),
|
|
4442
4455
|
"cannot spyOn on a primitive value"
|
|
4443
4456
|
);
|
|
4444
|
-
let [
|
|
4445
|
-
if (!
|
|
4446
|
-
return [
|
|
4447
|
-
if ("getter" in
|
|
4457
|
+
let [accessName, accessType] = (() => {
|
|
4458
|
+
if (!isType("object", methodName))
|
|
4459
|
+
return [methodName, "value"];
|
|
4460
|
+
if ("getter" in methodName && "setter" in methodName)
|
|
4448
4461
|
throw new Error("cannot spy on both getter and setter");
|
|
4449
|
-
if ("getter" in
|
|
4450
|
-
return [
|
|
4451
|
-
if ("setter" in
|
|
4452
|
-
return [
|
|
4462
|
+
if ("getter" in methodName)
|
|
4463
|
+
return [methodName.getter, "get"];
|
|
4464
|
+
if ("setter" in methodName)
|
|
4465
|
+
return [methodName.setter, "set"];
|
|
4453
4466
|
throw new Error("specify getter or setter to spy on");
|
|
4454
|
-
})(), [
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
`${String(
|
|
4467
|
+
})(), [originalDescriptorObject, originalDescriptor] = getDescriptor(obj, accessName) || [];
|
|
4468
|
+
assert(
|
|
4469
|
+
originalDescriptor || accessName in obj,
|
|
4470
|
+
`${String(accessName)} does not exist`
|
|
4458
4471
|
);
|
|
4459
|
-
let
|
|
4460
|
-
|
|
4461
|
-
let
|
|
4462
|
-
|
|
4463
|
-
let
|
|
4464
|
-
let { value
|
|
4472
|
+
let ssr = false;
|
|
4473
|
+
accessType === "value" && originalDescriptor && !originalDescriptor.value && originalDescriptor.get && (accessType = "get", ssr = true, mock = originalDescriptor.get());
|
|
4474
|
+
let original;
|
|
4475
|
+
originalDescriptor ? original = originalDescriptor[accessType] : accessType !== "value" ? original = () => obj[accessName] : original = obj[accessName], original && isSpyFunction(original) && (original = original[SYMBOL_STATE].getOriginal());
|
|
4476
|
+
let reassign = (cb) => {
|
|
4477
|
+
let { value, ...desc } = originalDescriptor || {
|
|
4465
4478
|
configurable: true,
|
|
4466
4479
|
writable: true
|
|
4467
4480
|
};
|
|
4468
|
-
|
|
4469
|
-
},
|
|
4470
|
-
|
|
4481
|
+
accessType !== "value" && delete desc.writable, desc[accessType] = cb, define(obj, accessName, desc);
|
|
4482
|
+
}, restore = () => {
|
|
4483
|
+
originalDescriptorObject !== obj ? Reflect.deleteProperty(obj, accessName) : originalDescriptor && !original ? define(obj, accessName, originalDescriptor) : reassign(original);
|
|
4471
4484
|
};
|
|
4472
|
-
|
|
4473
|
-
let
|
|
4474
|
-
|
|
4475
|
-
let
|
|
4476
|
-
return
|
|
4477
|
-
|
|
4478
|
-
),
|
|
4479
|
-
}
|
|
4480
|
-
var
|
|
4485
|
+
mock || (mock = original);
|
|
4486
|
+
let spy2 = wrap(createInternalSpy(mock), mock);
|
|
4487
|
+
accessType === "value" && setPototype(spy2, original);
|
|
4488
|
+
let state = spy2[SYMBOL_STATE];
|
|
4489
|
+
return defineValue(state, "restore", restore), defineValue(state, "getOriginal", () => ssr ? original() : original), defineValue(state, "willCall", (newCb) => (state.impl = newCb, spy2)), reassign(
|
|
4490
|
+
ssr ? () => (setPototype(spy2, mock), spy2) : spy2
|
|
4491
|
+
), spies.add(spy2), spy2;
|
|
4492
|
+
}
|
|
4493
|
+
var ignoreProperties = /* @__PURE__ */ new Set([
|
|
4481
4494
|
"length",
|
|
4482
4495
|
"name",
|
|
4483
4496
|
"prototype"
|
|
4484
4497
|
]);
|
|
4485
|
-
function
|
|
4486
|
-
let
|
|
4487
|
-
for (;
|
|
4488
|
-
let
|
|
4489
|
-
...Object.getOwnPropertyNames(
|
|
4490
|
-
...Object.getOwnPropertySymbols(
|
|
4498
|
+
function getAllProperties(original) {
|
|
4499
|
+
let properties = /* @__PURE__ */ new Set(), descriptors2 = {};
|
|
4500
|
+
for (; original && original !== Object.prototype && original !== Function.prototype; ) {
|
|
4501
|
+
let ownProperties = [
|
|
4502
|
+
...Object.getOwnPropertyNames(original),
|
|
4503
|
+
...Object.getOwnPropertySymbols(original)
|
|
4491
4504
|
];
|
|
4492
|
-
for (let
|
|
4493
|
-
|
|
4494
|
-
|
|
4505
|
+
for (let prop of ownProperties)
|
|
4506
|
+
descriptors2[prop] || ignoreProperties.has(prop) || (properties.add(prop), descriptors2[prop] = Object.getOwnPropertyDescriptor(original, prop));
|
|
4507
|
+
original = Object.getPrototypeOf(original);
|
|
4495
4508
|
}
|
|
4496
4509
|
return {
|
|
4497
|
-
properties
|
|
4498
|
-
descriptors:
|
|
4510
|
+
properties,
|
|
4511
|
+
descriptors: descriptors2
|
|
4499
4512
|
};
|
|
4500
4513
|
}
|
|
4501
|
-
function
|
|
4502
|
-
if (!
|
|
4503
|
-
|
|
4504
|
-
return
|
|
4505
|
-
let { properties
|
|
4506
|
-
for (let
|
|
4507
|
-
let
|
|
4508
|
-
|
|
4514
|
+
function wrap(mock, original) {
|
|
4515
|
+
if (!original || // the original is already a spy, so it has all the properties
|
|
4516
|
+
SYMBOL_STATE in original)
|
|
4517
|
+
return mock;
|
|
4518
|
+
let { properties, descriptors: descriptors2 } = getAllProperties(original);
|
|
4519
|
+
for (let key of properties) {
|
|
4520
|
+
let descriptor = descriptors2[key];
|
|
4521
|
+
getDescriptor(mock, key) || define(mock, key, descriptor);
|
|
4509
4522
|
}
|
|
4510
|
-
return
|
|
4523
|
+
return mock;
|
|
4511
4524
|
}
|
|
4512
|
-
function
|
|
4513
|
-
return
|
|
4525
|
+
function isSpyFunction(obj) {
|
|
4526
|
+
return isMockFunction(obj) && "getOriginal" in obj[SYMBOL_STATE];
|
|
4514
4527
|
}
|
|
4515
4528
|
|
|
4516
4529
|
// ../../node_modules/.pnpm/@vitest+spy@3.2.4/node_modules/@vitest/spy/dist/index.js
|
|
4517
4530
|
var mocks = /* @__PURE__ */ new Set();
|
|
4518
|
-
function
|
|
4531
|
+
function isMockFunction2(fn2) {
|
|
4519
4532
|
return typeof fn2 === "function" && "_isMockFunction" in fn2 && fn2._isMockFunction;
|
|
4520
4533
|
}
|
|
4521
4534
|
function spyOn(obj, method, accessType) {
|
|
@@ -4525,13 +4538,13 @@ function spyOn(obj, method, accessType) {
|
|
|
4525
4538
|
};
|
|
4526
4539
|
const objMethod = accessType ? { [dictionary[accessType]]: method } : method;
|
|
4527
4540
|
let state;
|
|
4528
|
-
const descriptor =
|
|
4541
|
+
const descriptor = getDescriptor2(obj, method);
|
|
4529
4542
|
const fn2 = descriptor && descriptor[accessType || "value"];
|
|
4530
|
-
if (
|
|
4543
|
+
if (isMockFunction2(fn2)) {
|
|
4531
4544
|
state = fn2.mock._state();
|
|
4532
4545
|
}
|
|
4533
4546
|
try {
|
|
4534
|
-
const stub =
|
|
4547
|
+
const stub = internalSpyOn(obj, objMethod);
|
|
4535
4548
|
const spy = enhanceSpy(stub);
|
|
4536
4549
|
if (state) {
|
|
4537
4550
|
spy.mock._state(state);
|
|
@@ -4553,7 +4566,7 @@ function enhanceSpy(spy) {
|
|
|
4553
4566
|
let instances = [];
|
|
4554
4567
|
let contexts = [];
|
|
4555
4568
|
let invocations = [];
|
|
4556
|
-
const state =
|
|
4569
|
+
const state = getInternalState(spy);
|
|
4557
4570
|
const mockContext = {
|
|
4558
4571
|
get calls() {
|
|
4559
4572
|
return state.calls;
|
|
@@ -4651,18 +4664,18 @@ function enhanceSpy(spy) {
|
|
|
4651
4664
|
implementation = fn2;
|
|
4652
4665
|
state.willCall(mockCall);
|
|
4653
4666
|
implementationChangedTemporarily = true;
|
|
4654
|
-
const
|
|
4667
|
+
const reset2 = () => {
|
|
4655
4668
|
implementation = originalImplementation;
|
|
4656
4669
|
implementationChangedTemporarily = false;
|
|
4657
4670
|
};
|
|
4658
4671
|
const result = cb();
|
|
4659
4672
|
if (typeof result === "object" && result && typeof result.then === "function") {
|
|
4660
4673
|
return result.then(() => {
|
|
4661
|
-
|
|
4674
|
+
reset2();
|
|
4662
4675
|
return stub;
|
|
4663
4676
|
});
|
|
4664
4677
|
}
|
|
4665
|
-
|
|
4678
|
+
reset2();
|
|
4666
4679
|
return stub;
|
|
4667
4680
|
}
|
|
4668
4681
|
stub.withImplementation = withImplementation;
|
|
@@ -4681,14 +4694,14 @@ function enhanceSpy(spy) {
|
|
|
4681
4694
|
return stub;
|
|
4682
4695
|
}
|
|
4683
4696
|
function fn(implementation) {
|
|
4684
|
-
const enhancedSpy = enhanceSpy(
|
|
4697
|
+
const enhancedSpy = enhanceSpy(internalSpyOn({ spy: implementation || function() {
|
|
4685
4698
|
} }, "spy"));
|
|
4686
4699
|
if (implementation) {
|
|
4687
4700
|
enhancedSpy.mockImplementation(implementation);
|
|
4688
4701
|
}
|
|
4689
4702
|
return enhancedSpy;
|
|
4690
4703
|
}
|
|
4691
|
-
function
|
|
4704
|
+
function getDescriptor2(obj, method) {
|
|
4692
4705
|
const objDescriptor = Object.getOwnPropertyDescriptor(obj, method);
|
|
4693
4706
|
if (objDescriptor) {
|
|
4694
4707
|
return objDescriptor;
|
|
@@ -4706,8 +4719,8 @@ function getDescriptor(obj, method) {
|
|
|
4706
4719
|
// ../../node_modules/.pnpm/@vitest+utils@3.2.4/node_modules/@vitest/utils/dist/error.js
|
|
4707
4720
|
var IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
|
|
4708
4721
|
var IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
4709
|
-
function isImmutable(
|
|
4710
|
-
return
|
|
4722
|
+
function isImmutable(v) {
|
|
4723
|
+
return v && (v[IS_COLLECTION_SYMBOL] || v[IS_RECORD_SYMBOL]);
|
|
4711
4724
|
}
|
|
4712
4725
|
var OBJECT_PROTO = Object.getPrototypeOf({});
|
|
4713
4726
|
function getUnserializableMessage(err) {
|
|
@@ -4853,13 +4866,13 @@ Inner error message: ${err === null || err === void 0 ? void 0 : err.message}`))
|
|
|
4853
4866
|
}
|
|
4854
4867
|
}
|
|
4855
4868
|
|
|
4856
|
-
// ../../node_modules/.pnpm/chai@5.
|
|
4869
|
+
// ../../node_modules/.pnpm/chai@5.2.0/node_modules/chai/chai.js
|
|
4857
4870
|
var chai_exports = {};
|
|
4858
4871
|
__export(chai_exports, {
|
|
4859
4872
|
Assertion: () => Assertion,
|
|
4860
4873
|
AssertionError: () => AssertionError,
|
|
4861
4874
|
Should: () => Should,
|
|
4862
|
-
assert: () =>
|
|
4875
|
+
assert: () => assert2,
|
|
4863
4876
|
config: () => config,
|
|
4864
4877
|
expect: () => expect,
|
|
4865
4878
|
should: () => should,
|
|
@@ -4867,11 +4880,19 @@ __export(chai_exports, {
|
|
|
4867
4880
|
util: () => utils_exports
|
|
4868
4881
|
});
|
|
4869
4882
|
var __defProp = Object.defineProperty;
|
|
4883
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4870
4884
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4885
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
4886
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4887
|
+
};
|
|
4871
4888
|
var __export2 = (target, all) => {
|
|
4872
4889
|
for (var name in all)
|
|
4873
4890
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4874
4891
|
};
|
|
4892
|
+
var require_util = __commonJS2({
|
|
4893
|
+
"(disabled):util"() {
|
|
4894
|
+
}
|
|
4895
|
+
});
|
|
4875
4896
|
var utils_exports = {};
|
|
4876
4897
|
__export2(utils_exports, {
|
|
4877
4898
|
addChainableMethod: () => addChainableMethod,
|
|
@@ -4969,7 +4990,7 @@ function getMessage(errorLike) {
|
|
|
4969
4990
|
}
|
|
4970
4991
|
__name(getMessage, "getMessage");
|
|
4971
4992
|
function flag(obj, key, value) {
|
|
4972
|
-
|
|
4993
|
+
var flags = obj.__flags || (obj.__flags = /* @__PURE__ */ Object.create(null));
|
|
4973
4994
|
if (arguments.length === 3) {
|
|
4974
4995
|
flags[key] = value;
|
|
4975
4996
|
} else {
|
|
@@ -4978,7 +4999,7 @@ function flag(obj, key, value) {
|
|
|
4978
4999
|
}
|
|
4979
5000
|
__name(flag, "flag");
|
|
4980
5001
|
function test2(obj, args) {
|
|
4981
|
-
|
|
5002
|
+
var negate = flag(obj, "negate"), expr = args[0];
|
|
4982
5003
|
return negate ? !expr : expr;
|
|
4983
5004
|
}
|
|
4984
5005
|
__name(test2, "test");
|
|
@@ -5032,20 +5053,20 @@ var AssertionError = class _AssertionError extends Error {
|
|
|
5032
5053
|
}
|
|
5033
5054
|
};
|
|
5034
5055
|
function expectTypes(obj, types) {
|
|
5035
|
-
|
|
5036
|
-
|
|
5056
|
+
var flagMsg = flag(obj, "message");
|
|
5057
|
+
var ssfi = flag(obj, "ssfi");
|
|
5037
5058
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
5038
5059
|
obj = flag(obj, "object");
|
|
5039
5060
|
types = types.map(function(t) {
|
|
5040
5061
|
return t.toLowerCase();
|
|
5041
5062
|
});
|
|
5042
5063
|
types.sort();
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5064
|
+
var str = types.map(function(t, index2) {
|
|
5065
|
+
var art = ~["a", "e", "i", "o", "u"].indexOf(t.charAt(0)) ? "an" : "a";
|
|
5066
|
+
var or = types.length > 1 && index2 === types.length - 1 ? "or " : "";
|
|
5046
5067
|
return or + art + " " + t;
|
|
5047
5068
|
}).join(", ");
|
|
5048
|
-
|
|
5069
|
+
var objType = type(obj).toLowerCase();
|
|
5049
5070
|
if (!types.some(function(expected) {
|
|
5050
5071
|
return objType === expected;
|
|
5051
5072
|
})) {
|
|
@@ -5303,8 +5324,10 @@ function mapToEntries2(map2) {
|
|
|
5303
5324
|
}
|
|
5304
5325
|
__name(mapToEntries2, "mapToEntries");
|
|
5305
5326
|
function inspectMap2(map2, options) {
|
|
5306
|
-
|
|
5327
|
+
const size = map2.size - 1;
|
|
5328
|
+
if (size <= 0) {
|
|
5307
5329
|
return "Map{}";
|
|
5330
|
+
}
|
|
5308
5331
|
options.truncate -= 7;
|
|
5309
5332
|
return `Map{ ${inspectList2(mapToEntries2(map2), options, inspectMapEntry2)} }`;
|
|
5310
5333
|
}
|
|
@@ -5385,6 +5408,19 @@ function inspectSymbol2(value) {
|
|
|
5385
5408
|
}
|
|
5386
5409
|
__name(inspectSymbol2, "inspectSymbol");
|
|
5387
5410
|
var getPromiseValue2 = /* @__PURE__ */ __name(() => "Promise{\u2026}", "getPromiseValue");
|
|
5411
|
+
try {
|
|
5412
|
+
const { getPromiseDetails, kPending, kRejected } = process.binding("util");
|
|
5413
|
+
if (Array.isArray(getPromiseDetails(Promise.resolve()))) {
|
|
5414
|
+
getPromiseValue2 = /* @__PURE__ */ __name((value, options) => {
|
|
5415
|
+
const [state, innerValue] = getPromiseDetails(value);
|
|
5416
|
+
if (state === kPending) {
|
|
5417
|
+
return "Promise{<pending>}";
|
|
5418
|
+
}
|
|
5419
|
+
return `Promise${state === kRejected ? "!" : ""}{${options.inspect(innerValue, options)}}`;
|
|
5420
|
+
}, "getPromiseValue");
|
|
5421
|
+
}
|
|
5422
|
+
} catch (notNode) {
|
|
5423
|
+
}
|
|
5388
5424
|
var promise_default2 = getPromiseValue2;
|
|
5389
5425
|
function inspectObject3(object2, options) {
|
|
5390
5426
|
const properties = Object.getOwnPropertyNames(object2);
|
|
@@ -5471,21 +5507,10 @@ function inspectAttribute2([key, value], options) {
|
|
|
5471
5507
|
return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`;
|
|
5472
5508
|
}
|
|
5473
5509
|
__name(inspectAttribute2, "inspectAttribute");
|
|
5474
|
-
function
|
|
5475
|
-
return inspectList2(collection, options,
|
|
5476
|
-
}
|
|
5477
|
-
__name(inspectNodeCollection2, "inspectNodeCollection");
|
|
5478
|
-
function inspectNode2(node, options) {
|
|
5479
|
-
switch (node.nodeType) {
|
|
5480
|
-
case 1:
|
|
5481
|
-
return inspectHTML2(node, options);
|
|
5482
|
-
case 3:
|
|
5483
|
-
return options.inspect(node.data, options);
|
|
5484
|
-
default:
|
|
5485
|
-
return options.inspect(node, options);
|
|
5486
|
-
}
|
|
5510
|
+
function inspectHTMLCollection(collection, options) {
|
|
5511
|
+
return inspectList2(collection, options, inspectHTML2, "\n");
|
|
5487
5512
|
}
|
|
5488
|
-
__name(
|
|
5513
|
+
__name(inspectHTMLCollection, "inspectHTMLCollection");
|
|
5489
5514
|
function inspectHTML2(element, options) {
|
|
5490
5515
|
const properties = element.getAttributeNames();
|
|
5491
5516
|
const name = element.tagName.toLowerCase();
|
|
@@ -5500,7 +5525,7 @@ function inspectHTML2(element, options) {
|
|
|
5500
5525
|
}
|
|
5501
5526
|
options.truncate -= propertyContents.length;
|
|
5502
5527
|
const truncate22 = options.truncate;
|
|
5503
|
-
let children =
|
|
5528
|
+
let children = inspectHTMLCollection(element.children, options);
|
|
5504
5529
|
if (children && children.length > truncate22) {
|
|
5505
5530
|
children = `${truncator2}(${element.children.length})`;
|
|
5506
5531
|
}
|
|
@@ -5509,14 +5534,20 @@ function inspectHTML2(element, options) {
|
|
|
5509
5534
|
__name(inspectHTML2, "inspectHTML");
|
|
5510
5535
|
var symbolsSupported2 = typeof Symbol === "function" && typeof Symbol.for === "function";
|
|
5511
5536
|
var chaiInspect2 = symbolsSupported2 ? Symbol.for("chai/inspect") : "@@chai/inspect";
|
|
5512
|
-
var nodeInspect2 =
|
|
5537
|
+
var nodeInspect2 = false;
|
|
5538
|
+
try {
|
|
5539
|
+
const nodeUtil = require_util();
|
|
5540
|
+
nodeInspect2 = nodeUtil.inspect ? nodeUtil.inspect.custom : false;
|
|
5541
|
+
} catch (noNodeInspect) {
|
|
5542
|
+
nodeInspect2 = false;
|
|
5543
|
+
}
|
|
5513
5544
|
var constructorMap2 = /* @__PURE__ */ new WeakMap();
|
|
5514
5545
|
var stringTagMap2 = {};
|
|
5515
5546
|
var baseTypesMap2 = {
|
|
5516
|
-
undefined:
|
|
5517
|
-
null:
|
|
5518
|
-
boolean:
|
|
5519
|
-
Boolean:
|
|
5547
|
+
undefined: (value, options) => options.stylize("undefined", "undefined"),
|
|
5548
|
+
null: (value, options) => options.stylize("null", "null"),
|
|
5549
|
+
boolean: (value, options) => options.stylize(String(value), "boolean"),
|
|
5550
|
+
Boolean: (value, options) => options.stylize(String(value), "boolean"),
|
|
5520
5551
|
number: inspectNumber2,
|
|
5521
5552
|
Number: inspectNumber2,
|
|
5522
5553
|
bigint: inspectBigInt2,
|
|
@@ -5535,8 +5566,8 @@ var baseTypesMap2 = {
|
|
|
5535
5566
|
RegExp: inspectRegExp2,
|
|
5536
5567
|
Promise: promise_default2,
|
|
5537
5568
|
// WeakSet, WeakMap are totally opaque to us
|
|
5538
|
-
WeakSet:
|
|
5539
|
-
WeakMap:
|
|
5569
|
+
WeakSet: (value, options) => options.stylize("WeakSet{\u2026}", "special"),
|
|
5570
|
+
WeakMap: (value, options) => options.stylize("WeakMap{\u2026}", "special"),
|
|
5540
5571
|
Arguments: inspectArguments2,
|
|
5541
5572
|
Int8Array: inspectTypedArray2,
|
|
5542
5573
|
Uint8Array: inspectTypedArray2,
|
|
@@ -5547,18 +5578,18 @@ var baseTypesMap2 = {
|
|
|
5547
5578
|
Uint32Array: inspectTypedArray2,
|
|
5548
5579
|
Float32Array: inspectTypedArray2,
|
|
5549
5580
|
Float64Array: inspectTypedArray2,
|
|
5550
|
-
Generator:
|
|
5551
|
-
DataView:
|
|
5552
|
-
ArrayBuffer:
|
|
5581
|
+
Generator: () => "",
|
|
5582
|
+
DataView: () => "",
|
|
5583
|
+
ArrayBuffer: () => "",
|
|
5553
5584
|
Error: inspectObject22,
|
|
5554
|
-
HTMLCollection:
|
|
5555
|
-
NodeList:
|
|
5585
|
+
HTMLCollection: inspectHTMLCollection,
|
|
5586
|
+
NodeList: inspectHTMLCollection
|
|
5556
5587
|
};
|
|
5557
5588
|
var inspectCustom2 = /* @__PURE__ */ __name((value, options, type3) => {
|
|
5558
5589
|
if (chaiInspect2 in value && typeof value[chaiInspect2] === "function") {
|
|
5559
5590
|
return value[chaiInspect2](options);
|
|
5560
5591
|
}
|
|
5561
|
-
if (nodeInspect2 in value && typeof value[nodeInspect2] === "function") {
|
|
5592
|
+
if (nodeInspect2 && nodeInspect2 in value && typeof value[nodeInspect2] === "function") {
|
|
5562
5593
|
return value[nodeInspect2](options.depth, options);
|
|
5563
5594
|
}
|
|
5564
5595
|
if ("inspect" in value && typeof value.inspect === "function") {
|
|
@@ -5718,7 +5749,7 @@ var config = {
|
|
|
5718
5749
|
deepEqual: null
|
|
5719
5750
|
};
|
|
5720
5751
|
function inspect22(obj, showHidden, depth, colors) {
|
|
5721
|
-
|
|
5752
|
+
var options = {
|
|
5722
5753
|
colors,
|
|
5723
5754
|
depth: typeof depth === "undefined" ? 2 : depth,
|
|
5724
5755
|
showHidden,
|
|
@@ -5728,14 +5759,14 @@ function inspect22(obj, showHidden, depth, colors) {
|
|
|
5728
5759
|
}
|
|
5729
5760
|
__name(inspect22, "inspect");
|
|
5730
5761
|
function objDisplay2(obj) {
|
|
5731
|
-
|
|
5762
|
+
var str = inspect22(obj), type3 = Object.prototype.toString.call(obj);
|
|
5732
5763
|
if (config.truncateThreshold && str.length >= config.truncateThreshold) {
|
|
5733
5764
|
if (type3 === "[object Function]") {
|
|
5734
5765
|
return !obj.name || obj.name === "" ? "[Function]" : "[Function: " + obj.name + "]";
|
|
5735
5766
|
} else if (type3 === "[object Array]") {
|
|
5736
5767
|
return "[ Array(" + obj.length + ") ]";
|
|
5737
5768
|
} else if (type3 === "[object Object]") {
|
|
5738
|
-
|
|
5769
|
+
var keys2 = Object.keys(obj), kstr = keys2.length > 2 ? keys2.splice(0, 2).join(", ") + ", ..." : keys2.join(", ");
|
|
5739
5770
|
return "{ Object (" + kstr + ") }";
|
|
5740
5771
|
} else {
|
|
5741
5772
|
return str;
|
|
@@ -5746,13 +5777,9 @@ function objDisplay2(obj) {
|
|
|
5746
5777
|
}
|
|
5747
5778
|
__name(objDisplay2, "objDisplay");
|
|
5748
5779
|
function getMessage2(obj, args) {
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
let actual = getActual(obj, args);
|
|
5753
|
-
let msg = negate ? args[2] : args[1];
|
|
5754
|
-
let flagMsg = flag(obj, "message");
|
|
5755
|
-
if (typeof msg === "function") msg = msg();
|
|
5780
|
+
var negate = flag(obj, "negate"), val = flag(obj, "object"), expected = args[3], actual = getActual(obj, args), msg = negate ? args[2] : args[1], flagMsg = flag(obj, "message");
|
|
5781
|
+
if (typeof msg === "function")
|
|
5782
|
+
msg = msg();
|
|
5756
5783
|
msg = msg || "";
|
|
5757
5784
|
msg = msg.replace(/#\{this\}/g, function() {
|
|
5758
5785
|
return objDisplay2(val);
|
|
@@ -5765,12 +5792,12 @@ function getMessage2(obj, args) {
|
|
|
5765
5792
|
}
|
|
5766
5793
|
__name(getMessage2, "getMessage");
|
|
5767
5794
|
function transferFlags(assertion, object2, includeAll) {
|
|
5768
|
-
|
|
5795
|
+
var flags = assertion.__flags || (assertion.__flags = /* @__PURE__ */ Object.create(null));
|
|
5769
5796
|
if (!object2.__flags) {
|
|
5770
5797
|
object2.__flags = /* @__PURE__ */ Object.create(null);
|
|
5771
5798
|
}
|
|
5772
5799
|
includeAll = arguments.length === 3 ? includeAll : true;
|
|
5773
|
-
for (
|
|
5800
|
+
for (var flag3 in flags) {
|
|
5774
5801
|
if (includeAll || flag3 !== "object" && flag3 !== "ssfi" && flag3 !== "lockSsfi" && flag3 != "message") {
|
|
5775
5802
|
object2.__flags[flag3] = flags[flag3];
|
|
5776
5803
|
}
|
|
@@ -6158,183 +6185,96 @@ function getPathInfo(obj, path) {
|
|
|
6158
6185
|
return info;
|
|
6159
6186
|
}
|
|
6160
6187
|
__name(getPathInfo, "getPathInfo");
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
* - `object`: This flag contains the target of the assertion. For example, in
|
|
6173
|
-
* the assertion `expect(numKittens).to.equal(7);`, the `object` flag will
|
|
6174
|
-
* contain `numKittens` so that the `equal` assertion can reference it when
|
|
6175
|
-
* needed.
|
|
6176
|
-
*
|
|
6177
|
-
* - `message`: This flag contains an optional custom error message to be
|
|
6178
|
-
* prepended to the error message that's generated by the assertion when it
|
|
6179
|
-
* fails.
|
|
6180
|
-
*
|
|
6181
|
-
* - `ssfi`: This flag stands for "start stack function indicator". It
|
|
6182
|
-
* contains a function reference that serves as the starting point for
|
|
6183
|
-
* removing frames from the stack trace of the error that's created by the
|
|
6184
|
-
* assertion when it fails. The goal is to provide a cleaner stack trace to
|
|
6185
|
-
* end users by removing Chai's internal functions. Note that it only works
|
|
6186
|
-
* in environments that support `Error.captureStackTrace`, and only when
|
|
6187
|
-
* `Chai.config.includeStack` hasn't been set to `false`.
|
|
6188
|
-
*
|
|
6189
|
-
* - `lockSsfi`: This flag controls whether or not the given `ssfi` flag
|
|
6190
|
-
* should retain its current value, even as assertions are chained off of
|
|
6191
|
-
* this object. This is usually set to `true` when creating a new assertion
|
|
6192
|
-
* from within another assertion. It's also temporarily set to `true` before
|
|
6193
|
-
* an overwritten assertion gets called by the overwriting assertion.
|
|
6194
|
-
*
|
|
6195
|
-
* - `eql`: This flag contains the deepEqual function to be used by the assertion.
|
|
6196
|
-
*
|
|
6197
|
-
* @param {unknown} obj target of the assertion
|
|
6198
|
-
* @param {string} [msg] (optional) custom error message
|
|
6199
|
-
* @param {Function} [ssfi] (optional) starting point for removing stack frames
|
|
6200
|
-
* @param {boolean} [lockSsfi] (optional) whether or not the ssfi flag is locked
|
|
6201
|
-
*/
|
|
6202
|
-
constructor(obj, msg, ssfi, lockSsfi) {
|
|
6203
|
-
flag(this, "ssfi", ssfi || _Assertion);
|
|
6204
|
-
flag(this, "lockSsfi", lockSsfi);
|
|
6205
|
-
flag(this, "object", obj);
|
|
6206
|
-
flag(this, "message", msg);
|
|
6207
|
-
flag(this, "eql", config.deepEqual || deep_eql_default);
|
|
6208
|
-
return proxify(this);
|
|
6209
|
-
}
|
|
6210
|
-
/** @returns {boolean} */
|
|
6211
|
-
static get includeStack() {
|
|
6188
|
+
function Assertion(obj, msg, ssfi, lockSsfi) {
|
|
6189
|
+
flag(this, "ssfi", ssfi || Assertion);
|
|
6190
|
+
flag(this, "lockSsfi", lockSsfi);
|
|
6191
|
+
flag(this, "object", obj);
|
|
6192
|
+
flag(this, "message", msg);
|
|
6193
|
+
flag(this, "eql", config.deepEqual || deep_eql_default);
|
|
6194
|
+
return proxify(this);
|
|
6195
|
+
}
|
|
6196
|
+
__name(Assertion, "Assertion");
|
|
6197
|
+
Object.defineProperty(Assertion, "includeStack", {
|
|
6198
|
+
get: function() {
|
|
6212
6199
|
console.warn(
|
|
6213
6200
|
"Assertion.includeStack is deprecated, use chai.config.includeStack instead."
|
|
6214
6201
|
);
|
|
6215
6202
|
return config.includeStack;
|
|
6216
|
-
}
|
|
6217
|
-
|
|
6218
|
-
static set includeStack(value) {
|
|
6203
|
+
},
|
|
6204
|
+
set: function(value) {
|
|
6219
6205
|
console.warn(
|
|
6220
6206
|
"Assertion.includeStack is deprecated, use chai.config.includeStack instead."
|
|
6221
6207
|
);
|
|
6222
6208
|
config.includeStack = value;
|
|
6223
6209
|
}
|
|
6224
|
-
|
|
6225
|
-
|
|
6210
|
+
});
|
|
6211
|
+
Object.defineProperty(Assertion, "showDiff", {
|
|
6212
|
+
get: function() {
|
|
6226
6213
|
console.warn(
|
|
6227
6214
|
"Assertion.showDiff is deprecated, use chai.config.showDiff instead."
|
|
6228
6215
|
);
|
|
6229
6216
|
return config.showDiff;
|
|
6230
|
-
}
|
|
6231
|
-
|
|
6232
|
-
static set showDiff(value) {
|
|
6217
|
+
},
|
|
6218
|
+
set: function(value) {
|
|
6233
6219
|
console.warn(
|
|
6234
6220
|
"Assertion.showDiff is deprecated, use chai.config.showDiff instead."
|
|
6235
6221
|
);
|
|
6236
6222
|
config.showDiff = value;
|
|
6237
6223
|
}
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
* @param {Function} fn
|
|
6277
|
-
* @param {Function} chainingBehavior
|
|
6278
|
-
*/
|
|
6279
|
-
static overwriteChainableMethod(name, fn2, chainingBehavior) {
|
|
6280
|
-
overwriteChainableMethod(this.prototype, name, fn2, chainingBehavior);
|
|
6281
|
-
}
|
|
6282
|
-
/**
|
|
6283
|
-
* ### .assert(expression, message, negateMessage, expected, actual, showDiff)
|
|
6284
|
-
*
|
|
6285
|
-
* Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
|
|
6286
|
-
*
|
|
6287
|
-
* @name assert
|
|
6288
|
-
* @param {unknown} _expr to be tested
|
|
6289
|
-
* @param {string | Function} msg or function that returns message to display if expression fails
|
|
6290
|
-
* @param {string | Function} _negateMsg or function that returns negatedMessage to display if negated expression fails
|
|
6291
|
-
* @param {unknown} expected value (remember to check for negation)
|
|
6292
|
-
* @param {unknown} _actual (optional) will default to `this.obj`
|
|
6293
|
-
* @param {boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails
|
|
6294
|
-
* @returns {void}
|
|
6295
|
-
*/
|
|
6296
|
-
assert(_expr, msg, _negateMsg, expected, _actual, showDiff) {
|
|
6297
|
-
const ok = test2(this, arguments);
|
|
6298
|
-
if (false !== showDiff) showDiff = true;
|
|
6299
|
-
if (void 0 === expected && void 0 === _actual) showDiff = false;
|
|
6300
|
-
if (true !== config.showDiff) showDiff = false;
|
|
6301
|
-
if (!ok) {
|
|
6302
|
-
msg = getMessage2(this, arguments);
|
|
6303
|
-
const actual = getActual(this, arguments);
|
|
6304
|
-
const assertionErrorObjectProperties = {
|
|
6305
|
-
actual,
|
|
6306
|
-
expected,
|
|
6307
|
-
showDiff
|
|
6308
|
-
};
|
|
6309
|
-
const operator = getOperator(this, arguments);
|
|
6310
|
-
if (operator) {
|
|
6311
|
-
assertionErrorObjectProperties.operator = operator;
|
|
6312
|
-
}
|
|
6313
|
-
throw new AssertionError(
|
|
6314
|
-
msg,
|
|
6315
|
-
assertionErrorObjectProperties,
|
|
6316
|
-
// @ts-expect-error Not sure what to do about these types yet
|
|
6317
|
-
config.includeStack ? this.assert : flag(this, "ssfi")
|
|
6318
|
-
);
|
|
6224
|
+
});
|
|
6225
|
+
Assertion.addProperty = function(name, fn2) {
|
|
6226
|
+
addProperty(this.prototype, name, fn2);
|
|
6227
|
+
};
|
|
6228
|
+
Assertion.addMethod = function(name, fn2) {
|
|
6229
|
+
addMethod(this.prototype, name, fn2);
|
|
6230
|
+
};
|
|
6231
|
+
Assertion.addChainableMethod = function(name, fn2, chainingBehavior) {
|
|
6232
|
+
addChainableMethod(this.prototype, name, fn2, chainingBehavior);
|
|
6233
|
+
};
|
|
6234
|
+
Assertion.overwriteProperty = function(name, fn2) {
|
|
6235
|
+
overwriteProperty(this.prototype, name, fn2);
|
|
6236
|
+
};
|
|
6237
|
+
Assertion.overwriteMethod = function(name, fn2) {
|
|
6238
|
+
overwriteMethod(this.prototype, name, fn2);
|
|
6239
|
+
};
|
|
6240
|
+
Assertion.overwriteChainableMethod = function(name, fn2, chainingBehavior) {
|
|
6241
|
+
overwriteChainableMethod(this.prototype, name, fn2, chainingBehavior);
|
|
6242
|
+
};
|
|
6243
|
+
Assertion.prototype.assert = function(expr, msg, negateMsg, expected, _actual, showDiff) {
|
|
6244
|
+
var ok = test2(this, arguments);
|
|
6245
|
+
if (false !== showDiff)
|
|
6246
|
+
showDiff = true;
|
|
6247
|
+
if (void 0 === expected && void 0 === _actual)
|
|
6248
|
+
showDiff = false;
|
|
6249
|
+
if (true !== config.showDiff)
|
|
6250
|
+
showDiff = false;
|
|
6251
|
+
if (!ok) {
|
|
6252
|
+
msg = getMessage2(this, arguments);
|
|
6253
|
+
var actual = getActual(this, arguments);
|
|
6254
|
+
var assertionErrorObjectProperties = {
|
|
6255
|
+
actual,
|
|
6256
|
+
expected,
|
|
6257
|
+
showDiff
|
|
6258
|
+
};
|
|
6259
|
+
var operator = getOperator(this, arguments);
|
|
6260
|
+
if (operator) {
|
|
6261
|
+
assertionErrorObjectProperties.operator = operator;
|
|
6319
6262
|
}
|
|
6263
|
+
throw new AssertionError(
|
|
6264
|
+
msg,
|
|
6265
|
+
assertionErrorObjectProperties,
|
|
6266
|
+
config.includeStack ? this.assert : flag(this, "ssfi")
|
|
6267
|
+
);
|
|
6320
6268
|
}
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
* @returns {unknown}
|
|
6325
|
-
*/
|
|
6326
|
-
get _obj() {
|
|
6269
|
+
};
|
|
6270
|
+
Object.defineProperty(Assertion.prototype, "_obj", {
|
|
6271
|
+
get: function() {
|
|
6327
6272
|
return flag(this, "object");
|
|
6328
|
-
}
|
|
6329
|
-
|
|
6330
|
-
* Quick reference to stored `actual` value for plugin developers.
|
|
6331
|
-
*
|
|
6332
|
-
* @param {unknown} val
|
|
6333
|
-
*/
|
|
6334
|
-
set _obj(val) {
|
|
6273
|
+
},
|
|
6274
|
+
set: function(val) {
|
|
6335
6275
|
flag(this, "object", val);
|
|
6336
6276
|
}
|
|
6337
|
-
};
|
|
6277
|
+
});
|
|
6338
6278
|
function isProxyEnabled() {
|
|
6339
6279
|
return config.useProxy && typeof Proxy !== "undefined" && typeof Reflect !== "undefined";
|
|
6340
6280
|
}
|
|
@@ -6347,9 +6287,10 @@ function addProperty(ctx, name, getter) {
|
|
|
6347
6287
|
if (!isProxyEnabled() && !flag(this, "lockSsfi")) {
|
|
6348
6288
|
flag(this, "ssfi", propertyGetter);
|
|
6349
6289
|
}
|
|
6350
|
-
|
|
6351
|
-
if (result !== void 0)
|
|
6352
|
-
|
|
6290
|
+
var result = getter.call(this);
|
|
6291
|
+
if (result !== void 0)
|
|
6292
|
+
return result;
|
|
6293
|
+
var newAssertion = new Assertion();
|
|
6353
6294
|
transferFlags(this, newAssertion);
|
|
6354
6295
|
return newAssertion;
|
|
6355
6296
|
}, "propertyGetter"),
|
|
@@ -6360,9 +6301,10 @@ __name(addProperty, "addProperty");
|
|
|
6360
6301
|
var fnLengthDesc = Object.getOwnPropertyDescriptor(function() {
|
|
6361
6302
|
}, "length");
|
|
6362
6303
|
function addLengthGuard(fn2, assertionName, isChainable) {
|
|
6363
|
-
if (!fnLengthDesc.configurable)
|
|
6304
|
+
if (!fnLengthDesc.configurable)
|
|
6305
|
+
return fn2;
|
|
6364
6306
|
Object.defineProperty(fn2, "length", {
|
|
6365
|
-
get:
|
|
6307
|
+
get: function() {
|
|
6366
6308
|
if (isChainable) {
|
|
6367
6309
|
throw Error(
|
|
6368
6310
|
"Invalid Chai property: " + assertionName + '.length. Due to a compatibility issue, "length" cannot directly follow "' + assertionName + '". Use "' + assertionName + '.lengthOf" instead.'
|
|
@@ -6371,20 +6313,20 @@ function addLengthGuard(fn2, assertionName, isChainable) {
|
|
|
6371
6313
|
throw Error(
|
|
6372
6314
|
"Invalid Chai property: " + assertionName + '.length. See docs for proper usage of "' + assertionName + '".'
|
|
6373
6315
|
);
|
|
6374
|
-
}
|
|
6316
|
+
}
|
|
6375
6317
|
});
|
|
6376
6318
|
return fn2;
|
|
6377
6319
|
}
|
|
6378
6320
|
__name(addLengthGuard, "addLengthGuard");
|
|
6379
6321
|
function getProperties(object2) {
|
|
6380
|
-
|
|
6322
|
+
var result = Object.getOwnPropertyNames(object2);
|
|
6381
6323
|
function addProperty2(property) {
|
|
6382
6324
|
if (result.indexOf(property) === -1) {
|
|
6383
6325
|
result.push(property);
|
|
6384
6326
|
}
|
|
6385
6327
|
}
|
|
6386
6328
|
__name(addProperty2, "addProperty");
|
|
6387
|
-
|
|
6329
|
+
var proto = Object.getPrototypeOf(object2);
|
|
6388
6330
|
while (proto !== null) {
|
|
6389
6331
|
Object.getOwnPropertyNames(proto).forEach(addProperty2);
|
|
6390
6332
|
proto = Object.getPrototypeOf(proto);
|
|
@@ -6394,7 +6336,8 @@ function getProperties(object2) {
|
|
|
6394
6336
|
__name(getProperties, "getProperties");
|
|
6395
6337
|
var builtins = ["__flags", "__methods", "_obj", "assert"];
|
|
6396
6338
|
function proxify(obj, nonChainableMethodName) {
|
|
6397
|
-
if (!isProxyEnabled())
|
|
6339
|
+
if (!isProxyEnabled())
|
|
6340
|
+
return obj;
|
|
6398
6341
|
return new Proxy(obj, {
|
|
6399
6342
|
get: /* @__PURE__ */ __name(function proxyGetter(target, property) {
|
|
6400
6343
|
if (typeof property === "string" && config.proxyExcludedKeys.indexOf(property) === -1 && !Reflect.has(target, property)) {
|
|
@@ -6403,15 +6346,15 @@ function proxify(obj, nonChainableMethodName) {
|
|
|
6403
6346
|
"Invalid Chai property: " + nonChainableMethodName + "." + property + '. See docs for proper usage of "' + nonChainableMethodName + '".'
|
|
6404
6347
|
);
|
|
6405
6348
|
}
|
|
6406
|
-
|
|
6407
|
-
|
|
6349
|
+
var suggestion = null;
|
|
6350
|
+
var suggestionDistance = 4;
|
|
6408
6351
|
getProperties(target).forEach(function(prop) {
|
|
6409
6352
|
if (
|
|
6410
6353
|
// we actually mean to check `Object.prototype` here
|
|
6411
6354
|
// eslint-disable-next-line no-prototype-builtins
|
|
6412
6355
|
!Object.prototype.hasOwnProperty(prop) && builtins.indexOf(prop) === -1
|
|
6413
6356
|
) {
|
|
6414
|
-
|
|
6357
|
+
var dist = stringDistanceCapped(property, prop, suggestionDistance);
|
|
6415
6358
|
if (dist < suggestionDistance) {
|
|
6416
6359
|
suggestion = prop;
|
|
6417
6360
|
suggestionDistance = dist;
|
|
@@ -6438,25 +6381,25 @@ function stringDistanceCapped(strA, strB, cap) {
|
|
|
6438
6381
|
if (Math.abs(strA.length - strB.length) >= cap) {
|
|
6439
6382
|
return cap;
|
|
6440
6383
|
}
|
|
6441
|
-
|
|
6384
|
+
var memo = [];
|
|
6442
6385
|
for (let i = 0; i <= strA.length; i++) {
|
|
6443
6386
|
memo[i] = Array(strB.length + 1).fill(0);
|
|
6444
6387
|
memo[i][0] = i;
|
|
6445
6388
|
}
|
|
6446
|
-
for (let
|
|
6447
|
-
memo[0][
|
|
6389
|
+
for (let j = 0; j < strB.length; j++) {
|
|
6390
|
+
memo[0][j] = j;
|
|
6448
6391
|
}
|
|
6449
6392
|
for (let i = 1; i <= strA.length; i++) {
|
|
6450
|
-
|
|
6451
|
-
for (let
|
|
6452
|
-
if (Math.abs(i -
|
|
6453
|
-
memo[i][
|
|
6393
|
+
var ch = strA.charCodeAt(i - 1);
|
|
6394
|
+
for (let j = 1; j <= strB.length; j++) {
|
|
6395
|
+
if (Math.abs(i - j) >= cap) {
|
|
6396
|
+
memo[i][j] = cap;
|
|
6454
6397
|
continue;
|
|
6455
6398
|
}
|
|
6456
|
-
memo[i][
|
|
6457
|
-
memo[i - 1][
|
|
6458
|
-
memo[i][
|
|
6459
|
-
memo[i - 1][
|
|
6399
|
+
memo[i][j] = Math.min(
|
|
6400
|
+
memo[i - 1][j] + 1,
|
|
6401
|
+
memo[i][j - 1] + 1,
|
|
6402
|
+
memo[i - 1][j - 1] + (ch === strB.charCodeAt(j - 1) ? 0 : 1)
|
|
6460
6403
|
);
|
|
6461
6404
|
}
|
|
6462
6405
|
}
|
|
@@ -6464,13 +6407,14 @@ function stringDistanceCapped(strA, strB, cap) {
|
|
|
6464
6407
|
}
|
|
6465
6408
|
__name(stringDistanceCapped, "stringDistanceCapped");
|
|
6466
6409
|
function addMethod(ctx, name, method) {
|
|
6467
|
-
|
|
6410
|
+
var methodWrapper = /* @__PURE__ */ __name(function() {
|
|
6468
6411
|
if (!flag(this, "lockSsfi")) {
|
|
6469
6412
|
flag(this, "ssfi", methodWrapper);
|
|
6470
6413
|
}
|
|
6471
|
-
|
|
6472
|
-
if (result !== void 0)
|
|
6473
|
-
|
|
6414
|
+
var result = method.apply(this, arguments);
|
|
6415
|
+
if (result !== void 0)
|
|
6416
|
+
return result;
|
|
6417
|
+
var newAssertion = new Assertion();
|
|
6474
6418
|
transferFlags(this, newAssertion);
|
|
6475
6419
|
return newAssertion;
|
|
6476
6420
|
}, "methodWrapper");
|
|
@@ -6479,22 +6423,23 @@ function addMethod(ctx, name, method) {
|
|
|
6479
6423
|
}
|
|
6480
6424
|
__name(addMethod, "addMethod");
|
|
6481
6425
|
function overwriteProperty(ctx, name, getter) {
|
|
6482
|
-
|
|
6426
|
+
var _get = Object.getOwnPropertyDescriptor(ctx, name), _super = /* @__PURE__ */ __name(function() {
|
|
6483
6427
|
}, "_super");
|
|
6484
|
-
if (_get && "function" === typeof _get.get)
|
|
6428
|
+
if (_get && "function" === typeof _get.get)
|
|
6429
|
+
_super = _get.get;
|
|
6485
6430
|
Object.defineProperty(ctx, name, {
|
|
6486
6431
|
get: /* @__PURE__ */ __name(function overwritingPropertyGetter() {
|
|
6487
6432
|
if (!isProxyEnabled() && !flag(this, "lockSsfi")) {
|
|
6488
6433
|
flag(this, "ssfi", overwritingPropertyGetter);
|
|
6489
6434
|
}
|
|
6490
|
-
|
|
6435
|
+
var origLockSsfi = flag(this, "lockSsfi");
|
|
6491
6436
|
flag(this, "lockSsfi", true);
|
|
6492
|
-
|
|
6437
|
+
var result = getter(_super).call(this);
|
|
6493
6438
|
flag(this, "lockSsfi", origLockSsfi);
|
|
6494
6439
|
if (result !== void 0) {
|
|
6495
6440
|
return result;
|
|
6496
6441
|
}
|
|
6497
|
-
|
|
6442
|
+
var newAssertion = new Assertion();
|
|
6498
6443
|
transferFlags(this, newAssertion);
|
|
6499
6444
|
return newAssertion;
|
|
6500
6445
|
}, "overwritingPropertyGetter"),
|
|
@@ -6503,22 +6448,23 @@ function overwriteProperty(ctx, name, getter) {
|
|
|
6503
6448
|
}
|
|
6504
6449
|
__name(overwriteProperty, "overwriteProperty");
|
|
6505
6450
|
function overwriteMethod(ctx, name, method) {
|
|
6506
|
-
|
|
6451
|
+
var _method = ctx[name], _super = /* @__PURE__ */ __name(function() {
|
|
6507
6452
|
throw new Error(name + " is not a function");
|
|
6508
6453
|
}, "_super");
|
|
6509
|
-
if (_method && "function" === typeof _method)
|
|
6510
|
-
|
|
6454
|
+
if (_method && "function" === typeof _method)
|
|
6455
|
+
_super = _method;
|
|
6456
|
+
var overwritingMethodWrapper = /* @__PURE__ */ __name(function() {
|
|
6511
6457
|
if (!flag(this, "lockSsfi")) {
|
|
6512
6458
|
flag(this, "ssfi", overwritingMethodWrapper);
|
|
6513
6459
|
}
|
|
6514
|
-
|
|
6460
|
+
var origLockSsfi = flag(this, "lockSsfi");
|
|
6515
6461
|
flag(this, "lockSsfi", true);
|
|
6516
|
-
|
|
6462
|
+
var result = method(_super).apply(this, arguments);
|
|
6517
6463
|
flag(this, "lockSsfi", origLockSsfi);
|
|
6518
6464
|
if (result !== void 0) {
|
|
6519
6465
|
return result;
|
|
6520
6466
|
}
|
|
6521
|
-
|
|
6467
|
+
var newAssertion = new Assertion();
|
|
6522
6468
|
transferFlags(this, newAssertion);
|
|
6523
6469
|
return newAssertion;
|
|
6524
6470
|
}, "overwritingMethodWrapper");
|
|
@@ -6530,8 +6476,9 @@ var canSetPrototype = typeof Object.setPrototypeOf === "function";
|
|
|
6530
6476
|
var testFn = /* @__PURE__ */ __name(function() {
|
|
6531
6477
|
}, "testFn");
|
|
6532
6478
|
var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) {
|
|
6533
|
-
|
|
6534
|
-
if (typeof propDesc !== "object")
|
|
6479
|
+
var propDesc = Object.getOwnPropertyDescriptor(testFn, name);
|
|
6480
|
+
if (typeof propDesc !== "object")
|
|
6481
|
+
return true;
|
|
6535
6482
|
return !propDesc.configurable;
|
|
6536
6483
|
});
|
|
6537
6484
|
var call = Function.prototype.call;
|
|
@@ -6541,7 +6488,7 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
6541
6488
|
chainingBehavior = /* @__PURE__ */ __name(function() {
|
|
6542
6489
|
}, "chainingBehavior");
|
|
6543
6490
|
}
|
|
6544
|
-
|
|
6491
|
+
var chainableBehavior = {
|
|
6545
6492
|
method,
|
|
6546
6493
|
chainingBehavior
|
|
6547
6494
|
};
|
|
@@ -6552,31 +6499,31 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
6552
6499
|
Object.defineProperty(ctx, name, {
|
|
6553
6500
|
get: /* @__PURE__ */ __name(function chainableMethodGetter() {
|
|
6554
6501
|
chainableBehavior.chainingBehavior.call(this);
|
|
6555
|
-
|
|
6502
|
+
var chainableMethodWrapper = /* @__PURE__ */ __name(function() {
|
|
6556
6503
|
if (!flag(this, "lockSsfi")) {
|
|
6557
6504
|
flag(this, "ssfi", chainableMethodWrapper);
|
|
6558
6505
|
}
|
|
6559
|
-
|
|
6506
|
+
var result = chainableBehavior.method.apply(this, arguments);
|
|
6560
6507
|
if (result !== void 0) {
|
|
6561
6508
|
return result;
|
|
6562
6509
|
}
|
|
6563
|
-
|
|
6510
|
+
var newAssertion = new Assertion();
|
|
6564
6511
|
transferFlags(this, newAssertion);
|
|
6565
6512
|
return newAssertion;
|
|
6566
6513
|
}, "chainableMethodWrapper");
|
|
6567
6514
|
addLengthGuard(chainableMethodWrapper, name, true);
|
|
6568
6515
|
if (canSetPrototype) {
|
|
6569
|
-
|
|
6516
|
+
var prototype = Object.create(this);
|
|
6570
6517
|
prototype.call = call;
|
|
6571
6518
|
prototype.apply = apply;
|
|
6572
6519
|
Object.setPrototypeOf(chainableMethodWrapper, prototype);
|
|
6573
6520
|
} else {
|
|
6574
|
-
|
|
6521
|
+
var asserterNames = Object.getOwnPropertyNames(ctx);
|
|
6575
6522
|
asserterNames.forEach(function(asserterName) {
|
|
6576
6523
|
if (excludeNames.indexOf(asserterName) !== -1) {
|
|
6577
6524
|
return;
|
|
6578
6525
|
}
|
|
6579
|
-
|
|
6526
|
+
var pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
|
|
6580
6527
|
Object.defineProperty(chainableMethodWrapper, asserterName, pd);
|
|
6581
6528
|
});
|
|
6582
6529
|
}
|
|
@@ -6588,35 +6535,36 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
6588
6535
|
}
|
|
6589
6536
|
__name(addChainableMethod, "addChainableMethod");
|
|
6590
6537
|
function overwriteChainableMethod(ctx, name, method, chainingBehavior) {
|
|
6591
|
-
|
|
6592
|
-
|
|
6538
|
+
var chainableBehavior = ctx.__methods[name];
|
|
6539
|
+
var _chainingBehavior = chainableBehavior.chainingBehavior;
|
|
6593
6540
|
chainableBehavior.chainingBehavior = /* @__PURE__ */ __name(function overwritingChainableMethodGetter() {
|
|
6594
|
-
|
|
6541
|
+
var result = chainingBehavior(_chainingBehavior).call(this);
|
|
6595
6542
|
if (result !== void 0) {
|
|
6596
6543
|
return result;
|
|
6597
6544
|
}
|
|
6598
|
-
|
|
6545
|
+
var newAssertion = new Assertion();
|
|
6599
6546
|
transferFlags(this, newAssertion);
|
|
6600
6547
|
return newAssertion;
|
|
6601
6548
|
}, "overwritingChainableMethodGetter");
|
|
6602
|
-
|
|
6549
|
+
var _method = chainableBehavior.method;
|
|
6603
6550
|
chainableBehavior.method = /* @__PURE__ */ __name(function overwritingChainableMethodWrapper() {
|
|
6604
|
-
|
|
6551
|
+
var result = method(_method).apply(this, arguments);
|
|
6605
6552
|
if (result !== void 0) {
|
|
6606
6553
|
return result;
|
|
6607
6554
|
}
|
|
6608
|
-
|
|
6555
|
+
var newAssertion = new Assertion();
|
|
6609
6556
|
transferFlags(this, newAssertion);
|
|
6610
6557
|
return newAssertion;
|
|
6611
6558
|
}, "overwritingChainableMethodWrapper");
|
|
6612
6559
|
}
|
|
6613
6560
|
__name(overwriteChainableMethod, "overwriteChainableMethod");
|
|
6614
|
-
function compareByInspect(a3,
|
|
6615
|
-
return inspect22(a3) < inspect22(
|
|
6561
|
+
function compareByInspect(a3, b) {
|
|
6562
|
+
return inspect22(a3) < inspect22(b) ? -1 : 1;
|
|
6616
6563
|
}
|
|
6617
6564
|
__name(compareByInspect, "compareByInspect");
|
|
6618
6565
|
function getOwnEnumerablePropertySymbols(obj) {
|
|
6619
|
-
if (typeof Object.getOwnPropertySymbols !== "function")
|
|
6566
|
+
if (typeof Object.getOwnPropertySymbols !== "function")
|
|
6567
|
+
return [];
|
|
6620
6568
|
return Object.getOwnPropertySymbols(obj).filter(function(sym) {
|
|
6621
6569
|
return Object.getOwnPropertyDescriptor(obj, sym).enumerable;
|
|
6622
6570
|
});
|
|
@@ -6628,20 +6576,21 @@ function getOwnEnumerableProperties(obj) {
|
|
|
6628
6576
|
__name(getOwnEnumerableProperties, "getOwnEnumerableProperties");
|
|
6629
6577
|
var isNaN22 = Number.isNaN;
|
|
6630
6578
|
function isObjectType(obj) {
|
|
6631
|
-
|
|
6632
|
-
|
|
6579
|
+
var objectType = type(obj);
|
|
6580
|
+
var objectTypes = ["Array", "Object", "Function"];
|
|
6633
6581
|
return objectTypes.indexOf(objectType) !== -1;
|
|
6634
6582
|
}
|
|
6635
6583
|
__name(isObjectType, "isObjectType");
|
|
6636
6584
|
function getOperator(obj, args) {
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6585
|
+
var operator = flag(obj, "operator");
|
|
6586
|
+
var negate = flag(obj, "negate");
|
|
6587
|
+
var expected = args[3];
|
|
6588
|
+
var msg = negate ? args[2] : args[1];
|
|
6641
6589
|
if (operator) {
|
|
6642
6590
|
return operator;
|
|
6643
6591
|
}
|
|
6644
|
-
if (typeof msg === "function")
|
|
6592
|
+
if (typeof msg === "function")
|
|
6593
|
+
msg = msg();
|
|
6645
6594
|
msg = msg || "";
|
|
6646
6595
|
if (!msg) {
|
|
6647
6596
|
return void 0;
|
|
@@ -6649,7 +6598,7 @@ function getOperator(obj, args) {
|
|
|
6649
6598
|
if (/\shave\s/.test(msg)) {
|
|
6650
6599
|
return void 0;
|
|
6651
6600
|
}
|
|
6652
|
-
|
|
6601
|
+
var isObject3 = isObjectType(expected);
|
|
6653
6602
|
if (/\snot\s/.test(msg)) {
|
|
6654
6603
|
return isObject3 ? "notDeepStrictEqual" : "notStrictEqual";
|
|
6655
6604
|
}
|
|
@@ -6725,9 +6674,10 @@ var functionTypes = {
|
|
|
6725
6674
|
asyncgeneratorfunction: ["asyncgeneratorfunction"]
|
|
6726
6675
|
};
|
|
6727
6676
|
function an(type3, msg) {
|
|
6728
|
-
if (msg)
|
|
6677
|
+
if (msg)
|
|
6678
|
+
flag2(this, "message", msg);
|
|
6729
6679
|
type3 = type3.toLowerCase();
|
|
6730
|
-
|
|
6680
|
+
var obj = flag2(this, "object"), article = ~["a", "e", "i", "o", "u"].indexOf(type3.charAt(0)) ? "an " : "a ";
|
|
6731
6681
|
const detectedType = type(obj).toLowerCase();
|
|
6732
6682
|
if (functionTypes["function"].includes(type3)) {
|
|
6733
6683
|
this.assert(
|
|
@@ -6746,8 +6696,8 @@ function an(type3, msg) {
|
|
|
6746
6696
|
__name(an, "an");
|
|
6747
6697
|
Assertion.addChainableMethod("an", an);
|
|
6748
6698
|
Assertion.addChainableMethod("a", an);
|
|
6749
|
-
function SameValueZero(a3,
|
|
6750
|
-
return isNaN22(a3) && isNaN22(
|
|
6699
|
+
function SameValueZero(a3, b) {
|
|
6700
|
+
return isNaN22(a3) && isNaN22(b) || a3 === b;
|
|
6751
6701
|
}
|
|
6752
6702
|
__name(SameValueZero, "SameValueZero");
|
|
6753
6703
|
function includeChainingBehavior() {
|
|
@@ -6755,10 +6705,11 @@ function includeChainingBehavior() {
|
|
|
6755
6705
|
}
|
|
6756
6706
|
__name(includeChainingBehavior, "includeChainingBehavior");
|
|
6757
6707
|
function include(val, msg) {
|
|
6758
|
-
if (msg)
|
|
6759
|
-
|
|
6708
|
+
if (msg)
|
|
6709
|
+
flag2(this, "message", msg);
|
|
6710
|
+
var obj = flag2(this, "object"), objType = type(obj).toLowerCase(), flagMsg = flag2(this, "message"), negate = flag2(this, "negate"), ssfi = flag2(this, "ssfi"), isDeep = flag2(this, "deep"), descriptor = isDeep ? "deep " : "", isEql = isDeep ? flag2(this, "eql") : SameValueZero;
|
|
6760
6711
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
6761
|
-
|
|
6712
|
+
var included = false;
|
|
6762
6713
|
switch (objType) {
|
|
6763
6714
|
case "string":
|
|
6764
6715
|
included = obj.indexOf(val) !== -1;
|
|
@@ -6796,7 +6747,7 @@ function include(val, msg) {
|
|
|
6796
6747
|
included = obj.indexOf(val) !== -1;
|
|
6797
6748
|
}
|
|
6798
6749
|
break;
|
|
6799
|
-
default:
|
|
6750
|
+
default:
|
|
6800
6751
|
if (val !== Object(val)) {
|
|
6801
6752
|
throw new AssertionError(
|
|
6802
6753
|
flagMsg + "the given combination of arguments (" + objType + " and " + type(val).toLowerCase() + ") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a " + type(val).toLowerCase(),
|
|
@@ -6804,11 +6755,9 @@ function include(val, msg) {
|
|
|
6804
6755
|
ssfi
|
|
6805
6756
|
);
|
|
6806
6757
|
}
|
|
6807
|
-
|
|
6808
|
-
let firstErr = null;
|
|
6809
|
-
let numErrs = 0;
|
|
6758
|
+
var props = Object.keys(val), firstErr = null, numErrs = 0;
|
|
6810
6759
|
props.forEach(function(prop) {
|
|
6811
|
-
|
|
6760
|
+
var propAssertion = new Assertion(obj);
|
|
6812
6761
|
transferFlags(this, propAssertion, true);
|
|
6813
6762
|
flag2(propAssertion, "lockSsfi", true);
|
|
6814
6763
|
if (!negate || props.length === 1) {
|
|
@@ -6821,7 +6770,8 @@ function include(val, msg) {
|
|
|
6821
6770
|
if (!check_error_exports.compatibleConstructor(err, AssertionError)) {
|
|
6822
6771
|
throw err;
|
|
6823
6772
|
}
|
|
6824
|
-
if (firstErr === null)
|
|
6773
|
+
if (firstErr === null)
|
|
6774
|
+
firstErr = err;
|
|
6825
6775
|
numErrs++;
|
|
6826
6776
|
}
|
|
6827
6777
|
}, this);
|
|
@@ -6829,7 +6779,6 @@ function include(val, msg) {
|
|
|
6829
6779
|
throw firstErr;
|
|
6830
6780
|
}
|
|
6831
6781
|
return;
|
|
6832
|
-
}
|
|
6833
6782
|
}
|
|
6834
6783
|
this.assert(
|
|
6835
6784
|
included,
|
|
@@ -6913,7 +6862,7 @@ Assertion.addProperty("NaN", function() {
|
|
|
6913
6862
|
);
|
|
6914
6863
|
});
|
|
6915
6864
|
function assertExist() {
|
|
6916
|
-
|
|
6865
|
+
var val = flag2(this, "object");
|
|
6917
6866
|
this.assert(
|
|
6918
6867
|
val !== null && val !== void 0,
|
|
6919
6868
|
"expected #{this} to exist",
|
|
@@ -6924,7 +6873,7 @@ __name(assertExist, "assertExist");
|
|
|
6924
6873
|
Assertion.addProperty("exist", assertExist);
|
|
6925
6874
|
Assertion.addProperty("exists", assertExist);
|
|
6926
6875
|
Assertion.addProperty("empty", function() {
|
|
6927
|
-
|
|
6876
|
+
var val = flag2(this, "object"), ssfi = flag2(this, "ssfi"), flagMsg = flag2(this, "message"), itemsCount;
|
|
6928
6877
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
6929
6878
|
switch (type(val).toLowerCase()) {
|
|
6930
6879
|
case "array":
|
|
@@ -6942,10 +6891,9 @@ Assertion.addProperty("empty", function() {
|
|
|
6942
6891
|
void 0,
|
|
6943
6892
|
ssfi
|
|
6944
6893
|
);
|
|
6945
|
-
case "function":
|
|
6946
|
-
|
|
6894
|
+
case "function":
|
|
6895
|
+
var msg = flagMsg + ".empty was passed a function " + getName(val);
|
|
6947
6896
|
throw new AssertionError(msg.trim(), void 0, ssfi);
|
|
6948
|
-
}
|
|
6949
6897
|
default:
|
|
6950
6898
|
if (val !== Object(val)) {
|
|
6951
6899
|
throw new AssertionError(
|
|
@@ -6963,7 +6911,7 @@ Assertion.addProperty("empty", function() {
|
|
|
6963
6911
|
);
|
|
6964
6912
|
});
|
|
6965
6913
|
function checkArguments() {
|
|
6966
|
-
|
|
6914
|
+
var obj = flag2(this, "object"), type3 = type(obj);
|
|
6967
6915
|
this.assert(
|
|
6968
6916
|
"Arguments" === type3,
|
|
6969
6917
|
"expected #{this} to be arguments but got " + type3,
|
|
@@ -6974,10 +6922,11 @@ __name(checkArguments, "checkArguments");
|
|
|
6974
6922
|
Assertion.addProperty("arguments", checkArguments);
|
|
6975
6923
|
Assertion.addProperty("Arguments", checkArguments);
|
|
6976
6924
|
function assertEqual(val, msg) {
|
|
6977
|
-
if (msg)
|
|
6978
|
-
|
|
6925
|
+
if (msg)
|
|
6926
|
+
flag2(this, "message", msg);
|
|
6927
|
+
var obj = flag2(this, "object");
|
|
6979
6928
|
if (flag2(this, "deep")) {
|
|
6980
|
-
|
|
6929
|
+
var prevLockSsfi = flag2(this, "lockSsfi");
|
|
6981
6930
|
flag2(this, "lockSsfi", true);
|
|
6982
6931
|
this.eql(val);
|
|
6983
6932
|
flag2(this, "lockSsfi", prevLockSsfi);
|
|
@@ -6997,8 +6946,9 @@ Assertion.addMethod("equal", assertEqual);
|
|
|
6997
6946
|
Assertion.addMethod("equals", assertEqual);
|
|
6998
6947
|
Assertion.addMethod("eq", assertEqual);
|
|
6999
6948
|
function assertEql(obj, msg) {
|
|
7000
|
-
if (msg)
|
|
7001
|
-
|
|
6949
|
+
if (msg)
|
|
6950
|
+
flag2(this, "message", msg);
|
|
6951
|
+
var eql = flag2(this, "eql");
|
|
7002
6952
|
this.assert(
|
|
7003
6953
|
eql(obj, flag2(this, "object")),
|
|
7004
6954
|
"expected #{this} to deeply equal #{exp}",
|
|
@@ -7012,8 +6962,9 @@ __name(assertEql, "assertEql");
|
|
|
7012
6962
|
Assertion.addMethod("eql", assertEql);
|
|
7013
6963
|
Assertion.addMethod("eqls", assertEql);
|
|
7014
6964
|
function assertAbove(n, msg) {
|
|
7015
|
-
if (msg)
|
|
7016
|
-
|
|
6965
|
+
if (msg)
|
|
6966
|
+
flag2(this, "message", msg);
|
|
6967
|
+
var obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase();
|
|
7017
6968
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
7018
6969
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
7019
6970
|
}
|
|
@@ -7030,7 +6981,7 @@ function assertAbove(n, msg) {
|
|
|
7030
6981
|
ssfi
|
|
7031
6982
|
);
|
|
7032
6983
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
7033
|
-
|
|
6984
|
+
var printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
7034
6985
|
throw new AssertionError(
|
|
7035
6986
|
msgPrefix + "expected " + printObj + " to be a number or a date",
|
|
7036
6987
|
void 0,
|
|
@@ -7038,7 +6989,7 @@ function assertAbove(n, msg) {
|
|
|
7038
6989
|
);
|
|
7039
6990
|
}
|
|
7040
6991
|
if (doLength) {
|
|
7041
|
-
|
|
6992
|
+
var descriptor = "length", itemsCount;
|
|
7042
6993
|
if (objType === "map" || objType === "set") {
|
|
7043
6994
|
descriptor = "size";
|
|
7044
6995
|
itemsCount = obj.size;
|
|
@@ -7066,8 +7017,9 @@ Assertion.addMethod("above", assertAbove);
|
|
|
7066
7017
|
Assertion.addMethod("gt", assertAbove);
|
|
7067
7018
|
Assertion.addMethod("greaterThan", assertAbove);
|
|
7068
7019
|
function assertLeast(n, msg) {
|
|
7069
|
-
if (msg)
|
|
7070
|
-
|
|
7020
|
+
if (msg)
|
|
7021
|
+
flag2(this, "message", msg);
|
|
7022
|
+
var obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true;
|
|
7071
7023
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
7072
7024
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
7073
7025
|
}
|
|
@@ -7076,7 +7028,7 @@ function assertLeast(n, msg) {
|
|
|
7076
7028
|
} else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
|
|
7077
7029
|
errorMessage = msgPrefix + "the argument to least must be a number";
|
|
7078
7030
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
7079
|
-
|
|
7031
|
+
var printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
7080
7032
|
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
7081
7033
|
} else {
|
|
7082
7034
|
shouldThrow = false;
|
|
@@ -7085,7 +7037,7 @@ function assertLeast(n, msg) {
|
|
|
7085
7037
|
throw new AssertionError(errorMessage, void 0, ssfi);
|
|
7086
7038
|
}
|
|
7087
7039
|
if (doLength) {
|
|
7088
|
-
|
|
7040
|
+
var descriptor = "length", itemsCount;
|
|
7089
7041
|
if (objType === "map" || objType === "set") {
|
|
7090
7042
|
descriptor = "size";
|
|
7091
7043
|
itemsCount = obj.size;
|
|
@@ -7113,8 +7065,9 @@ Assertion.addMethod("least", assertLeast);
|
|
|
7113
7065
|
Assertion.addMethod("gte", assertLeast);
|
|
7114
7066
|
Assertion.addMethod("greaterThanOrEqual", assertLeast);
|
|
7115
7067
|
function assertBelow(n, msg) {
|
|
7116
|
-
if (msg)
|
|
7117
|
-
|
|
7068
|
+
if (msg)
|
|
7069
|
+
flag2(this, "message", msg);
|
|
7070
|
+
var obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true;
|
|
7118
7071
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
7119
7072
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
7120
7073
|
}
|
|
@@ -7123,7 +7076,7 @@ function assertBelow(n, msg) {
|
|
|
7123
7076
|
} else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
|
|
7124
7077
|
errorMessage = msgPrefix + "the argument to below must be a number";
|
|
7125
7078
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
7126
|
-
|
|
7079
|
+
var printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
7127
7080
|
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
7128
7081
|
} else {
|
|
7129
7082
|
shouldThrow = false;
|
|
@@ -7132,7 +7085,7 @@ function assertBelow(n, msg) {
|
|
|
7132
7085
|
throw new AssertionError(errorMessage, void 0, ssfi);
|
|
7133
7086
|
}
|
|
7134
7087
|
if (doLength) {
|
|
7135
|
-
|
|
7088
|
+
var descriptor = "length", itemsCount;
|
|
7136
7089
|
if (objType === "map" || objType === "set") {
|
|
7137
7090
|
descriptor = "size";
|
|
7138
7091
|
itemsCount = obj.size;
|
|
@@ -7160,8 +7113,9 @@ Assertion.addMethod("below", assertBelow);
|
|
|
7160
7113
|
Assertion.addMethod("lt", assertBelow);
|
|
7161
7114
|
Assertion.addMethod("lessThan", assertBelow);
|
|
7162
7115
|
function assertMost(n, msg) {
|
|
7163
|
-
if (msg)
|
|
7164
|
-
|
|
7116
|
+
if (msg)
|
|
7117
|
+
flag2(this, "message", msg);
|
|
7118
|
+
var obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true;
|
|
7165
7119
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
7166
7120
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
7167
7121
|
}
|
|
@@ -7170,7 +7124,7 @@ function assertMost(n, msg) {
|
|
|
7170
7124
|
} else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
|
|
7171
7125
|
errorMessage = msgPrefix + "the argument to most must be a number";
|
|
7172
7126
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
7173
|
-
|
|
7127
|
+
var printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
7174
7128
|
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
7175
7129
|
} else {
|
|
7176
7130
|
shouldThrow = false;
|
|
@@ -7179,7 +7133,7 @@ function assertMost(n, msg) {
|
|
|
7179
7133
|
throw new AssertionError(errorMessage, void 0, ssfi);
|
|
7180
7134
|
}
|
|
7181
7135
|
if (doLength) {
|
|
7182
|
-
|
|
7136
|
+
var descriptor = "length", itemsCount;
|
|
7183
7137
|
if (objType === "map" || objType === "set") {
|
|
7184
7138
|
descriptor = "size";
|
|
7185
7139
|
itemsCount = obj.size;
|
|
@@ -7207,8 +7161,9 @@ Assertion.addMethod("most", assertMost);
|
|
|
7207
7161
|
Assertion.addMethod("lte", assertMost);
|
|
7208
7162
|
Assertion.addMethod("lessThanOrEqual", assertMost);
|
|
7209
7163
|
Assertion.addMethod("within", function(start, finish, msg) {
|
|
7210
|
-
if (msg)
|
|
7211
|
-
|
|
7164
|
+
if (msg)
|
|
7165
|
+
flag2(this, "message", msg);
|
|
7166
|
+
var obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), startType = type(start).toLowerCase(), finishType = type(finish).toLowerCase(), errorMessage, shouldThrow = true, range = startType === "date" && finishType === "date" ? start.toISOString() + ".." + finish.toISOString() : start + ".." + finish;
|
|
7212
7167
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
7213
7168
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
7214
7169
|
}
|
|
@@ -7217,7 +7172,7 @@ Assertion.addMethod("within", function(start, finish, msg) {
|
|
|
7217
7172
|
} else if ((!isNumeric(start) || !isNumeric(finish)) && (doLength || isNumeric(obj))) {
|
|
7218
7173
|
errorMessage = msgPrefix + "the arguments to within must be numbers";
|
|
7219
7174
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
7220
|
-
|
|
7175
|
+
var printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
7221
7176
|
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
7222
7177
|
} else {
|
|
7223
7178
|
shouldThrow = false;
|
|
@@ -7226,7 +7181,7 @@ Assertion.addMethod("within", function(start, finish, msg) {
|
|
|
7226
7181
|
throw new AssertionError(errorMessage, void 0, ssfi);
|
|
7227
7182
|
}
|
|
7228
7183
|
if (doLength) {
|
|
7229
|
-
|
|
7184
|
+
var descriptor = "length", itemsCount;
|
|
7230
7185
|
if (objType === "map" || objType === "set") {
|
|
7231
7186
|
descriptor = "size";
|
|
7232
7187
|
itemsCount = obj.size;
|
|
@@ -7247,13 +7202,13 @@ Assertion.addMethod("within", function(start, finish, msg) {
|
|
|
7247
7202
|
}
|
|
7248
7203
|
});
|
|
7249
7204
|
function assertInstanceOf(constructor, msg) {
|
|
7250
|
-
if (msg)
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7205
|
+
if (msg)
|
|
7206
|
+
flag2(this, "message", msg);
|
|
7207
|
+
var target = flag2(this, "object");
|
|
7208
|
+
var ssfi = flag2(this, "ssfi");
|
|
7209
|
+
var flagMsg = flag2(this, "message");
|
|
7255
7210
|
try {
|
|
7256
|
-
isInstanceOf = target instanceof constructor;
|
|
7211
|
+
var isInstanceOf = target instanceof constructor;
|
|
7257
7212
|
} catch (err) {
|
|
7258
7213
|
if (err instanceof TypeError) {
|
|
7259
7214
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
@@ -7265,7 +7220,7 @@ function assertInstanceOf(constructor, msg) {
|
|
|
7265
7220
|
}
|
|
7266
7221
|
throw err;
|
|
7267
7222
|
}
|
|
7268
|
-
|
|
7223
|
+
var name = getName(constructor);
|
|
7269
7224
|
if (name == null) {
|
|
7270
7225
|
name = "an unnamed constructor";
|
|
7271
7226
|
}
|
|
@@ -7279,8 +7234,9 @@ __name(assertInstanceOf, "assertInstanceOf");
|
|
|
7279
7234
|
Assertion.addMethod("instanceof", assertInstanceOf);
|
|
7280
7235
|
Assertion.addMethod("instanceOf", assertInstanceOf);
|
|
7281
7236
|
function assertProperty(name, val, msg) {
|
|
7282
|
-
if (msg)
|
|
7283
|
-
|
|
7237
|
+
if (msg)
|
|
7238
|
+
flag2(this, "message", msg);
|
|
7239
|
+
var isNested = flag2(this, "nested"), isOwn = flag2(this, "own"), flagMsg = flag2(this, "message"), obj = flag2(this, "object"), ssfi = flag2(this, "ssfi"), nameType = typeof name;
|
|
7284
7240
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
7285
7241
|
if (isNested) {
|
|
7286
7242
|
if (nameType !== "string") {
|
|
@@ -7313,16 +7269,22 @@ function assertProperty(name, val, msg) {
|
|
|
7313
7269
|
ssfi
|
|
7314
7270
|
);
|
|
7315
7271
|
}
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
if (isDeep)
|
|
7319
|
-
|
|
7320
|
-
if (
|
|
7272
|
+
var isDeep = flag2(this, "deep"), negate = flag2(this, "negate"), pathInfo = isNested ? getPathInfo(obj, name) : null, value = isNested ? pathInfo.value : obj[name], isEql = isDeep ? flag2(this, "eql") : (val1, val2) => val1 === val2;
|
|
7273
|
+
var descriptor = "";
|
|
7274
|
+
if (isDeep)
|
|
7275
|
+
descriptor += "deep ";
|
|
7276
|
+
if (isOwn)
|
|
7277
|
+
descriptor += "own ";
|
|
7278
|
+
if (isNested)
|
|
7279
|
+
descriptor += "nested ";
|
|
7321
7280
|
descriptor += "property ";
|
|
7322
|
-
|
|
7323
|
-
if (isOwn)
|
|
7324
|
-
|
|
7325
|
-
else
|
|
7281
|
+
var hasProperty2;
|
|
7282
|
+
if (isOwn)
|
|
7283
|
+
hasProperty2 = Object.prototype.hasOwnProperty.call(obj, name);
|
|
7284
|
+
else if (isNested)
|
|
7285
|
+
hasProperty2 = pathInfo.exists;
|
|
7286
|
+
else
|
|
7287
|
+
hasProperty2 = hasProperty(obj, name);
|
|
7326
7288
|
if (!negate || arguments.length === 1) {
|
|
7327
7289
|
this.assert(
|
|
7328
7290
|
hasProperty2,
|
|
@@ -7355,10 +7317,11 @@ function assertOwnPropertyDescriptor(name, descriptor, msg) {
|
|
|
7355
7317
|
msg = descriptor;
|
|
7356
7318
|
descriptor = null;
|
|
7357
7319
|
}
|
|
7358
|
-
if (msg)
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7320
|
+
if (msg)
|
|
7321
|
+
flag2(this, "message", msg);
|
|
7322
|
+
var obj = flag2(this, "object");
|
|
7323
|
+
var actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name);
|
|
7324
|
+
var eql = flag2(this, "eql");
|
|
7362
7325
|
if (actualDescriptor && descriptor) {
|
|
7363
7326
|
this.assert(
|
|
7364
7327
|
eql(descriptor, actualDescriptor),
|
|
@@ -7385,8 +7348,9 @@ function assertLengthChain() {
|
|
|
7385
7348
|
}
|
|
7386
7349
|
__name(assertLengthChain, "assertLengthChain");
|
|
7387
7350
|
function assertLength(n, msg) {
|
|
7388
|
-
if (msg)
|
|
7389
|
-
|
|
7351
|
+
if (msg)
|
|
7352
|
+
flag2(this, "message", msg);
|
|
7353
|
+
var obj = flag2(this, "object"), objType = type(obj).toLowerCase(), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), descriptor = "length", itemsCount;
|
|
7390
7354
|
switch (objType) {
|
|
7391
7355
|
case "map":
|
|
7392
7356
|
case "set":
|
|
@@ -7409,8 +7373,9 @@ __name(assertLength, "assertLength");
|
|
|
7409
7373
|
Assertion.addChainableMethod("length", assertLength, assertLengthChain);
|
|
7410
7374
|
Assertion.addChainableMethod("lengthOf", assertLength, assertLengthChain);
|
|
7411
7375
|
function assertMatch(re, msg) {
|
|
7412
|
-
if (msg)
|
|
7413
|
-
|
|
7376
|
+
if (msg)
|
|
7377
|
+
flag2(this, "message", msg);
|
|
7378
|
+
var obj = flag2(this, "object");
|
|
7414
7379
|
this.assert(
|
|
7415
7380
|
re.exec(obj),
|
|
7416
7381
|
"expected #{this} to match " + re,
|
|
@@ -7421,8 +7386,9 @@ __name(assertMatch, "assertMatch");
|
|
|
7421
7386
|
Assertion.addMethod("match", assertMatch);
|
|
7422
7387
|
Assertion.addMethod("matches", assertMatch);
|
|
7423
7388
|
Assertion.addMethod("string", function(str, msg) {
|
|
7424
|
-
if (msg)
|
|
7425
|
-
|
|
7389
|
+
if (msg)
|
|
7390
|
+
flag2(this, "message", msg);
|
|
7391
|
+
var obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7426
7392
|
new Assertion(obj, flagMsg, ssfi, true).is.a("string");
|
|
7427
7393
|
this.assert(
|
|
7428
7394
|
~obj.indexOf(str),
|
|
@@ -7431,9 +7397,9 @@ Assertion.addMethod("string", function(str, msg) {
|
|
|
7431
7397
|
);
|
|
7432
7398
|
});
|
|
7433
7399
|
function assertKeys(keys2) {
|
|
7434
|
-
|
|
7400
|
+
var obj = flag2(this, "object"), objType = type(obj), keysType = type(keys2), ssfi = flag2(this, "ssfi"), isDeep = flag2(this, "deep"), str, deepStr = "", actual, ok = true, flagMsg = flag2(this, "message");
|
|
7435
7401
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
7436
|
-
|
|
7402
|
+
var mixedArgsMsg = flagMsg + "when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";
|
|
7437
7403
|
if (objType === "Map" || objType === "Set") {
|
|
7438
7404
|
deepStr = isDeep ? "deeply " : "";
|
|
7439
7405
|
actual = [];
|
|
@@ -7467,7 +7433,7 @@ function assertKeys(keys2) {
|
|
|
7467
7433
|
if (!keys2.length) {
|
|
7468
7434
|
throw new AssertionError(flagMsg + "keys required", void 0, ssfi);
|
|
7469
7435
|
}
|
|
7470
|
-
|
|
7436
|
+
var len = keys2.length, any = flag2(this, "any"), all = flag2(this, "all"), expected = keys2, isEql = isDeep ? flag2(this, "eql") : (val1, val2) => val1 === val2;
|
|
7471
7437
|
if (!any && !all) {
|
|
7472
7438
|
all = true;
|
|
7473
7439
|
}
|
|
@@ -7492,7 +7458,7 @@ function assertKeys(keys2) {
|
|
|
7492
7458
|
keys2 = keys2.map(function(key) {
|
|
7493
7459
|
return inspect22(key);
|
|
7494
7460
|
});
|
|
7495
|
-
|
|
7461
|
+
var last = keys2.pop();
|
|
7496
7462
|
if (all) {
|
|
7497
7463
|
str = keys2.join(", ") + ", and " + last;
|
|
7498
7464
|
}
|
|
@@ -7517,8 +7483,9 @@ __name(assertKeys, "assertKeys");
|
|
|
7517
7483
|
Assertion.addMethod("keys", assertKeys);
|
|
7518
7484
|
Assertion.addMethod("key", assertKeys);
|
|
7519
7485
|
function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
7520
|
-
if (msg)
|
|
7521
|
-
|
|
7486
|
+
if (msg)
|
|
7487
|
+
flag2(this, "message", msg);
|
|
7488
|
+
var obj = flag2(this, "object"), ssfi = flag2(this, "ssfi"), flagMsg = flag2(this, "message"), negate = flag2(this, "negate") || false;
|
|
7522
7489
|
new Assertion(obj, flagMsg, ssfi, true).is.a("function");
|
|
7523
7490
|
if (isRegExp2(errorLike) || typeof errorLike === "string") {
|
|
7524
7491
|
errMsgMatcher = errorLike;
|
|
@@ -7532,12 +7499,12 @@ function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
|
7532
7499
|
errorWasThrown = true;
|
|
7533
7500
|
caughtErr = err;
|
|
7534
7501
|
}
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7502
|
+
var everyArgIsUndefined = errorLike === void 0 && errMsgMatcher === void 0;
|
|
7503
|
+
var everyArgIsDefined = Boolean(errorLike && errMsgMatcher);
|
|
7504
|
+
var errorLikeFail = false;
|
|
7505
|
+
var errMsgMatcherFail = false;
|
|
7539
7506
|
if (everyArgIsUndefined || !everyArgIsUndefined && !negate) {
|
|
7540
|
-
|
|
7507
|
+
var errorLikeString = "an error";
|
|
7541
7508
|
if (errorLike instanceof Error) {
|
|
7542
7509
|
errorLikeString = "#{exp}";
|
|
7543
7510
|
} else if (errorLike) {
|
|
@@ -7564,7 +7531,7 @@ function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
|
7564
7531
|
}
|
|
7565
7532
|
if (errorLike && caughtErr) {
|
|
7566
7533
|
if (errorLike instanceof Error) {
|
|
7567
|
-
|
|
7534
|
+
var isCompatibleInstance = check_error_exports.compatibleInstance(
|
|
7568
7535
|
caughtErr,
|
|
7569
7536
|
errorLike
|
|
7570
7537
|
);
|
|
@@ -7582,7 +7549,7 @@ function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
|
7582
7549
|
}
|
|
7583
7550
|
}
|
|
7584
7551
|
}
|
|
7585
|
-
|
|
7552
|
+
var isCompatibleConstructor = check_error_exports.compatibleConstructor(
|
|
7586
7553
|
caughtErr,
|
|
7587
7554
|
errorLike
|
|
7588
7555
|
);
|
|
@@ -7601,11 +7568,11 @@ function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
|
7601
7568
|
}
|
|
7602
7569
|
}
|
|
7603
7570
|
if (caughtErr && errMsgMatcher !== void 0 && errMsgMatcher !== null) {
|
|
7604
|
-
|
|
7571
|
+
var placeholder = "including";
|
|
7605
7572
|
if (isRegExp2(errMsgMatcher)) {
|
|
7606
7573
|
placeholder = "matching";
|
|
7607
7574
|
}
|
|
7608
|
-
|
|
7575
|
+
var isCompatibleMessage = check_error_exports.compatibleMessage(
|
|
7609
7576
|
caughtErr,
|
|
7610
7577
|
errMsgMatcher
|
|
7611
7578
|
);
|
|
@@ -7639,8 +7606,9 @@ Assertion.addMethod("throw", assertThrows);
|
|
|
7639
7606
|
Assertion.addMethod("throws", assertThrows);
|
|
7640
7607
|
Assertion.addMethod("Throw", assertThrows);
|
|
7641
7608
|
function respondTo(method, msg) {
|
|
7642
|
-
if (msg)
|
|
7643
|
-
|
|
7609
|
+
if (msg)
|
|
7610
|
+
flag2(this, "message", msg);
|
|
7611
|
+
var obj = flag2(this, "object"), itself = flag2(this, "itself"), context = "function" === typeof obj && !itself ? obj.prototype[method] : obj[method];
|
|
7644
7612
|
this.assert(
|
|
7645
7613
|
"function" === typeof context,
|
|
7646
7614
|
"expected #{this} to respond to " + inspect22(method),
|
|
@@ -7654,9 +7622,10 @@ Assertion.addProperty("itself", function() {
|
|
|
7654
7622
|
flag2(this, "itself", true);
|
|
7655
7623
|
});
|
|
7656
7624
|
function satisfy(matcher, msg) {
|
|
7657
|
-
if (msg)
|
|
7658
|
-
|
|
7659
|
-
|
|
7625
|
+
if (msg)
|
|
7626
|
+
flag2(this, "message", msg);
|
|
7627
|
+
var obj = flag2(this, "object");
|
|
7628
|
+
var result = matcher(obj);
|
|
7660
7629
|
this.assert(
|
|
7661
7630
|
result,
|
|
7662
7631
|
"expected #{this} to satisfy " + objDisplay2(matcher),
|
|
@@ -7669,28 +7638,27 @@ __name(satisfy, "satisfy");
|
|
|
7669
7638
|
Assertion.addMethod("satisfy", satisfy);
|
|
7670
7639
|
Assertion.addMethod("satisfies", satisfy);
|
|
7671
7640
|
function closeTo(expected, delta, msg) {
|
|
7672
|
-
if (msg)
|
|
7673
|
-
|
|
7641
|
+
if (msg)
|
|
7642
|
+
flag2(this, "message", msg);
|
|
7643
|
+
var obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7674
7644
|
new Assertion(obj, flagMsg, ssfi, true).is.numeric;
|
|
7675
7645
|
let message = "A `delta` value is required for `closeTo`";
|
|
7676
|
-
if (delta == void 0)
|
|
7646
|
+
if (delta == void 0)
|
|
7677
7647
|
throw new AssertionError(
|
|
7678
7648
|
flagMsg ? `${flagMsg}: ${message}` : message,
|
|
7679
7649
|
void 0,
|
|
7680
7650
|
ssfi
|
|
7681
7651
|
);
|
|
7682
|
-
}
|
|
7683
7652
|
new Assertion(delta, flagMsg, ssfi, true).is.numeric;
|
|
7684
7653
|
message = "A `expected` value is required for `closeTo`";
|
|
7685
|
-
if (expected == void 0)
|
|
7654
|
+
if (expected == void 0)
|
|
7686
7655
|
throw new AssertionError(
|
|
7687
7656
|
flagMsg ? `${flagMsg}: ${message}` : message,
|
|
7688
7657
|
void 0,
|
|
7689
7658
|
ssfi
|
|
7690
7659
|
);
|
|
7691
|
-
}
|
|
7692
7660
|
new Assertion(expected, flagMsg, ssfi, true).is.numeric;
|
|
7693
|
-
const abs = /* @__PURE__ */ __name((
|
|
7661
|
+
const abs = /* @__PURE__ */ __name((x) => x < 0n ? -x : x, "abs");
|
|
7694
7662
|
const strip = /* @__PURE__ */ __name((number) => parseFloat(parseFloat(number).toPrecision(12)), "strip");
|
|
7695
7663
|
this.assert(
|
|
7696
7664
|
strip(abs(obj - expected)) <= delta,
|
|
@@ -7705,33 +7673,40 @@ function isSubsetOf(_subset, _superset, cmp, contains, ordered) {
|
|
|
7705
7673
|
let superset = Array.from(_superset);
|
|
7706
7674
|
let subset = Array.from(_subset);
|
|
7707
7675
|
if (!contains) {
|
|
7708
|
-
if (subset.length !== superset.length)
|
|
7676
|
+
if (subset.length !== superset.length)
|
|
7677
|
+
return false;
|
|
7709
7678
|
superset = superset.slice();
|
|
7710
7679
|
}
|
|
7711
7680
|
return subset.every(function(elem, idx) {
|
|
7712
|
-
if (ordered)
|
|
7681
|
+
if (ordered)
|
|
7682
|
+
return cmp ? cmp(elem, superset[idx]) : elem === superset[idx];
|
|
7713
7683
|
if (!cmp) {
|
|
7714
|
-
|
|
7715
|
-
if (matchIdx === -1)
|
|
7716
|
-
|
|
7684
|
+
var matchIdx = superset.indexOf(elem);
|
|
7685
|
+
if (matchIdx === -1)
|
|
7686
|
+
return false;
|
|
7687
|
+
if (!contains)
|
|
7688
|
+
superset.splice(matchIdx, 1);
|
|
7717
7689
|
return true;
|
|
7718
7690
|
}
|
|
7719
|
-
return superset.some(function(elem2,
|
|
7720
|
-
if (!cmp(elem, elem2))
|
|
7721
|
-
|
|
7691
|
+
return superset.some(function(elem2, matchIdx2) {
|
|
7692
|
+
if (!cmp(elem, elem2))
|
|
7693
|
+
return false;
|
|
7694
|
+
if (!contains)
|
|
7695
|
+
superset.splice(matchIdx2, 1);
|
|
7722
7696
|
return true;
|
|
7723
7697
|
});
|
|
7724
7698
|
});
|
|
7725
7699
|
}
|
|
7726
7700
|
__name(isSubsetOf, "isSubsetOf");
|
|
7727
7701
|
Assertion.addMethod("members", function(subset, msg) {
|
|
7728
|
-
if (msg)
|
|
7729
|
-
|
|
7702
|
+
if (msg)
|
|
7703
|
+
flag2(this, "message", msg);
|
|
7704
|
+
var obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7730
7705
|
new Assertion(obj, flagMsg, ssfi, true).to.be.iterable;
|
|
7731
7706
|
new Assertion(subset, flagMsg, ssfi, true).to.be.iterable;
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7707
|
+
var contains = flag2(this, "contains");
|
|
7708
|
+
var ordered = flag2(this, "ordered");
|
|
7709
|
+
var subject, failMsg, failNegateMsg;
|
|
7735
7710
|
if (contains) {
|
|
7736
7711
|
subject = ordered ? "an ordered superset" : "a superset";
|
|
7737
7712
|
failMsg = "expected #{this} to be " + subject + " of #{exp}";
|
|
@@ -7741,7 +7716,7 @@ Assertion.addMethod("members", function(subset, msg) {
|
|
|
7741
7716
|
failMsg = "expected #{this} to have the same " + subject + " as #{exp}";
|
|
7742
7717
|
failNegateMsg = "expected #{this} to not have the same " + subject + " as #{exp}";
|
|
7743
7718
|
}
|
|
7744
|
-
|
|
7719
|
+
var cmp = flag2(this, "deep") ? flag2(this, "eql") : void 0;
|
|
7745
7720
|
this.assert(
|
|
7746
7721
|
isSubsetOf(subset, obj, cmp, contains, ordered),
|
|
7747
7722
|
failMsg,
|
|
@@ -7752,8 +7727,9 @@ Assertion.addMethod("members", function(subset, msg) {
|
|
|
7752
7727
|
);
|
|
7753
7728
|
});
|
|
7754
7729
|
Assertion.addProperty("iterable", function(msg) {
|
|
7755
|
-
if (msg)
|
|
7756
|
-
|
|
7730
|
+
if (msg)
|
|
7731
|
+
flag2(this, "message", msg);
|
|
7732
|
+
var obj = flag2(this, "object");
|
|
7757
7733
|
this.assert(
|
|
7758
7734
|
obj != void 0 && obj[Symbol.iterator],
|
|
7759
7735
|
"expected #{this} to be an iterable",
|
|
@@ -7762,8 +7738,9 @@ Assertion.addProperty("iterable", function(msg) {
|
|
|
7762
7738
|
);
|
|
7763
7739
|
});
|
|
7764
7740
|
function oneOf(list, msg) {
|
|
7765
|
-
if (msg)
|
|
7766
|
-
|
|
7741
|
+
if (msg)
|
|
7742
|
+
flag2(this, "message", msg);
|
|
7743
|
+
var expected = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), contains = flag2(this, "contains"), isDeep = flag2(this, "deep"), eql = flag2(this, "eql");
|
|
7767
7744
|
new Assertion(list, flagMsg, ssfi, true).to.be.an("array");
|
|
7768
7745
|
if (contains) {
|
|
7769
7746
|
this.assert(
|
|
@@ -7800,10 +7777,11 @@ function oneOf(list, msg) {
|
|
|
7800
7777
|
__name(oneOf, "oneOf");
|
|
7801
7778
|
Assertion.addMethod("oneOf", oneOf);
|
|
7802
7779
|
function assertChanges(subject, prop, msg) {
|
|
7803
|
-
if (msg)
|
|
7804
|
-
|
|
7780
|
+
if (msg)
|
|
7781
|
+
flag2(this, "message", msg);
|
|
7782
|
+
var fn2 = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7805
7783
|
new Assertion(fn2, flagMsg, ssfi, true).is.a("function");
|
|
7806
|
-
|
|
7784
|
+
var initial;
|
|
7807
7785
|
if (!prop) {
|
|
7808
7786
|
new Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
7809
7787
|
initial = subject();
|
|
@@ -7812,8 +7790,8 @@ function assertChanges(subject, prop, msg) {
|
|
|
7812
7790
|
initial = subject[prop];
|
|
7813
7791
|
}
|
|
7814
7792
|
fn2();
|
|
7815
|
-
|
|
7816
|
-
|
|
7793
|
+
var final = prop === void 0 || prop === null ? subject() : subject[prop];
|
|
7794
|
+
var msgObj = prop === void 0 || prop === null ? initial : "." + prop;
|
|
7817
7795
|
flag2(this, "deltaMsgObj", msgObj);
|
|
7818
7796
|
flag2(this, "initialDeltaValue", initial);
|
|
7819
7797
|
flag2(this, "finalDeltaValue", final);
|
|
@@ -7829,10 +7807,11 @@ __name(assertChanges, "assertChanges");
|
|
|
7829
7807
|
Assertion.addMethod("change", assertChanges);
|
|
7830
7808
|
Assertion.addMethod("changes", assertChanges);
|
|
7831
7809
|
function assertIncreases(subject, prop, msg) {
|
|
7832
|
-
if (msg)
|
|
7833
|
-
|
|
7810
|
+
if (msg)
|
|
7811
|
+
flag2(this, "message", msg);
|
|
7812
|
+
var fn2 = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7834
7813
|
new Assertion(fn2, flagMsg, ssfi, true).is.a("function");
|
|
7835
|
-
|
|
7814
|
+
var initial;
|
|
7836
7815
|
if (!prop) {
|
|
7837
7816
|
new Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
7838
7817
|
initial = subject();
|
|
@@ -7842,8 +7821,8 @@ function assertIncreases(subject, prop, msg) {
|
|
|
7842
7821
|
}
|
|
7843
7822
|
new Assertion(initial, flagMsg, ssfi, true).is.a("number");
|
|
7844
7823
|
fn2();
|
|
7845
|
-
|
|
7846
|
-
|
|
7824
|
+
var final = prop === void 0 || prop === null ? subject() : subject[prop];
|
|
7825
|
+
var msgObj = prop === void 0 || prop === null ? initial : "." + prop;
|
|
7847
7826
|
flag2(this, "deltaMsgObj", msgObj);
|
|
7848
7827
|
flag2(this, "initialDeltaValue", initial);
|
|
7849
7828
|
flag2(this, "finalDeltaValue", final);
|
|
@@ -7859,10 +7838,11 @@ __name(assertIncreases, "assertIncreases");
|
|
|
7859
7838
|
Assertion.addMethod("increase", assertIncreases);
|
|
7860
7839
|
Assertion.addMethod("increases", assertIncreases);
|
|
7861
7840
|
function assertDecreases(subject, prop, msg) {
|
|
7862
|
-
if (msg)
|
|
7863
|
-
|
|
7841
|
+
if (msg)
|
|
7842
|
+
flag2(this, "message", msg);
|
|
7843
|
+
var fn2 = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7864
7844
|
new Assertion(fn2, flagMsg, ssfi, true).is.a("function");
|
|
7865
|
-
|
|
7845
|
+
var initial;
|
|
7866
7846
|
if (!prop) {
|
|
7867
7847
|
new Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
7868
7848
|
initial = subject();
|
|
@@ -7872,8 +7852,8 @@ function assertDecreases(subject, prop, msg) {
|
|
|
7872
7852
|
}
|
|
7873
7853
|
new Assertion(initial, flagMsg, ssfi, true).is.a("number");
|
|
7874
7854
|
fn2();
|
|
7875
|
-
|
|
7876
|
-
|
|
7855
|
+
var final = prop === void 0 || prop === null ? subject() : subject[prop];
|
|
7856
|
+
var msgObj = prop === void 0 || prop === null ? initial : "." + prop;
|
|
7877
7857
|
flag2(this, "deltaMsgObj", msgObj);
|
|
7878
7858
|
flag2(this, "initialDeltaValue", initial);
|
|
7879
7859
|
flag2(this, "finalDeltaValue", final);
|
|
@@ -7889,13 +7869,14 @@ __name(assertDecreases, "assertDecreases");
|
|
|
7889
7869
|
Assertion.addMethod("decrease", assertDecreases);
|
|
7890
7870
|
Assertion.addMethod("decreases", assertDecreases);
|
|
7891
7871
|
function assertDelta(delta, msg) {
|
|
7892
|
-
if (msg)
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7872
|
+
if (msg)
|
|
7873
|
+
flag2(this, "message", msg);
|
|
7874
|
+
var msgObj = flag2(this, "deltaMsgObj");
|
|
7875
|
+
var initial = flag2(this, "initialDeltaValue");
|
|
7876
|
+
var final = flag2(this, "finalDeltaValue");
|
|
7877
|
+
var behavior = flag2(this, "deltaBehavior");
|
|
7878
|
+
var realDelta = flag2(this, "realDelta");
|
|
7879
|
+
var expression;
|
|
7899
7880
|
if (behavior === "change") {
|
|
7900
7881
|
expression = Math.abs(final - initial) === Math.abs(delta);
|
|
7901
7882
|
} else {
|
|
@@ -7910,8 +7891,8 @@ function assertDelta(delta, msg) {
|
|
|
7910
7891
|
__name(assertDelta, "assertDelta");
|
|
7911
7892
|
Assertion.addMethod("by", assertDelta);
|
|
7912
7893
|
Assertion.addProperty("extensible", function() {
|
|
7913
|
-
|
|
7914
|
-
|
|
7894
|
+
var obj = flag2(this, "object");
|
|
7895
|
+
var isExtensible = obj === Object(obj) && Object.isExtensible(obj);
|
|
7915
7896
|
this.assert(
|
|
7916
7897
|
isExtensible,
|
|
7917
7898
|
"expected #{this} to be extensible",
|
|
@@ -7919,8 +7900,8 @@ Assertion.addProperty("extensible", function() {
|
|
|
7919
7900
|
);
|
|
7920
7901
|
});
|
|
7921
7902
|
Assertion.addProperty("sealed", function() {
|
|
7922
|
-
|
|
7923
|
-
|
|
7903
|
+
var obj = flag2(this, "object");
|
|
7904
|
+
var isSealed = obj === Object(obj) ? Object.isSealed(obj) : true;
|
|
7924
7905
|
this.assert(
|
|
7925
7906
|
isSealed,
|
|
7926
7907
|
"expected #{this} to be sealed",
|
|
@@ -7928,8 +7909,8 @@ Assertion.addProperty("sealed", function() {
|
|
|
7928
7909
|
);
|
|
7929
7910
|
});
|
|
7930
7911
|
Assertion.addProperty("frozen", function() {
|
|
7931
|
-
|
|
7932
|
-
|
|
7912
|
+
var obj = flag2(this, "object");
|
|
7913
|
+
var isFrozen = obj === Object(obj) ? Object.isFrozen(obj) : true;
|
|
7933
7914
|
this.assert(
|
|
7934
7915
|
isFrozen,
|
|
7935
7916
|
"expected #{this} to be frozen",
|
|
@@ -7937,7 +7918,7 @@ Assertion.addProperty("frozen", function() {
|
|
|
7937
7918
|
);
|
|
7938
7919
|
});
|
|
7939
7920
|
Assertion.addProperty("finite", function(_msg) {
|
|
7940
|
-
|
|
7921
|
+
var obj = flag2(this, "object");
|
|
7941
7922
|
this.assert(
|
|
7942
7923
|
typeof obj === "number" && isFinite(obj),
|
|
7943
7924
|
"expected #{this} to be a finite number",
|
|
@@ -7975,8 +7956,8 @@ function compareSubset(expected, actual) {
|
|
|
7975
7956
|
}
|
|
7976
7957
|
}
|
|
7977
7958
|
return Object.keys(expected).every(function(key) {
|
|
7978
|
-
|
|
7979
|
-
|
|
7959
|
+
var expectedValue = expected[key];
|
|
7960
|
+
var actualValue = actual[key];
|
|
7980
7961
|
if (typeof expectedValue === "object" && expectedValue !== null && actualValue !== null) {
|
|
7981
7962
|
return compareSubset(expectedValue, actualValue);
|
|
7982
7963
|
}
|
|
@@ -8046,7 +8027,7 @@ function loadShould() {
|
|
|
8046
8027
|
get: shouldGetter,
|
|
8047
8028
|
configurable: true
|
|
8048
8029
|
});
|
|
8049
|
-
|
|
8030
|
+
var should2 = {};
|
|
8050
8031
|
should2.fail = function(actual, expected, message, operator) {
|
|
8051
8032
|
if (arguments.length < 2) {
|
|
8052
8033
|
message = actual;
|
|
@@ -8089,12 +8070,12 @@ function loadShould() {
|
|
|
8089
8070
|
__name(loadShould, "loadShould");
|
|
8090
8071
|
var should = loadShould;
|
|
8091
8072
|
var Should = loadShould;
|
|
8092
|
-
function
|
|
8093
|
-
|
|
8073
|
+
function assert2(express, errmsg) {
|
|
8074
|
+
var test22 = new Assertion(null, null, assert2, true);
|
|
8094
8075
|
test22.assert(express, errmsg, "[ negation message unavailable ]");
|
|
8095
8076
|
}
|
|
8096
|
-
__name(
|
|
8097
|
-
|
|
8077
|
+
__name(assert2, "assert");
|
|
8078
|
+
assert2.fail = function(actual, expected, message, operator) {
|
|
8098
8079
|
if (arguments.length < 2) {
|
|
8099
8080
|
message = actual;
|
|
8100
8081
|
actual = void 0;
|
|
@@ -8107,17 +8088,17 @@ assert.fail = function(actual, expected, message, operator) {
|
|
|
8107
8088
|
expected,
|
|
8108
8089
|
operator
|
|
8109
8090
|
},
|
|
8110
|
-
|
|
8091
|
+
assert2.fail
|
|
8111
8092
|
);
|
|
8112
8093
|
};
|
|
8113
|
-
|
|
8114
|
-
new Assertion(val, msg,
|
|
8094
|
+
assert2.isOk = function(val, msg) {
|
|
8095
|
+
new Assertion(val, msg, assert2.isOk, true).is.ok;
|
|
8115
8096
|
};
|
|
8116
|
-
|
|
8117
|
-
new Assertion(val, msg,
|
|
8097
|
+
assert2.isNotOk = function(val, msg) {
|
|
8098
|
+
new Assertion(val, msg, assert2.isNotOk, true).is.not.ok;
|
|
8118
8099
|
};
|
|
8119
|
-
|
|
8120
|
-
|
|
8100
|
+
assert2.equal = function(act, exp, msg) {
|
|
8101
|
+
var test22 = new Assertion(act, msg, assert2.equal, true);
|
|
8121
8102
|
test22.assert(
|
|
8122
8103
|
exp == flag(test22, "object"),
|
|
8123
8104
|
"expected #{this} to equal #{exp}",
|
|
@@ -8127,8 +8108,8 @@ assert.equal = function(act, exp, msg) {
|
|
|
8127
8108
|
true
|
|
8128
8109
|
);
|
|
8129
8110
|
};
|
|
8130
|
-
|
|
8131
|
-
|
|
8111
|
+
assert2.notEqual = function(act, exp, msg) {
|
|
8112
|
+
var test22 = new Assertion(act, msg, assert2.notEqual, true);
|
|
8132
8113
|
test22.assert(
|
|
8133
8114
|
exp != flag(test22, "object"),
|
|
8134
8115
|
"expected #{this} to not equal #{exp}",
|
|
@@ -8138,371 +8119,371 @@ assert.notEqual = function(act, exp, msg) {
|
|
|
8138
8119
|
true
|
|
8139
8120
|
);
|
|
8140
8121
|
};
|
|
8141
|
-
|
|
8142
|
-
new Assertion(act, msg,
|
|
8122
|
+
assert2.strictEqual = function(act, exp, msg) {
|
|
8123
|
+
new Assertion(act, msg, assert2.strictEqual, true).to.equal(exp);
|
|
8143
8124
|
};
|
|
8144
|
-
|
|
8145
|
-
new Assertion(act, msg,
|
|
8125
|
+
assert2.notStrictEqual = function(act, exp, msg) {
|
|
8126
|
+
new Assertion(act, msg, assert2.notStrictEqual, true).to.not.equal(exp);
|
|
8146
8127
|
};
|
|
8147
|
-
|
|
8148
|
-
new Assertion(act, msg,
|
|
8128
|
+
assert2.deepEqual = assert2.deepStrictEqual = function(act, exp, msg) {
|
|
8129
|
+
new Assertion(act, msg, assert2.deepEqual, true).to.eql(exp);
|
|
8149
8130
|
};
|
|
8150
|
-
|
|
8151
|
-
new Assertion(act, msg,
|
|
8131
|
+
assert2.notDeepEqual = function(act, exp, msg) {
|
|
8132
|
+
new Assertion(act, msg, assert2.notDeepEqual, true).to.not.eql(exp);
|
|
8152
8133
|
};
|
|
8153
|
-
|
|
8154
|
-
new Assertion(val, msg,
|
|
8134
|
+
assert2.isAbove = function(val, abv, msg) {
|
|
8135
|
+
new Assertion(val, msg, assert2.isAbove, true).to.be.above(abv);
|
|
8155
8136
|
};
|
|
8156
|
-
|
|
8157
|
-
new Assertion(val, msg,
|
|
8137
|
+
assert2.isAtLeast = function(val, atlst, msg) {
|
|
8138
|
+
new Assertion(val, msg, assert2.isAtLeast, true).to.be.least(atlst);
|
|
8158
8139
|
};
|
|
8159
|
-
|
|
8160
|
-
new Assertion(val, msg,
|
|
8140
|
+
assert2.isBelow = function(val, blw, msg) {
|
|
8141
|
+
new Assertion(val, msg, assert2.isBelow, true).to.be.below(blw);
|
|
8161
8142
|
};
|
|
8162
|
-
|
|
8163
|
-
new Assertion(val, msg,
|
|
8143
|
+
assert2.isAtMost = function(val, atmst, msg) {
|
|
8144
|
+
new Assertion(val, msg, assert2.isAtMost, true).to.be.most(atmst);
|
|
8164
8145
|
};
|
|
8165
|
-
|
|
8166
|
-
new Assertion(val, msg,
|
|
8146
|
+
assert2.isTrue = function(val, msg) {
|
|
8147
|
+
new Assertion(val, msg, assert2.isTrue, true).is["true"];
|
|
8167
8148
|
};
|
|
8168
|
-
|
|
8169
|
-
new Assertion(val, msg,
|
|
8149
|
+
assert2.isNotTrue = function(val, msg) {
|
|
8150
|
+
new Assertion(val, msg, assert2.isNotTrue, true).to.not.equal(true);
|
|
8170
8151
|
};
|
|
8171
|
-
|
|
8172
|
-
new Assertion(val, msg,
|
|
8152
|
+
assert2.isFalse = function(val, msg) {
|
|
8153
|
+
new Assertion(val, msg, assert2.isFalse, true).is["false"];
|
|
8173
8154
|
};
|
|
8174
|
-
|
|
8175
|
-
new Assertion(val, msg,
|
|
8155
|
+
assert2.isNotFalse = function(val, msg) {
|
|
8156
|
+
new Assertion(val, msg, assert2.isNotFalse, true).to.not.equal(false);
|
|
8176
8157
|
};
|
|
8177
|
-
|
|
8178
|
-
new Assertion(val, msg,
|
|
8158
|
+
assert2.isNull = function(val, msg) {
|
|
8159
|
+
new Assertion(val, msg, assert2.isNull, true).to.equal(null);
|
|
8179
8160
|
};
|
|
8180
|
-
|
|
8181
|
-
new Assertion(val, msg,
|
|
8161
|
+
assert2.isNotNull = function(val, msg) {
|
|
8162
|
+
new Assertion(val, msg, assert2.isNotNull, true).to.not.equal(null);
|
|
8182
8163
|
};
|
|
8183
|
-
|
|
8184
|
-
new Assertion(val, msg,
|
|
8164
|
+
assert2.isNaN = function(val, msg) {
|
|
8165
|
+
new Assertion(val, msg, assert2.isNaN, true).to.be.NaN;
|
|
8185
8166
|
};
|
|
8186
|
-
|
|
8187
|
-
new Assertion(value, message,
|
|
8167
|
+
assert2.isNotNaN = function(value, message) {
|
|
8168
|
+
new Assertion(value, message, assert2.isNotNaN, true).not.to.be.NaN;
|
|
8188
8169
|
};
|
|
8189
|
-
|
|
8190
|
-
new Assertion(val, msg,
|
|
8170
|
+
assert2.exists = function(val, msg) {
|
|
8171
|
+
new Assertion(val, msg, assert2.exists, true).to.exist;
|
|
8191
8172
|
};
|
|
8192
|
-
|
|
8193
|
-
new Assertion(val, msg,
|
|
8173
|
+
assert2.notExists = function(val, msg) {
|
|
8174
|
+
new Assertion(val, msg, assert2.notExists, true).to.not.exist;
|
|
8194
8175
|
};
|
|
8195
|
-
|
|
8196
|
-
new Assertion(val, msg,
|
|
8176
|
+
assert2.isUndefined = function(val, msg) {
|
|
8177
|
+
new Assertion(val, msg, assert2.isUndefined, true).to.equal(void 0);
|
|
8197
8178
|
};
|
|
8198
|
-
|
|
8199
|
-
new Assertion(val, msg,
|
|
8179
|
+
assert2.isDefined = function(val, msg) {
|
|
8180
|
+
new Assertion(val, msg, assert2.isDefined, true).to.not.equal(void 0);
|
|
8200
8181
|
};
|
|
8201
|
-
|
|
8202
|
-
new Assertion(value, message,
|
|
8182
|
+
assert2.isCallable = function(value, message) {
|
|
8183
|
+
new Assertion(value, message, assert2.isCallable, true).is.callable;
|
|
8203
8184
|
};
|
|
8204
|
-
|
|
8205
|
-
new Assertion(value, message,
|
|
8185
|
+
assert2.isNotCallable = function(value, message) {
|
|
8186
|
+
new Assertion(value, message, assert2.isNotCallable, true).is.not.callable;
|
|
8206
8187
|
};
|
|
8207
|
-
|
|
8208
|
-
new Assertion(val, msg,
|
|
8188
|
+
assert2.isObject = function(val, msg) {
|
|
8189
|
+
new Assertion(val, msg, assert2.isObject, true).to.be.a("object");
|
|
8209
8190
|
};
|
|
8210
|
-
|
|
8211
|
-
new Assertion(val, msg,
|
|
8191
|
+
assert2.isNotObject = function(val, msg) {
|
|
8192
|
+
new Assertion(val, msg, assert2.isNotObject, true).to.not.be.a("object");
|
|
8212
8193
|
};
|
|
8213
|
-
|
|
8214
|
-
new Assertion(val, msg,
|
|
8194
|
+
assert2.isArray = function(val, msg) {
|
|
8195
|
+
new Assertion(val, msg, assert2.isArray, true).to.be.an("array");
|
|
8215
8196
|
};
|
|
8216
|
-
|
|
8217
|
-
new Assertion(val, msg,
|
|
8197
|
+
assert2.isNotArray = function(val, msg) {
|
|
8198
|
+
new Assertion(val, msg, assert2.isNotArray, true).to.not.be.an("array");
|
|
8218
8199
|
};
|
|
8219
|
-
|
|
8220
|
-
new Assertion(val, msg,
|
|
8200
|
+
assert2.isString = function(val, msg) {
|
|
8201
|
+
new Assertion(val, msg, assert2.isString, true).to.be.a("string");
|
|
8221
8202
|
};
|
|
8222
|
-
|
|
8223
|
-
new Assertion(val, msg,
|
|
8203
|
+
assert2.isNotString = function(val, msg) {
|
|
8204
|
+
new Assertion(val, msg, assert2.isNotString, true).to.not.be.a("string");
|
|
8224
8205
|
};
|
|
8225
|
-
|
|
8226
|
-
new Assertion(val, msg,
|
|
8206
|
+
assert2.isNumber = function(val, msg) {
|
|
8207
|
+
new Assertion(val, msg, assert2.isNumber, true).to.be.a("number");
|
|
8227
8208
|
};
|
|
8228
|
-
|
|
8229
|
-
new Assertion(val, msg,
|
|
8209
|
+
assert2.isNotNumber = function(val, msg) {
|
|
8210
|
+
new Assertion(val, msg, assert2.isNotNumber, true).to.not.be.a("number");
|
|
8230
8211
|
};
|
|
8231
|
-
|
|
8232
|
-
new Assertion(val, msg,
|
|
8212
|
+
assert2.isNumeric = function(val, msg) {
|
|
8213
|
+
new Assertion(val, msg, assert2.isNumeric, true).is.numeric;
|
|
8233
8214
|
};
|
|
8234
|
-
|
|
8235
|
-
new Assertion(val, msg,
|
|
8215
|
+
assert2.isNotNumeric = function(val, msg) {
|
|
8216
|
+
new Assertion(val, msg, assert2.isNotNumeric, true).is.not.numeric;
|
|
8236
8217
|
};
|
|
8237
|
-
|
|
8238
|
-
new Assertion(val, msg,
|
|
8218
|
+
assert2.isFinite = function(val, msg) {
|
|
8219
|
+
new Assertion(val, msg, assert2.isFinite, true).to.be.finite;
|
|
8239
8220
|
};
|
|
8240
|
-
|
|
8241
|
-
new Assertion(val, msg,
|
|
8221
|
+
assert2.isBoolean = function(val, msg) {
|
|
8222
|
+
new Assertion(val, msg, assert2.isBoolean, true).to.be.a("boolean");
|
|
8242
8223
|
};
|
|
8243
|
-
|
|
8244
|
-
new Assertion(val, msg,
|
|
8224
|
+
assert2.isNotBoolean = function(val, msg) {
|
|
8225
|
+
new Assertion(val, msg, assert2.isNotBoolean, true).to.not.be.a("boolean");
|
|
8245
8226
|
};
|
|
8246
|
-
|
|
8247
|
-
new Assertion(val, msg,
|
|
8227
|
+
assert2.typeOf = function(val, type3, msg) {
|
|
8228
|
+
new Assertion(val, msg, assert2.typeOf, true).to.be.a(type3);
|
|
8248
8229
|
};
|
|
8249
|
-
|
|
8250
|
-
new Assertion(value, message,
|
|
8230
|
+
assert2.notTypeOf = function(value, type3, message) {
|
|
8231
|
+
new Assertion(value, message, assert2.notTypeOf, true).to.not.be.a(type3);
|
|
8251
8232
|
};
|
|
8252
|
-
|
|
8253
|
-
new Assertion(val, msg,
|
|
8233
|
+
assert2.instanceOf = function(val, type3, msg) {
|
|
8234
|
+
new Assertion(val, msg, assert2.instanceOf, true).to.be.instanceOf(type3);
|
|
8254
8235
|
};
|
|
8255
|
-
|
|
8256
|
-
new Assertion(val, msg,
|
|
8236
|
+
assert2.notInstanceOf = function(val, type3, msg) {
|
|
8237
|
+
new Assertion(val, msg, assert2.notInstanceOf, true).to.not.be.instanceOf(
|
|
8257
8238
|
type3
|
|
8258
8239
|
);
|
|
8259
8240
|
};
|
|
8260
|
-
|
|
8261
|
-
new Assertion(exp, msg,
|
|
8241
|
+
assert2.include = function(exp, inc, msg) {
|
|
8242
|
+
new Assertion(exp, msg, assert2.include, true).include(inc);
|
|
8262
8243
|
};
|
|
8263
|
-
|
|
8264
|
-
new Assertion(exp, msg,
|
|
8244
|
+
assert2.notInclude = function(exp, inc, msg) {
|
|
8245
|
+
new Assertion(exp, msg, assert2.notInclude, true).not.include(inc);
|
|
8265
8246
|
};
|
|
8266
|
-
|
|
8267
|
-
new Assertion(exp, msg,
|
|
8247
|
+
assert2.deepInclude = function(exp, inc, msg) {
|
|
8248
|
+
new Assertion(exp, msg, assert2.deepInclude, true).deep.include(inc);
|
|
8268
8249
|
};
|
|
8269
|
-
|
|
8270
|
-
new Assertion(exp, msg,
|
|
8250
|
+
assert2.notDeepInclude = function(exp, inc, msg) {
|
|
8251
|
+
new Assertion(exp, msg, assert2.notDeepInclude, true).not.deep.include(inc);
|
|
8271
8252
|
};
|
|
8272
|
-
|
|
8273
|
-
new Assertion(exp, msg,
|
|
8253
|
+
assert2.nestedInclude = function(exp, inc, msg) {
|
|
8254
|
+
new Assertion(exp, msg, assert2.nestedInclude, true).nested.include(inc);
|
|
8274
8255
|
};
|
|
8275
|
-
|
|
8276
|
-
new Assertion(exp, msg,
|
|
8256
|
+
assert2.notNestedInclude = function(exp, inc, msg) {
|
|
8257
|
+
new Assertion(exp, msg, assert2.notNestedInclude, true).not.nested.include(
|
|
8277
8258
|
inc
|
|
8278
8259
|
);
|
|
8279
8260
|
};
|
|
8280
|
-
|
|
8281
|
-
new Assertion(exp, msg,
|
|
8261
|
+
assert2.deepNestedInclude = function(exp, inc, msg) {
|
|
8262
|
+
new Assertion(exp, msg, assert2.deepNestedInclude, true).deep.nested.include(
|
|
8282
8263
|
inc
|
|
8283
8264
|
);
|
|
8284
8265
|
};
|
|
8285
|
-
|
|
8266
|
+
assert2.notDeepNestedInclude = function(exp, inc, msg) {
|
|
8286
8267
|
new Assertion(
|
|
8287
8268
|
exp,
|
|
8288
8269
|
msg,
|
|
8289
|
-
|
|
8270
|
+
assert2.notDeepNestedInclude,
|
|
8290
8271
|
true
|
|
8291
8272
|
).not.deep.nested.include(inc);
|
|
8292
8273
|
};
|
|
8293
|
-
|
|
8294
|
-
new Assertion(exp, msg,
|
|
8274
|
+
assert2.ownInclude = function(exp, inc, msg) {
|
|
8275
|
+
new Assertion(exp, msg, assert2.ownInclude, true).own.include(inc);
|
|
8295
8276
|
};
|
|
8296
|
-
|
|
8297
|
-
new Assertion(exp, msg,
|
|
8277
|
+
assert2.notOwnInclude = function(exp, inc, msg) {
|
|
8278
|
+
new Assertion(exp, msg, assert2.notOwnInclude, true).not.own.include(inc);
|
|
8298
8279
|
};
|
|
8299
|
-
|
|
8300
|
-
new Assertion(exp, msg,
|
|
8280
|
+
assert2.deepOwnInclude = function(exp, inc, msg) {
|
|
8281
|
+
new Assertion(exp, msg, assert2.deepOwnInclude, true).deep.own.include(inc);
|
|
8301
8282
|
};
|
|
8302
|
-
|
|
8303
|
-
new Assertion(exp, msg,
|
|
8283
|
+
assert2.notDeepOwnInclude = function(exp, inc, msg) {
|
|
8284
|
+
new Assertion(exp, msg, assert2.notDeepOwnInclude, true).not.deep.own.include(
|
|
8304
8285
|
inc
|
|
8305
8286
|
);
|
|
8306
8287
|
};
|
|
8307
|
-
|
|
8308
|
-
new Assertion(exp, msg,
|
|
8288
|
+
assert2.match = function(exp, re, msg) {
|
|
8289
|
+
new Assertion(exp, msg, assert2.match, true).to.match(re);
|
|
8309
8290
|
};
|
|
8310
|
-
|
|
8311
|
-
new Assertion(exp, msg,
|
|
8291
|
+
assert2.notMatch = function(exp, re, msg) {
|
|
8292
|
+
new Assertion(exp, msg, assert2.notMatch, true).to.not.match(re);
|
|
8312
8293
|
};
|
|
8313
|
-
|
|
8314
|
-
new Assertion(obj, msg,
|
|
8294
|
+
assert2.property = function(obj, prop, msg) {
|
|
8295
|
+
new Assertion(obj, msg, assert2.property, true).to.have.property(prop);
|
|
8315
8296
|
};
|
|
8316
|
-
|
|
8317
|
-
new Assertion(obj, msg,
|
|
8297
|
+
assert2.notProperty = function(obj, prop, msg) {
|
|
8298
|
+
new Assertion(obj, msg, assert2.notProperty, true).to.not.have.property(prop);
|
|
8318
8299
|
};
|
|
8319
|
-
|
|
8320
|
-
new Assertion(obj, msg,
|
|
8300
|
+
assert2.propertyVal = function(obj, prop, val, msg) {
|
|
8301
|
+
new Assertion(obj, msg, assert2.propertyVal, true).to.have.property(prop, val);
|
|
8321
8302
|
};
|
|
8322
|
-
|
|
8323
|
-
new Assertion(obj, msg,
|
|
8303
|
+
assert2.notPropertyVal = function(obj, prop, val, msg) {
|
|
8304
|
+
new Assertion(obj, msg, assert2.notPropertyVal, true).to.not.have.property(
|
|
8324
8305
|
prop,
|
|
8325
8306
|
val
|
|
8326
8307
|
);
|
|
8327
8308
|
};
|
|
8328
|
-
|
|
8329
|
-
new Assertion(obj, msg,
|
|
8309
|
+
assert2.deepPropertyVal = function(obj, prop, val, msg) {
|
|
8310
|
+
new Assertion(obj, msg, assert2.deepPropertyVal, true).to.have.deep.property(
|
|
8330
8311
|
prop,
|
|
8331
8312
|
val
|
|
8332
8313
|
);
|
|
8333
8314
|
};
|
|
8334
|
-
|
|
8315
|
+
assert2.notDeepPropertyVal = function(obj, prop, val, msg) {
|
|
8335
8316
|
new Assertion(
|
|
8336
8317
|
obj,
|
|
8337
8318
|
msg,
|
|
8338
|
-
|
|
8319
|
+
assert2.notDeepPropertyVal,
|
|
8339
8320
|
true
|
|
8340
8321
|
).to.not.have.deep.property(prop, val);
|
|
8341
8322
|
};
|
|
8342
|
-
|
|
8343
|
-
new Assertion(obj, msg,
|
|
8323
|
+
assert2.ownProperty = function(obj, prop, msg) {
|
|
8324
|
+
new Assertion(obj, msg, assert2.ownProperty, true).to.have.own.property(prop);
|
|
8344
8325
|
};
|
|
8345
|
-
|
|
8346
|
-
new Assertion(obj, msg,
|
|
8326
|
+
assert2.notOwnProperty = function(obj, prop, msg) {
|
|
8327
|
+
new Assertion(obj, msg, assert2.notOwnProperty, true).to.not.have.own.property(
|
|
8347
8328
|
prop
|
|
8348
8329
|
);
|
|
8349
8330
|
};
|
|
8350
|
-
|
|
8351
|
-
new Assertion(obj, msg,
|
|
8331
|
+
assert2.ownPropertyVal = function(obj, prop, value, msg) {
|
|
8332
|
+
new Assertion(obj, msg, assert2.ownPropertyVal, true).to.have.own.property(
|
|
8352
8333
|
prop,
|
|
8353
8334
|
value
|
|
8354
8335
|
);
|
|
8355
8336
|
};
|
|
8356
|
-
|
|
8337
|
+
assert2.notOwnPropertyVal = function(obj, prop, value, msg) {
|
|
8357
8338
|
new Assertion(
|
|
8358
8339
|
obj,
|
|
8359
8340
|
msg,
|
|
8360
|
-
|
|
8341
|
+
assert2.notOwnPropertyVal,
|
|
8361
8342
|
true
|
|
8362
8343
|
).to.not.have.own.property(prop, value);
|
|
8363
8344
|
};
|
|
8364
|
-
|
|
8345
|
+
assert2.deepOwnPropertyVal = function(obj, prop, value, msg) {
|
|
8365
8346
|
new Assertion(
|
|
8366
8347
|
obj,
|
|
8367
8348
|
msg,
|
|
8368
|
-
|
|
8349
|
+
assert2.deepOwnPropertyVal,
|
|
8369
8350
|
true
|
|
8370
8351
|
).to.have.deep.own.property(prop, value);
|
|
8371
8352
|
};
|
|
8372
|
-
|
|
8353
|
+
assert2.notDeepOwnPropertyVal = function(obj, prop, value, msg) {
|
|
8373
8354
|
new Assertion(
|
|
8374
8355
|
obj,
|
|
8375
8356
|
msg,
|
|
8376
|
-
|
|
8357
|
+
assert2.notDeepOwnPropertyVal,
|
|
8377
8358
|
true
|
|
8378
8359
|
).to.not.have.deep.own.property(prop, value);
|
|
8379
8360
|
};
|
|
8380
|
-
|
|
8381
|
-
new Assertion(obj, msg,
|
|
8361
|
+
assert2.nestedProperty = function(obj, prop, msg) {
|
|
8362
|
+
new Assertion(obj, msg, assert2.nestedProperty, true).to.have.nested.property(
|
|
8382
8363
|
prop
|
|
8383
8364
|
);
|
|
8384
8365
|
};
|
|
8385
|
-
|
|
8366
|
+
assert2.notNestedProperty = function(obj, prop, msg) {
|
|
8386
8367
|
new Assertion(
|
|
8387
8368
|
obj,
|
|
8388
8369
|
msg,
|
|
8389
|
-
|
|
8370
|
+
assert2.notNestedProperty,
|
|
8390
8371
|
true
|
|
8391
8372
|
).to.not.have.nested.property(prop);
|
|
8392
8373
|
};
|
|
8393
|
-
|
|
8374
|
+
assert2.nestedPropertyVal = function(obj, prop, val, msg) {
|
|
8394
8375
|
new Assertion(
|
|
8395
8376
|
obj,
|
|
8396
8377
|
msg,
|
|
8397
|
-
|
|
8378
|
+
assert2.nestedPropertyVal,
|
|
8398
8379
|
true
|
|
8399
8380
|
).to.have.nested.property(prop, val);
|
|
8400
8381
|
};
|
|
8401
|
-
|
|
8382
|
+
assert2.notNestedPropertyVal = function(obj, prop, val, msg) {
|
|
8402
8383
|
new Assertion(
|
|
8403
8384
|
obj,
|
|
8404
8385
|
msg,
|
|
8405
|
-
|
|
8386
|
+
assert2.notNestedPropertyVal,
|
|
8406
8387
|
true
|
|
8407
8388
|
).to.not.have.nested.property(prop, val);
|
|
8408
8389
|
};
|
|
8409
|
-
|
|
8390
|
+
assert2.deepNestedPropertyVal = function(obj, prop, val, msg) {
|
|
8410
8391
|
new Assertion(
|
|
8411
8392
|
obj,
|
|
8412
8393
|
msg,
|
|
8413
|
-
|
|
8394
|
+
assert2.deepNestedPropertyVal,
|
|
8414
8395
|
true
|
|
8415
8396
|
).to.have.deep.nested.property(prop, val);
|
|
8416
8397
|
};
|
|
8417
|
-
|
|
8398
|
+
assert2.notDeepNestedPropertyVal = function(obj, prop, val, msg) {
|
|
8418
8399
|
new Assertion(
|
|
8419
8400
|
obj,
|
|
8420
8401
|
msg,
|
|
8421
|
-
|
|
8402
|
+
assert2.notDeepNestedPropertyVal,
|
|
8422
8403
|
true
|
|
8423
8404
|
).to.not.have.deep.nested.property(prop, val);
|
|
8424
8405
|
};
|
|
8425
|
-
|
|
8426
|
-
new Assertion(exp, msg,
|
|
8406
|
+
assert2.lengthOf = function(exp, len, msg) {
|
|
8407
|
+
new Assertion(exp, msg, assert2.lengthOf, true).to.have.lengthOf(len);
|
|
8427
8408
|
};
|
|
8428
|
-
|
|
8429
|
-
new Assertion(obj, msg,
|
|
8409
|
+
assert2.hasAnyKeys = function(obj, keys2, msg) {
|
|
8410
|
+
new Assertion(obj, msg, assert2.hasAnyKeys, true).to.have.any.keys(keys2);
|
|
8430
8411
|
};
|
|
8431
|
-
|
|
8432
|
-
new Assertion(obj, msg,
|
|
8412
|
+
assert2.hasAllKeys = function(obj, keys2, msg) {
|
|
8413
|
+
new Assertion(obj, msg, assert2.hasAllKeys, true).to.have.all.keys(keys2);
|
|
8433
8414
|
};
|
|
8434
|
-
|
|
8435
|
-
new Assertion(obj, msg,
|
|
8415
|
+
assert2.containsAllKeys = function(obj, keys2, msg) {
|
|
8416
|
+
new Assertion(obj, msg, assert2.containsAllKeys, true).to.contain.all.keys(
|
|
8436
8417
|
keys2
|
|
8437
8418
|
);
|
|
8438
8419
|
};
|
|
8439
|
-
|
|
8440
|
-
new Assertion(obj, msg,
|
|
8420
|
+
assert2.doesNotHaveAnyKeys = function(obj, keys2, msg) {
|
|
8421
|
+
new Assertion(obj, msg, assert2.doesNotHaveAnyKeys, true).to.not.have.any.keys(
|
|
8441
8422
|
keys2
|
|
8442
8423
|
);
|
|
8443
8424
|
};
|
|
8444
|
-
|
|
8445
|
-
new Assertion(obj, msg,
|
|
8425
|
+
assert2.doesNotHaveAllKeys = function(obj, keys2, msg) {
|
|
8426
|
+
new Assertion(obj, msg, assert2.doesNotHaveAllKeys, true).to.not.have.all.keys(
|
|
8446
8427
|
keys2
|
|
8447
8428
|
);
|
|
8448
8429
|
};
|
|
8449
|
-
|
|
8450
|
-
new Assertion(obj, msg,
|
|
8430
|
+
assert2.hasAnyDeepKeys = function(obj, keys2, msg) {
|
|
8431
|
+
new Assertion(obj, msg, assert2.hasAnyDeepKeys, true).to.have.any.deep.keys(
|
|
8451
8432
|
keys2
|
|
8452
8433
|
);
|
|
8453
8434
|
};
|
|
8454
|
-
|
|
8455
|
-
new Assertion(obj, msg,
|
|
8435
|
+
assert2.hasAllDeepKeys = function(obj, keys2, msg) {
|
|
8436
|
+
new Assertion(obj, msg, assert2.hasAllDeepKeys, true).to.have.all.deep.keys(
|
|
8456
8437
|
keys2
|
|
8457
8438
|
);
|
|
8458
8439
|
};
|
|
8459
|
-
|
|
8440
|
+
assert2.containsAllDeepKeys = function(obj, keys2, msg) {
|
|
8460
8441
|
new Assertion(
|
|
8461
8442
|
obj,
|
|
8462
8443
|
msg,
|
|
8463
|
-
|
|
8444
|
+
assert2.containsAllDeepKeys,
|
|
8464
8445
|
true
|
|
8465
8446
|
).to.contain.all.deep.keys(keys2);
|
|
8466
8447
|
};
|
|
8467
|
-
|
|
8448
|
+
assert2.doesNotHaveAnyDeepKeys = function(obj, keys2, msg) {
|
|
8468
8449
|
new Assertion(
|
|
8469
8450
|
obj,
|
|
8470
8451
|
msg,
|
|
8471
|
-
|
|
8452
|
+
assert2.doesNotHaveAnyDeepKeys,
|
|
8472
8453
|
true
|
|
8473
8454
|
).to.not.have.any.deep.keys(keys2);
|
|
8474
8455
|
};
|
|
8475
|
-
|
|
8456
|
+
assert2.doesNotHaveAllDeepKeys = function(obj, keys2, msg) {
|
|
8476
8457
|
new Assertion(
|
|
8477
8458
|
obj,
|
|
8478
8459
|
msg,
|
|
8479
|
-
|
|
8460
|
+
assert2.doesNotHaveAllDeepKeys,
|
|
8480
8461
|
true
|
|
8481
8462
|
).to.not.have.all.deep.keys(keys2);
|
|
8482
8463
|
};
|
|
8483
|
-
|
|
8464
|
+
assert2.throws = function(fn2, errorLike, errMsgMatcher, msg) {
|
|
8484
8465
|
if ("string" === typeof errorLike || errorLike instanceof RegExp) {
|
|
8485
8466
|
errMsgMatcher = errorLike;
|
|
8486
8467
|
errorLike = null;
|
|
8487
8468
|
}
|
|
8488
|
-
|
|
8469
|
+
var assertErr = new Assertion(fn2, msg, assert2.throws, true).to.throw(
|
|
8489
8470
|
errorLike,
|
|
8490
8471
|
errMsgMatcher
|
|
8491
8472
|
);
|
|
8492
8473
|
return flag(assertErr, "object");
|
|
8493
8474
|
};
|
|
8494
|
-
|
|
8475
|
+
assert2.doesNotThrow = function(fn2, errorLike, errMsgMatcher, message) {
|
|
8495
8476
|
if ("string" === typeof errorLike || errorLike instanceof RegExp) {
|
|
8496
8477
|
errMsgMatcher = errorLike;
|
|
8497
8478
|
errorLike = null;
|
|
8498
8479
|
}
|
|
8499
|
-
new Assertion(fn2, message,
|
|
8480
|
+
new Assertion(fn2, message, assert2.doesNotThrow, true).to.not.throw(
|
|
8500
8481
|
errorLike,
|
|
8501
8482
|
errMsgMatcher
|
|
8502
8483
|
);
|
|
8503
8484
|
};
|
|
8504
|
-
|
|
8505
|
-
|
|
8485
|
+
assert2.operator = function(val, operator, val2, msg) {
|
|
8486
|
+
var ok;
|
|
8506
8487
|
switch (operator) {
|
|
8507
8488
|
case "==":
|
|
8508
8489
|
ok = val == val2;
|
|
@@ -8533,315 +8514,315 @@ assert.operator = function(val, operator, val2, msg) {
|
|
|
8533
8514
|
throw new AssertionError(
|
|
8534
8515
|
msg + 'Invalid operator "' + operator + '"',
|
|
8535
8516
|
void 0,
|
|
8536
|
-
|
|
8517
|
+
assert2.operator
|
|
8537
8518
|
);
|
|
8538
8519
|
}
|
|
8539
|
-
|
|
8520
|
+
var test22 = new Assertion(ok, msg, assert2.operator, true);
|
|
8540
8521
|
test22.assert(
|
|
8541
8522
|
true === flag(test22, "object"),
|
|
8542
8523
|
"expected " + inspect22(val) + " to be " + operator + " " + inspect22(val2),
|
|
8543
8524
|
"expected " + inspect22(val) + " to not be " + operator + " " + inspect22(val2)
|
|
8544
8525
|
);
|
|
8545
8526
|
};
|
|
8546
|
-
|
|
8547
|
-
new Assertion(act, msg,
|
|
8527
|
+
assert2.closeTo = function(act, exp, delta, msg) {
|
|
8528
|
+
new Assertion(act, msg, assert2.closeTo, true).to.be.closeTo(exp, delta);
|
|
8548
8529
|
};
|
|
8549
|
-
|
|
8550
|
-
new Assertion(act, msg,
|
|
8530
|
+
assert2.approximately = function(act, exp, delta, msg) {
|
|
8531
|
+
new Assertion(act, msg, assert2.approximately, true).to.be.approximately(
|
|
8551
8532
|
exp,
|
|
8552
8533
|
delta
|
|
8553
8534
|
);
|
|
8554
8535
|
};
|
|
8555
|
-
|
|
8556
|
-
new Assertion(set1, msg,
|
|
8536
|
+
assert2.sameMembers = function(set1, set22, msg) {
|
|
8537
|
+
new Assertion(set1, msg, assert2.sameMembers, true).to.have.same.members(set22);
|
|
8557
8538
|
};
|
|
8558
|
-
|
|
8539
|
+
assert2.notSameMembers = function(set1, set22, msg) {
|
|
8559
8540
|
new Assertion(
|
|
8560
8541
|
set1,
|
|
8561
8542
|
msg,
|
|
8562
|
-
|
|
8543
|
+
assert2.notSameMembers,
|
|
8563
8544
|
true
|
|
8564
8545
|
).to.not.have.same.members(set22);
|
|
8565
8546
|
};
|
|
8566
|
-
|
|
8547
|
+
assert2.sameDeepMembers = function(set1, set22, msg) {
|
|
8567
8548
|
new Assertion(
|
|
8568
8549
|
set1,
|
|
8569
8550
|
msg,
|
|
8570
|
-
|
|
8551
|
+
assert2.sameDeepMembers,
|
|
8571
8552
|
true
|
|
8572
8553
|
).to.have.same.deep.members(set22);
|
|
8573
8554
|
};
|
|
8574
|
-
|
|
8555
|
+
assert2.notSameDeepMembers = function(set1, set22, msg) {
|
|
8575
8556
|
new Assertion(
|
|
8576
8557
|
set1,
|
|
8577
8558
|
msg,
|
|
8578
|
-
|
|
8559
|
+
assert2.notSameDeepMembers,
|
|
8579
8560
|
true
|
|
8580
8561
|
).to.not.have.same.deep.members(set22);
|
|
8581
8562
|
};
|
|
8582
|
-
|
|
8563
|
+
assert2.sameOrderedMembers = function(set1, set22, msg) {
|
|
8583
8564
|
new Assertion(
|
|
8584
8565
|
set1,
|
|
8585
8566
|
msg,
|
|
8586
|
-
|
|
8567
|
+
assert2.sameOrderedMembers,
|
|
8587
8568
|
true
|
|
8588
8569
|
).to.have.same.ordered.members(set22);
|
|
8589
8570
|
};
|
|
8590
|
-
|
|
8571
|
+
assert2.notSameOrderedMembers = function(set1, set22, msg) {
|
|
8591
8572
|
new Assertion(
|
|
8592
8573
|
set1,
|
|
8593
8574
|
msg,
|
|
8594
|
-
|
|
8575
|
+
assert2.notSameOrderedMembers,
|
|
8595
8576
|
true
|
|
8596
8577
|
).to.not.have.same.ordered.members(set22);
|
|
8597
8578
|
};
|
|
8598
|
-
|
|
8579
|
+
assert2.sameDeepOrderedMembers = function(set1, set22, msg) {
|
|
8599
8580
|
new Assertion(
|
|
8600
8581
|
set1,
|
|
8601
8582
|
msg,
|
|
8602
|
-
|
|
8583
|
+
assert2.sameDeepOrderedMembers,
|
|
8603
8584
|
true
|
|
8604
8585
|
).to.have.same.deep.ordered.members(set22);
|
|
8605
8586
|
};
|
|
8606
|
-
|
|
8587
|
+
assert2.notSameDeepOrderedMembers = function(set1, set22, msg) {
|
|
8607
8588
|
new Assertion(
|
|
8608
8589
|
set1,
|
|
8609
8590
|
msg,
|
|
8610
|
-
|
|
8591
|
+
assert2.notSameDeepOrderedMembers,
|
|
8611
8592
|
true
|
|
8612
8593
|
).to.not.have.same.deep.ordered.members(set22);
|
|
8613
8594
|
};
|
|
8614
|
-
|
|
8615
|
-
new Assertion(superset, msg,
|
|
8595
|
+
assert2.includeMembers = function(superset, subset, msg) {
|
|
8596
|
+
new Assertion(superset, msg, assert2.includeMembers, true).to.include.members(
|
|
8616
8597
|
subset
|
|
8617
8598
|
);
|
|
8618
8599
|
};
|
|
8619
|
-
|
|
8600
|
+
assert2.notIncludeMembers = function(superset, subset, msg) {
|
|
8620
8601
|
new Assertion(
|
|
8621
8602
|
superset,
|
|
8622
8603
|
msg,
|
|
8623
|
-
|
|
8604
|
+
assert2.notIncludeMembers,
|
|
8624
8605
|
true
|
|
8625
8606
|
).to.not.include.members(subset);
|
|
8626
8607
|
};
|
|
8627
|
-
|
|
8608
|
+
assert2.includeDeepMembers = function(superset, subset, msg) {
|
|
8628
8609
|
new Assertion(
|
|
8629
8610
|
superset,
|
|
8630
8611
|
msg,
|
|
8631
|
-
|
|
8612
|
+
assert2.includeDeepMembers,
|
|
8632
8613
|
true
|
|
8633
8614
|
).to.include.deep.members(subset);
|
|
8634
8615
|
};
|
|
8635
|
-
|
|
8616
|
+
assert2.notIncludeDeepMembers = function(superset, subset, msg) {
|
|
8636
8617
|
new Assertion(
|
|
8637
8618
|
superset,
|
|
8638
8619
|
msg,
|
|
8639
|
-
|
|
8620
|
+
assert2.notIncludeDeepMembers,
|
|
8640
8621
|
true
|
|
8641
8622
|
).to.not.include.deep.members(subset);
|
|
8642
8623
|
};
|
|
8643
|
-
|
|
8624
|
+
assert2.includeOrderedMembers = function(superset, subset, msg) {
|
|
8644
8625
|
new Assertion(
|
|
8645
8626
|
superset,
|
|
8646
8627
|
msg,
|
|
8647
|
-
|
|
8628
|
+
assert2.includeOrderedMembers,
|
|
8648
8629
|
true
|
|
8649
8630
|
).to.include.ordered.members(subset);
|
|
8650
8631
|
};
|
|
8651
|
-
|
|
8632
|
+
assert2.notIncludeOrderedMembers = function(superset, subset, msg) {
|
|
8652
8633
|
new Assertion(
|
|
8653
8634
|
superset,
|
|
8654
8635
|
msg,
|
|
8655
|
-
|
|
8636
|
+
assert2.notIncludeOrderedMembers,
|
|
8656
8637
|
true
|
|
8657
8638
|
).to.not.include.ordered.members(subset);
|
|
8658
8639
|
};
|
|
8659
|
-
|
|
8640
|
+
assert2.includeDeepOrderedMembers = function(superset, subset, msg) {
|
|
8660
8641
|
new Assertion(
|
|
8661
8642
|
superset,
|
|
8662
8643
|
msg,
|
|
8663
|
-
|
|
8644
|
+
assert2.includeDeepOrderedMembers,
|
|
8664
8645
|
true
|
|
8665
8646
|
).to.include.deep.ordered.members(subset);
|
|
8666
8647
|
};
|
|
8667
|
-
|
|
8648
|
+
assert2.notIncludeDeepOrderedMembers = function(superset, subset, msg) {
|
|
8668
8649
|
new Assertion(
|
|
8669
8650
|
superset,
|
|
8670
8651
|
msg,
|
|
8671
|
-
|
|
8652
|
+
assert2.notIncludeDeepOrderedMembers,
|
|
8672
8653
|
true
|
|
8673
8654
|
).to.not.include.deep.ordered.members(subset);
|
|
8674
8655
|
};
|
|
8675
|
-
|
|
8676
|
-
new Assertion(inList, msg,
|
|
8656
|
+
assert2.oneOf = function(inList, list, msg) {
|
|
8657
|
+
new Assertion(inList, msg, assert2.oneOf, true).to.be.oneOf(list);
|
|
8677
8658
|
};
|
|
8678
|
-
|
|
8659
|
+
assert2.isIterable = function(obj, msg) {
|
|
8679
8660
|
if (obj == void 0 || !obj[Symbol.iterator]) {
|
|
8680
8661
|
msg = msg ? `${msg} expected ${inspect22(obj)} to be an iterable` : `expected ${inspect22(obj)} to be an iterable`;
|
|
8681
|
-
throw new AssertionError(msg, void 0,
|
|
8662
|
+
throw new AssertionError(msg, void 0, assert2.isIterable);
|
|
8682
8663
|
}
|
|
8683
8664
|
};
|
|
8684
|
-
|
|
8665
|
+
assert2.changes = function(fn2, obj, prop, msg) {
|
|
8685
8666
|
if (arguments.length === 3 && typeof obj === "function") {
|
|
8686
8667
|
msg = prop;
|
|
8687
8668
|
prop = null;
|
|
8688
8669
|
}
|
|
8689
|
-
new Assertion(fn2, msg,
|
|
8670
|
+
new Assertion(fn2, msg, assert2.changes, true).to.change(obj, prop);
|
|
8690
8671
|
};
|
|
8691
|
-
|
|
8672
|
+
assert2.changesBy = function(fn2, obj, prop, delta, msg) {
|
|
8692
8673
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
8693
|
-
|
|
8674
|
+
var tmpMsg = delta;
|
|
8694
8675
|
delta = prop;
|
|
8695
8676
|
msg = tmpMsg;
|
|
8696
8677
|
} else if (arguments.length === 3) {
|
|
8697
8678
|
delta = prop;
|
|
8698
8679
|
prop = null;
|
|
8699
8680
|
}
|
|
8700
|
-
new Assertion(fn2, msg,
|
|
8681
|
+
new Assertion(fn2, msg, assert2.changesBy, true).to.change(obj, prop).by(delta);
|
|
8701
8682
|
};
|
|
8702
|
-
|
|
8683
|
+
assert2.doesNotChange = function(fn2, obj, prop, msg) {
|
|
8703
8684
|
if (arguments.length === 3 && typeof obj === "function") {
|
|
8704
8685
|
msg = prop;
|
|
8705
8686
|
prop = null;
|
|
8706
8687
|
}
|
|
8707
|
-
return new Assertion(fn2, msg,
|
|
8688
|
+
return new Assertion(fn2, msg, assert2.doesNotChange, true).to.not.change(
|
|
8708
8689
|
obj,
|
|
8709
8690
|
prop
|
|
8710
8691
|
);
|
|
8711
8692
|
};
|
|
8712
|
-
|
|
8693
|
+
assert2.changesButNotBy = function(fn2, obj, prop, delta, msg) {
|
|
8713
8694
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
8714
|
-
|
|
8695
|
+
var tmpMsg = delta;
|
|
8715
8696
|
delta = prop;
|
|
8716
8697
|
msg = tmpMsg;
|
|
8717
8698
|
} else if (arguments.length === 3) {
|
|
8718
8699
|
delta = prop;
|
|
8719
8700
|
prop = null;
|
|
8720
8701
|
}
|
|
8721
|
-
new Assertion(fn2, msg,
|
|
8702
|
+
new Assertion(fn2, msg, assert2.changesButNotBy, true).to.change(obj, prop).but.not.by(delta);
|
|
8722
8703
|
};
|
|
8723
|
-
|
|
8704
|
+
assert2.increases = function(fn2, obj, prop, msg) {
|
|
8724
8705
|
if (arguments.length === 3 && typeof obj === "function") {
|
|
8725
8706
|
msg = prop;
|
|
8726
8707
|
prop = null;
|
|
8727
8708
|
}
|
|
8728
|
-
return new Assertion(fn2, msg,
|
|
8709
|
+
return new Assertion(fn2, msg, assert2.increases, true).to.increase(obj, prop);
|
|
8729
8710
|
};
|
|
8730
|
-
|
|
8711
|
+
assert2.increasesBy = function(fn2, obj, prop, delta, msg) {
|
|
8731
8712
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
8732
|
-
|
|
8713
|
+
var tmpMsg = delta;
|
|
8733
8714
|
delta = prop;
|
|
8734
8715
|
msg = tmpMsg;
|
|
8735
8716
|
} else if (arguments.length === 3) {
|
|
8736
8717
|
delta = prop;
|
|
8737
8718
|
prop = null;
|
|
8738
8719
|
}
|
|
8739
|
-
new Assertion(fn2, msg,
|
|
8720
|
+
new Assertion(fn2, msg, assert2.increasesBy, true).to.increase(obj, prop).by(delta);
|
|
8740
8721
|
};
|
|
8741
|
-
|
|
8722
|
+
assert2.doesNotIncrease = function(fn2, obj, prop, msg) {
|
|
8742
8723
|
if (arguments.length === 3 && typeof obj === "function") {
|
|
8743
8724
|
msg = prop;
|
|
8744
8725
|
prop = null;
|
|
8745
8726
|
}
|
|
8746
|
-
return new Assertion(fn2, msg,
|
|
8727
|
+
return new Assertion(fn2, msg, assert2.doesNotIncrease, true).to.not.increase(
|
|
8747
8728
|
obj,
|
|
8748
8729
|
prop
|
|
8749
8730
|
);
|
|
8750
8731
|
};
|
|
8751
|
-
|
|
8732
|
+
assert2.increasesButNotBy = function(fn2, obj, prop, delta, msg) {
|
|
8752
8733
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
8753
|
-
|
|
8734
|
+
var tmpMsg = delta;
|
|
8754
8735
|
delta = prop;
|
|
8755
8736
|
msg = tmpMsg;
|
|
8756
8737
|
} else if (arguments.length === 3) {
|
|
8757
8738
|
delta = prop;
|
|
8758
8739
|
prop = null;
|
|
8759
8740
|
}
|
|
8760
|
-
new Assertion(fn2, msg,
|
|
8741
|
+
new Assertion(fn2, msg, assert2.increasesButNotBy, true).to.increase(obj, prop).but.not.by(delta);
|
|
8761
8742
|
};
|
|
8762
|
-
|
|
8743
|
+
assert2.decreases = function(fn2, obj, prop, msg) {
|
|
8763
8744
|
if (arguments.length === 3 && typeof obj === "function") {
|
|
8764
8745
|
msg = prop;
|
|
8765
8746
|
prop = null;
|
|
8766
8747
|
}
|
|
8767
|
-
return new Assertion(fn2, msg,
|
|
8748
|
+
return new Assertion(fn2, msg, assert2.decreases, true).to.decrease(obj, prop);
|
|
8768
8749
|
};
|
|
8769
|
-
|
|
8750
|
+
assert2.decreasesBy = function(fn2, obj, prop, delta, msg) {
|
|
8770
8751
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
8771
|
-
|
|
8752
|
+
var tmpMsg = delta;
|
|
8772
8753
|
delta = prop;
|
|
8773
8754
|
msg = tmpMsg;
|
|
8774
8755
|
} else if (arguments.length === 3) {
|
|
8775
8756
|
delta = prop;
|
|
8776
8757
|
prop = null;
|
|
8777
8758
|
}
|
|
8778
|
-
new Assertion(fn2, msg,
|
|
8759
|
+
new Assertion(fn2, msg, assert2.decreasesBy, true).to.decrease(obj, prop).by(delta);
|
|
8779
8760
|
};
|
|
8780
|
-
|
|
8761
|
+
assert2.doesNotDecrease = function(fn2, obj, prop, msg) {
|
|
8781
8762
|
if (arguments.length === 3 && typeof obj === "function") {
|
|
8782
8763
|
msg = prop;
|
|
8783
8764
|
prop = null;
|
|
8784
8765
|
}
|
|
8785
|
-
return new Assertion(fn2, msg,
|
|
8766
|
+
return new Assertion(fn2, msg, assert2.doesNotDecrease, true).to.not.decrease(
|
|
8786
8767
|
obj,
|
|
8787
8768
|
prop
|
|
8788
8769
|
);
|
|
8789
8770
|
};
|
|
8790
|
-
|
|
8771
|
+
assert2.doesNotDecreaseBy = function(fn2, obj, prop, delta, msg) {
|
|
8791
8772
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
8792
|
-
|
|
8773
|
+
var tmpMsg = delta;
|
|
8793
8774
|
delta = prop;
|
|
8794
8775
|
msg = tmpMsg;
|
|
8795
8776
|
} else if (arguments.length === 3) {
|
|
8796
8777
|
delta = prop;
|
|
8797
8778
|
prop = null;
|
|
8798
8779
|
}
|
|
8799
|
-
return new Assertion(fn2, msg,
|
|
8780
|
+
return new Assertion(fn2, msg, assert2.doesNotDecreaseBy, true).to.not.decrease(obj, prop).by(delta);
|
|
8800
8781
|
};
|
|
8801
|
-
|
|
8782
|
+
assert2.decreasesButNotBy = function(fn2, obj, prop, delta, msg) {
|
|
8802
8783
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
8803
|
-
|
|
8784
|
+
var tmpMsg = delta;
|
|
8804
8785
|
delta = prop;
|
|
8805
8786
|
msg = tmpMsg;
|
|
8806
8787
|
} else if (arguments.length === 3) {
|
|
8807
8788
|
delta = prop;
|
|
8808
8789
|
prop = null;
|
|
8809
8790
|
}
|
|
8810
|
-
new Assertion(fn2, msg,
|
|
8791
|
+
new Assertion(fn2, msg, assert2.decreasesButNotBy, true).to.decrease(obj, prop).but.not.by(delta);
|
|
8811
8792
|
};
|
|
8812
|
-
|
|
8793
|
+
assert2.ifError = function(val) {
|
|
8813
8794
|
if (val) {
|
|
8814
8795
|
throw val;
|
|
8815
8796
|
}
|
|
8816
8797
|
};
|
|
8817
|
-
|
|
8818
|
-
new Assertion(obj, msg,
|
|
8798
|
+
assert2.isExtensible = function(obj, msg) {
|
|
8799
|
+
new Assertion(obj, msg, assert2.isExtensible, true).to.be.extensible;
|
|
8819
8800
|
};
|
|
8820
|
-
|
|
8821
|
-
new Assertion(obj, msg,
|
|
8801
|
+
assert2.isNotExtensible = function(obj, msg) {
|
|
8802
|
+
new Assertion(obj, msg, assert2.isNotExtensible, true).to.not.be.extensible;
|
|
8822
8803
|
};
|
|
8823
|
-
|
|
8824
|
-
new Assertion(obj, msg,
|
|
8804
|
+
assert2.isSealed = function(obj, msg) {
|
|
8805
|
+
new Assertion(obj, msg, assert2.isSealed, true).to.be.sealed;
|
|
8825
8806
|
};
|
|
8826
|
-
|
|
8827
|
-
new Assertion(obj, msg,
|
|
8807
|
+
assert2.isNotSealed = function(obj, msg) {
|
|
8808
|
+
new Assertion(obj, msg, assert2.isNotSealed, true).to.not.be.sealed;
|
|
8828
8809
|
};
|
|
8829
|
-
|
|
8830
|
-
new Assertion(obj, msg,
|
|
8810
|
+
assert2.isFrozen = function(obj, msg) {
|
|
8811
|
+
new Assertion(obj, msg, assert2.isFrozen, true).to.be.frozen;
|
|
8831
8812
|
};
|
|
8832
|
-
|
|
8833
|
-
new Assertion(obj, msg,
|
|
8813
|
+
assert2.isNotFrozen = function(obj, msg) {
|
|
8814
|
+
new Assertion(obj, msg, assert2.isNotFrozen, true).to.not.be.frozen;
|
|
8834
8815
|
};
|
|
8835
|
-
|
|
8836
|
-
new Assertion(val, msg,
|
|
8816
|
+
assert2.isEmpty = function(val, msg) {
|
|
8817
|
+
new Assertion(val, msg, assert2.isEmpty, true).to.be.empty;
|
|
8837
8818
|
};
|
|
8838
|
-
|
|
8839
|
-
new Assertion(val, msg,
|
|
8819
|
+
assert2.isNotEmpty = function(val, msg) {
|
|
8820
|
+
new Assertion(val, msg, assert2.isNotEmpty, true).to.not.be.empty;
|
|
8840
8821
|
};
|
|
8841
|
-
|
|
8822
|
+
assert2.containsSubset = function(val, exp, msg) {
|
|
8842
8823
|
new Assertion(val, msg).to.containSubset(exp);
|
|
8843
8824
|
};
|
|
8844
|
-
|
|
8825
|
+
assert2.doesNotContainSubset = function(val, exp, msg) {
|
|
8845
8826
|
new Assertion(val, msg).to.not.containSubset(exp);
|
|
8846
8827
|
};
|
|
8847
8828
|
var aliases = [
|
|
@@ -8862,7 +8843,7 @@ var aliases = [
|
|
|
8862
8843
|
["containsSubset", "containSubset"]
|
|
8863
8844
|
];
|
|
8864
8845
|
for (const [name, as] of aliases) {
|
|
8865
|
-
|
|
8846
|
+
assert2[as] = assert2[name];
|
|
8866
8847
|
}
|
|
8867
8848
|
var used = [];
|
|
8868
8849
|
function use(fn2) {
|
|
@@ -8872,7 +8853,7 @@ function use(fn2) {
|
|
|
8872
8853
|
util: utils_exports,
|
|
8873
8854
|
config,
|
|
8874
8855
|
expect,
|
|
8875
|
-
assert,
|
|
8856
|
+
assert: assert2,
|
|
8876
8857
|
Assertion,
|
|
8877
8858
|
...should_exports
|
|
8878
8859
|
};
|
|
@@ -9018,70 +8999,70 @@ function addCustomEqualityTesters(newTesters) {
|
|
|
9018
8999
|
function getCustomEqualityTesters() {
|
|
9019
9000
|
return globalThis[JEST_MATCHERS_OBJECT].customEqualityTesters;
|
|
9020
9001
|
}
|
|
9021
|
-
function equals(a3,
|
|
9002
|
+
function equals(a3, b, customTesters, strictCheck) {
|
|
9022
9003
|
customTesters = customTesters || [];
|
|
9023
|
-
return eq(a3,
|
|
9004
|
+
return eq(a3, b, [], [], customTesters, strictCheck ? hasKey : hasDefinedKey);
|
|
9024
9005
|
}
|
|
9025
9006
|
function isAsymmetric(obj) {
|
|
9026
9007
|
return !!obj && typeof obj === "object" && "asymmetricMatch" in obj && isA("Function", obj.asymmetricMatch);
|
|
9027
9008
|
}
|
|
9028
|
-
function asymmetricMatch(a3,
|
|
9009
|
+
function asymmetricMatch(a3, b) {
|
|
9029
9010
|
const asymmetricA = isAsymmetric(a3);
|
|
9030
|
-
const asymmetricB = isAsymmetric(
|
|
9011
|
+
const asymmetricB = isAsymmetric(b);
|
|
9031
9012
|
if (asymmetricA && asymmetricB) {
|
|
9032
9013
|
return void 0;
|
|
9033
9014
|
}
|
|
9034
9015
|
if (asymmetricA) {
|
|
9035
|
-
return a3.asymmetricMatch(
|
|
9016
|
+
return a3.asymmetricMatch(b);
|
|
9036
9017
|
}
|
|
9037
9018
|
if (asymmetricB) {
|
|
9038
|
-
return
|
|
9019
|
+
return b.asymmetricMatch(a3);
|
|
9039
9020
|
}
|
|
9040
9021
|
}
|
|
9041
|
-
function eq(a3,
|
|
9022
|
+
function eq(a3, b, aStack, bStack, customTesters, hasKey2) {
|
|
9042
9023
|
let result = true;
|
|
9043
|
-
const asymmetricResult = asymmetricMatch(a3,
|
|
9024
|
+
const asymmetricResult = asymmetricMatch(a3, b);
|
|
9044
9025
|
if (asymmetricResult !== void 0) {
|
|
9045
9026
|
return asymmetricResult;
|
|
9046
9027
|
}
|
|
9047
9028
|
const testerContext = { equals };
|
|
9048
9029
|
for (let i = 0; i < customTesters.length; i++) {
|
|
9049
|
-
const customTesterResult = customTesters[i].call(testerContext, a3,
|
|
9030
|
+
const customTesterResult = customTesters[i].call(testerContext, a3, b, customTesters);
|
|
9050
9031
|
if (customTesterResult !== void 0) {
|
|
9051
9032
|
return customTesterResult;
|
|
9052
9033
|
}
|
|
9053
9034
|
}
|
|
9054
|
-
if (typeof URL === "function" && a3 instanceof URL &&
|
|
9055
|
-
return a3.href ===
|
|
9035
|
+
if (typeof URL === "function" && a3 instanceof URL && b instanceof URL) {
|
|
9036
|
+
return a3.href === b.href;
|
|
9056
9037
|
}
|
|
9057
|
-
if (Object.is(a3,
|
|
9038
|
+
if (Object.is(a3, b)) {
|
|
9058
9039
|
return true;
|
|
9059
9040
|
}
|
|
9060
|
-
if (a3 === null ||
|
|
9061
|
-
return a3 ===
|
|
9041
|
+
if (a3 === null || b === null) {
|
|
9042
|
+
return a3 === b;
|
|
9062
9043
|
}
|
|
9063
9044
|
const className = Object.prototype.toString.call(a3);
|
|
9064
|
-
if (className !== Object.prototype.toString.call(
|
|
9045
|
+
if (className !== Object.prototype.toString.call(b)) {
|
|
9065
9046
|
return false;
|
|
9066
9047
|
}
|
|
9067
9048
|
switch (className) {
|
|
9068
9049
|
case "[object Boolean]":
|
|
9069
9050
|
case "[object String]":
|
|
9070
9051
|
case "[object Number]":
|
|
9071
|
-
if (typeof a3 !== typeof
|
|
9052
|
+
if (typeof a3 !== typeof b) {
|
|
9072
9053
|
return false;
|
|
9073
|
-
} else if (typeof a3 !== "object" && typeof
|
|
9074
|
-
return Object.is(a3,
|
|
9054
|
+
} else if (typeof a3 !== "object" && typeof b !== "object") {
|
|
9055
|
+
return Object.is(a3, b);
|
|
9075
9056
|
} else {
|
|
9076
|
-
return Object.is(a3.valueOf(),
|
|
9057
|
+
return Object.is(a3.valueOf(), b.valueOf());
|
|
9077
9058
|
}
|
|
9078
9059
|
case "[object Date]": {
|
|
9079
9060
|
const numA = +a3;
|
|
9080
|
-
const numB = +
|
|
9061
|
+
const numB = +b;
|
|
9081
9062
|
return numA === numB || Number.isNaN(numA) && Number.isNaN(numB);
|
|
9082
9063
|
}
|
|
9083
9064
|
case "[object RegExp]":
|
|
9084
|
-
return a3.source ===
|
|
9065
|
+
return a3.source === b.source && a3.flags === b.flags;
|
|
9085
9066
|
case "[object Temporal.Instant]":
|
|
9086
9067
|
case "[object Temporal.ZonedDateTime]":
|
|
9087
9068
|
case "[object Temporal.PlainDateTime]":
|
|
@@ -9089,32 +9070,32 @@ function eq(a3, b2, aStack, bStack, customTesters, hasKey2) {
|
|
|
9089
9070
|
case "[object Temporal.PlainTime]":
|
|
9090
9071
|
case "[object Temporal.PlainYearMonth]":
|
|
9091
9072
|
case "[object Temporal.PlainMonthDay]":
|
|
9092
|
-
return a3.equals(
|
|
9073
|
+
return a3.equals(b);
|
|
9093
9074
|
case "[object Temporal.Duration]":
|
|
9094
|
-
return a3.toString() ===
|
|
9075
|
+
return a3.toString() === b.toString();
|
|
9095
9076
|
}
|
|
9096
|
-
if (typeof a3 !== "object" || typeof
|
|
9077
|
+
if (typeof a3 !== "object" || typeof b !== "object") {
|
|
9097
9078
|
return false;
|
|
9098
9079
|
}
|
|
9099
|
-
if (isDomNode(a3) && isDomNode(
|
|
9100
|
-
return a3.isEqualNode(
|
|
9080
|
+
if (isDomNode(a3) && isDomNode(b)) {
|
|
9081
|
+
return a3.isEqualNode(b);
|
|
9101
9082
|
}
|
|
9102
9083
|
let length = aStack.length;
|
|
9103
9084
|
while (length--) {
|
|
9104
9085
|
if (aStack[length] === a3) {
|
|
9105
|
-
return bStack[length] ===
|
|
9106
|
-
} else if (bStack[length] ===
|
|
9086
|
+
return bStack[length] === b;
|
|
9087
|
+
} else if (bStack[length] === b) {
|
|
9107
9088
|
return false;
|
|
9108
9089
|
}
|
|
9109
9090
|
}
|
|
9110
9091
|
aStack.push(a3);
|
|
9111
|
-
bStack.push(
|
|
9112
|
-
if (className === "[object Array]" && a3.length !==
|
|
9092
|
+
bStack.push(b);
|
|
9093
|
+
if (className === "[object Array]" && a3.length !== b.length) {
|
|
9113
9094
|
return false;
|
|
9114
9095
|
}
|
|
9115
|
-
if (a3 instanceof Error &&
|
|
9096
|
+
if (a3 instanceof Error && b instanceof Error) {
|
|
9116
9097
|
try {
|
|
9117
|
-
return isErrorEqual(a3,
|
|
9098
|
+
return isErrorEqual(a3, b, aStack, bStack, customTesters, hasKey2);
|
|
9118
9099
|
} finally {
|
|
9119
9100
|
aStack.pop();
|
|
9120
9101
|
bStack.pop();
|
|
@@ -9123,12 +9104,12 @@ function eq(a3, b2, aStack, bStack, customTesters, hasKey2) {
|
|
|
9123
9104
|
const aKeys = keys(a3, hasKey2);
|
|
9124
9105
|
let key;
|
|
9125
9106
|
let size = aKeys.length;
|
|
9126
|
-
if (keys(
|
|
9107
|
+
if (keys(b, hasKey2).length !== size) {
|
|
9127
9108
|
return false;
|
|
9128
9109
|
}
|
|
9129
9110
|
while (size--) {
|
|
9130
9111
|
key = aKeys[size];
|
|
9131
|
-
result = hasKey2(
|
|
9112
|
+
result = hasKey2(b, key) && eq(a3[key], b[key], aStack, bStack, customTesters, hasKey2);
|
|
9132
9113
|
if (!result) {
|
|
9133
9114
|
return false;
|
|
9134
9115
|
}
|
|
@@ -9137,15 +9118,15 @@ function eq(a3, b2, aStack, bStack, customTesters, hasKey2) {
|
|
|
9137
9118
|
bStack.pop();
|
|
9138
9119
|
return result;
|
|
9139
9120
|
}
|
|
9140
|
-
function isErrorEqual(a3,
|
|
9141
|
-
let result = Object.getPrototypeOf(a3) === Object.getPrototypeOf(
|
|
9142
|
-
if (typeof
|
|
9143
|
-
result && (result = eq(a3.cause,
|
|
9121
|
+
function isErrorEqual(a3, b, aStack, bStack, customTesters, hasKey2) {
|
|
9122
|
+
let result = Object.getPrototypeOf(a3) === Object.getPrototypeOf(b) && a3.name === b.name && a3.message === b.message;
|
|
9123
|
+
if (typeof b.cause !== "undefined") {
|
|
9124
|
+
result && (result = eq(a3.cause, b.cause, aStack, bStack, customTesters, hasKey2));
|
|
9144
9125
|
}
|
|
9145
|
-
if (a3 instanceof AggregateError &&
|
|
9146
|
-
result && (result = eq(a3.errors,
|
|
9126
|
+
if (a3 instanceof AggregateError && b instanceof AggregateError) {
|
|
9127
|
+
result && (result = eq(a3.errors, b.errors, aStack, bStack, customTesters, hasKey2));
|
|
9147
9128
|
}
|
|
9148
|
-
result && (result = eq({ ...a3 }, { ...
|
|
9129
|
+
result && (result = eq({ ...a3 }, { ...b }, aStack, bStack, customTesters, hasKey2));
|
|
9149
9130
|
return result;
|
|
9150
9131
|
}
|
|
9151
9132
|
function keys(obj, hasKey2) {
|
|
@@ -9199,34 +9180,34 @@ var IteratorSymbol = Symbol.iterator;
|
|
|
9199
9180
|
function hasIterator(object2) {
|
|
9200
9181
|
return !!(object2 != null && object2[IteratorSymbol]);
|
|
9201
9182
|
}
|
|
9202
|
-
function iterableEquality(a3,
|
|
9203
|
-
if (typeof a3 !== "object" || typeof
|
|
9183
|
+
function iterableEquality(a3, b, customTesters = [], aStack = [], bStack = []) {
|
|
9184
|
+
if (typeof a3 !== "object" || typeof b !== "object" || Array.isArray(a3) || Array.isArray(b) || !hasIterator(a3) || !hasIterator(b)) {
|
|
9204
9185
|
return void 0;
|
|
9205
9186
|
}
|
|
9206
|
-
if (a3.constructor !==
|
|
9187
|
+
if (a3.constructor !== b.constructor) {
|
|
9207
9188
|
return false;
|
|
9208
9189
|
}
|
|
9209
9190
|
let length = aStack.length;
|
|
9210
9191
|
while (length--) {
|
|
9211
9192
|
if (aStack[length] === a3) {
|
|
9212
|
-
return bStack[length] ===
|
|
9193
|
+
return bStack[length] === b;
|
|
9213
9194
|
}
|
|
9214
9195
|
}
|
|
9215
9196
|
aStack.push(a3);
|
|
9216
|
-
bStack.push(
|
|
9197
|
+
bStack.push(b);
|
|
9217
9198
|
const filteredCustomTesters = [...customTesters.filter((t) => t !== iterableEquality), iterableEqualityWithStack];
|
|
9218
|
-
function iterableEqualityWithStack(a4,
|
|
9219
|
-
return iterableEquality(a4,
|
|
9199
|
+
function iterableEqualityWithStack(a4, b2) {
|
|
9200
|
+
return iterableEquality(a4, b2, [...customTesters], [...aStack], [...bStack]);
|
|
9220
9201
|
}
|
|
9221
9202
|
if (a3.size !== void 0) {
|
|
9222
|
-
if (a3.size !==
|
|
9203
|
+
if (a3.size !== b.size) {
|
|
9223
9204
|
return false;
|
|
9224
9205
|
} else if (isA("Set", a3) || isImmutableUnorderedSet(a3)) {
|
|
9225
9206
|
let allFound = true;
|
|
9226
9207
|
for (const aValue of a3) {
|
|
9227
|
-
if (!
|
|
9208
|
+
if (!b.has(aValue)) {
|
|
9228
9209
|
let has = false;
|
|
9229
|
-
for (const bValue of
|
|
9210
|
+
for (const bValue of b) {
|
|
9230
9211
|
const isEqual = equals(aValue, bValue, filteredCustomTesters);
|
|
9231
9212
|
if (isEqual === true) {
|
|
9232
9213
|
has = true;
|
|
@@ -9244,9 +9225,9 @@ function iterableEquality(a3, b2, customTesters = [], aStack = [], bStack = [])
|
|
|
9244
9225
|
} else if (isA("Map", a3) || isImmutableUnorderedKeyed(a3)) {
|
|
9245
9226
|
let allFound = true;
|
|
9246
9227
|
for (const aEntry of a3) {
|
|
9247
|
-
if (!
|
|
9228
|
+
if (!b.has(aEntry[0]) || !equals(aEntry[1], b.get(aEntry[0]), filteredCustomTesters)) {
|
|
9248
9229
|
let has = false;
|
|
9249
|
-
for (const bEntry of
|
|
9230
|
+
for (const bEntry of b) {
|
|
9250
9231
|
const matchedKey = equals(aEntry[0], bEntry[0], filteredCustomTesters);
|
|
9251
9232
|
let matchedValue = false;
|
|
9252
9233
|
if (matchedKey === true) {
|
|
@@ -9267,7 +9248,7 @@ function iterableEquality(a3, b2, customTesters = [], aStack = [], bStack = [])
|
|
|
9267
9248
|
return allFound;
|
|
9268
9249
|
}
|
|
9269
9250
|
}
|
|
9270
|
-
const bIterator =
|
|
9251
|
+
const bIterator = b[IteratorSymbol]();
|
|
9271
9252
|
for (const aValue of a3) {
|
|
9272
9253
|
const nextB = bIterator.next();
|
|
9273
9254
|
if (nextB.done || !equals(aValue, nextB.value, filteredCustomTesters)) {
|
|
@@ -9279,7 +9260,7 @@ function iterableEquality(a3, b2, customTesters = [], aStack = [], bStack = [])
|
|
|
9279
9260
|
}
|
|
9280
9261
|
if (!isImmutableList(a3) && !isImmutableOrderedKeyed(a3) && !isImmutableOrderedSet(a3) && !isImmutableRecord(a3)) {
|
|
9281
9262
|
const aEntries = Object.entries(a3);
|
|
9282
|
-
const bEntries = Object.entries(
|
|
9263
|
+
const bEntries = Object.entries(b);
|
|
9283
9264
|
if (!equals(aEntries, bEntries, filteredCustomTesters)) {
|
|
9284
9265
|
return false;
|
|
9285
9266
|
}
|
|
@@ -9318,22 +9299,22 @@ function subsetEquality(object2, subset, customTesters = []) {
|
|
|
9318
9299
|
};
|
|
9319
9300
|
return subsetEqualityWithContext()(object2, subset);
|
|
9320
9301
|
}
|
|
9321
|
-
function typeEquality(a3,
|
|
9322
|
-
if (a3 == null ||
|
|
9302
|
+
function typeEquality(a3, b) {
|
|
9303
|
+
if (a3 == null || b == null || a3.constructor === b.constructor) {
|
|
9323
9304
|
return void 0;
|
|
9324
9305
|
}
|
|
9325
9306
|
return false;
|
|
9326
9307
|
}
|
|
9327
|
-
function arrayBufferEquality(a3,
|
|
9308
|
+
function arrayBufferEquality(a3, b) {
|
|
9328
9309
|
let dataViewA = a3;
|
|
9329
|
-
let dataViewB =
|
|
9330
|
-
if (!(a3 instanceof DataView &&
|
|
9331
|
-
if (!(a3 instanceof ArrayBuffer) || !(
|
|
9310
|
+
let dataViewB = b;
|
|
9311
|
+
if (!(a3 instanceof DataView && b instanceof DataView)) {
|
|
9312
|
+
if (!(a3 instanceof ArrayBuffer) || !(b instanceof ArrayBuffer)) {
|
|
9332
9313
|
return void 0;
|
|
9333
9314
|
}
|
|
9334
9315
|
try {
|
|
9335
9316
|
dataViewA = new DataView(a3);
|
|
9336
|
-
dataViewB = new DataView(
|
|
9317
|
+
dataViewB = new DataView(b);
|
|
9337
9318
|
} catch {
|
|
9338
9319
|
return void 0;
|
|
9339
9320
|
}
|
|
@@ -9348,14 +9329,14 @@ function arrayBufferEquality(a3, b2) {
|
|
|
9348
9329
|
}
|
|
9349
9330
|
return true;
|
|
9350
9331
|
}
|
|
9351
|
-
function sparseArrayEquality(a3,
|
|
9352
|
-
if (!Array.isArray(a3) || !Array.isArray(
|
|
9332
|
+
function sparseArrayEquality(a3, b, customTesters = []) {
|
|
9333
|
+
if (!Array.isArray(a3) || !Array.isArray(b)) {
|
|
9353
9334
|
return void 0;
|
|
9354
9335
|
}
|
|
9355
9336
|
const aKeys = Object.keys(a3);
|
|
9356
|
-
const bKeys = Object.keys(
|
|
9337
|
+
const bKeys = Object.keys(b);
|
|
9357
9338
|
const filteredCustomTesters = customTesters.filter((t) => t !== sparseArrayEquality);
|
|
9358
|
-
return equals(a3,
|
|
9339
|
+
return equals(a3, b, filteredCustomTesters, true) && equals(aKeys, bKeys);
|
|
9359
9340
|
}
|
|
9360
9341
|
function generateToBeMessage(deepEqualityName, expected = "#{this}", actual = "#{exp}") {
|
|
9361
9342
|
const toBeMessage = `expected ${expected} to be ${actual} // Object.is equality`;
|
|
@@ -10047,7 +10028,7 @@ var JestChaiExpect = (chai2, utils) => {
|
|
|
10047
10028
|
return this.assert(pass, `expected #{this} to be close to #{exp}, received difference is ${receivedDiff}, but expected ${expectedDiff}`, `expected #{this} to not be close to #{exp}, received difference is ${receivedDiff}, but expected ${expectedDiff}`, received, expected, false);
|
|
10048
10029
|
});
|
|
10049
10030
|
function assertIsMock(assertion) {
|
|
10050
|
-
if (!
|
|
10031
|
+
if (!isMockFunction2(assertion._obj)) {
|
|
10051
10032
|
throw new TypeError(`${utils.inspect(assertion._obj)} is not a spy or a call to a spy!`);
|
|
10052
10033
|
}
|
|
10053
10034
|
}
|
|
@@ -10087,8 +10068,8 @@ var JestChaiExpect = (chai2, utils) => {
|
|
|
10087
10068
|
throw new AssertionError2(msg);
|
|
10088
10069
|
}
|
|
10089
10070
|
});
|
|
10090
|
-
function equalsArgumentArray(a3,
|
|
10091
|
-
return a3.length ===
|
|
10071
|
+
function equalsArgumentArray(a3, b) {
|
|
10072
|
+
return a3.length === b.length && a3.every((aItem, i) => equals(aItem, b[i], [...customTesters, iterableEquality]));
|
|
10092
10073
|
}
|
|
10093
10074
|
def(["toHaveBeenCalledWith", "toBeCalledWith"], function(...args) {
|
|
10094
10075
|
const spy = getSpy(this);
|
|
@@ -10149,14 +10130,14 @@ var JestChaiExpect = (chai2, utils) => {
|
|
|
10149
10130
|
}
|
|
10150
10131
|
def(["toHaveBeenCalledBefore"], function(resultSpy, failIfNoFirstInvocation = true) {
|
|
10151
10132
|
const expectSpy = getSpy(this);
|
|
10152
|
-
if (!
|
|
10133
|
+
if (!isMockFunction2(resultSpy)) {
|
|
10153
10134
|
throw new TypeError(`${utils.inspect(resultSpy)} is not a spy or a call to a spy`);
|
|
10154
10135
|
}
|
|
10155
10136
|
this.assert(isSpyCalledBeforeAnotherSpy(expectSpy, resultSpy, failIfNoFirstInvocation), `expected "${expectSpy.getMockName()}" to have been called before "${resultSpy.getMockName()}"`, `expected "${expectSpy.getMockName()}" to not have been called before "${resultSpy.getMockName()}"`, resultSpy, expectSpy);
|
|
10156
10137
|
});
|
|
10157
10138
|
def(["toHaveBeenCalledAfter"], function(resultSpy, failIfNoFirstInvocation = true) {
|
|
10158
10139
|
const expectSpy = getSpy(this);
|
|
10159
|
-
if (!
|
|
10140
|
+
if (!isMockFunction2(resultSpy)) {
|
|
10160
10141
|
throw new TypeError(`${utils.inspect(resultSpy)} is not a spy or a call to a spy`);
|
|
10161
10142
|
}
|
|
10162
10143
|
this.assert(isSpyCalledBeforeAnotherSpy(resultSpy, expectSpy, failIfNoFirstInvocation), `expected "${expectSpy.getMockName()}" to have been called after "${resultSpy.getMockName()}"`, `expected "${expectSpy.getMockName()}" to not have been called after "${resultSpy.getMockName()}"`, resultSpy, expectSpy);
|
|
@@ -10390,15 +10371,15 @@ var JestChaiExpect = (chai2, utils) => {
|
|
|
10390
10371
|
});
|
|
10391
10372
|
};
|
|
10392
10373
|
function ordinalOf(i) {
|
|
10393
|
-
const
|
|
10394
|
-
const
|
|
10395
|
-
if (
|
|
10374
|
+
const j = i % 10;
|
|
10375
|
+
const k = i % 100;
|
|
10376
|
+
if (j === 1 && k !== 11) {
|
|
10396
10377
|
return `${i}st`;
|
|
10397
10378
|
}
|
|
10398
|
-
if (
|
|
10379
|
+
if (j === 2 && k !== 12) {
|
|
10399
10380
|
return `${i}nd`;
|
|
10400
10381
|
}
|
|
10401
|
-
if (
|
|
10382
|
+
if (j === 3 && k !== 13) {
|
|
10402
10383
|
return `${i}rd`;
|
|
10403
10384
|
}
|
|
10404
10385
|
return `${i}th`;
|
|
@@ -10766,70 +10747,81 @@ function parseSingleV8Stack(raw) {
|
|
|
10766
10747
|
};
|
|
10767
10748
|
}
|
|
10768
10749
|
|
|
10769
|
-
// ../../node_modules/.pnpm/strip-literal@3.
|
|
10750
|
+
// ../../node_modules/.pnpm/strip-literal@3.0.0/node_modules/strip-literal/dist/index.mjs
|
|
10770
10751
|
var import_js_tokens = __toESM(require_js_tokens(), 1);
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
return token.value;
|
|
10752
|
+
function stripLiteralJsTokens(code, options) {
|
|
10753
|
+
const FILL = " ";
|
|
10754
|
+
const FILL_COMMENT = " ";
|
|
10755
|
+
let result = "";
|
|
10756
|
+
const tokens = [];
|
|
10757
|
+
for (const token of (0, import_js_tokens.default)(code, { jsx: false })) {
|
|
10758
|
+
tokens.push(token);
|
|
10759
|
+
if (token.type === "SingleLineComment") {
|
|
10760
|
+
result += FILL_COMMENT.repeat(token.value.length);
|
|
10761
|
+
continue;
|
|
10782
10762
|
}
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10763
|
+
if (token.type === "MultiLineComment") {
|
|
10764
|
+
result += token.value.replace(/[^\n]/g, FILL_COMMENT);
|
|
10765
|
+
continue;
|
|
10786
10766
|
}
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10767
|
+
if (token.type === "StringLiteral") {
|
|
10768
|
+
if (!token.closed) {
|
|
10769
|
+
result += token.value;
|
|
10770
|
+
continue;
|
|
10771
|
+
}
|
|
10772
|
+
const body = token.value.slice(1, -1);
|
|
10773
|
+
{
|
|
10774
|
+
result += token.value[0] + FILL.repeat(body.length) + token.value[token.value.length - 1];
|
|
10775
|
+
continue;
|
|
10776
|
+
}
|
|
10792
10777
|
}
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10778
|
+
if (token.type === "NoSubstitutionTemplate") {
|
|
10779
|
+
const body = token.value.slice(1, -1);
|
|
10780
|
+
{
|
|
10781
|
+
result += `\`${body.replace(/[^\n]/g, FILL)}\``;
|
|
10782
|
+
continue;
|
|
10783
|
+
}
|
|
10798
10784
|
}
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10785
|
+
if (token.type === "RegularExpressionLiteral") {
|
|
10786
|
+
const body = token.value;
|
|
10787
|
+
{
|
|
10788
|
+
result += body.replace(/\/(.*)\/(\w?)$/g, (_, $1, $2) => `/${FILL.repeat($1.length)}/${$2}`);
|
|
10789
|
+
continue;
|
|
10790
|
+
}
|
|
10804
10791
|
}
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10792
|
+
if (token.type === "TemplateHead") {
|
|
10793
|
+
const body = token.value.slice(1, -2);
|
|
10794
|
+
{
|
|
10795
|
+
result += `\`${body.replace(/[^\n]/g, FILL)}\${`;
|
|
10796
|
+
continue;
|
|
10797
|
+
}
|
|
10810
10798
|
}
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
|
|
10799
|
+
if (token.type === "TemplateTail") {
|
|
10800
|
+
const body = token.value.slice(0, -2);
|
|
10801
|
+
{
|
|
10802
|
+
result += `}${body.replace(/[^\n]/g, FILL)}\``;
|
|
10803
|
+
continue;
|
|
10804
|
+
}
|
|
10805
|
+
}
|
|
10806
|
+
if (token.type === "TemplateMiddle") {
|
|
10807
|
+
const body = token.value.slice(1, -2);
|
|
10808
|
+
{
|
|
10809
|
+
result += `}${body.replace(/[^\n]/g, FILL)}\${`;
|
|
10810
|
+
continue;
|
|
10811
|
+
}
|
|
10816
10812
|
}
|
|
10813
|
+
result += token.value;
|
|
10817
10814
|
}
|
|
10818
|
-
return token.value;
|
|
10819
|
-
}
|
|
10820
|
-
function optionsWithDefaults(options) {
|
|
10821
10815
|
return {
|
|
10822
|
-
|
|
10823
|
-
|
|
10816
|
+
result,
|
|
10817
|
+
tokens
|
|
10824
10818
|
};
|
|
10825
10819
|
}
|
|
10826
10820
|
function stripLiteral(code, options) {
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
}
|
|
10832
|
-
return result;
|
|
10821
|
+
return stripLiteralDetailed(code).result;
|
|
10822
|
+
}
|
|
10823
|
+
function stripLiteralDetailed(code, options) {
|
|
10824
|
+
return stripLiteralJsTokens(code);
|
|
10833
10825
|
}
|
|
10834
10826
|
|
|
10835
10827
|
// ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
@@ -11255,7 +11247,7 @@ var it = test3;
|
|
|
11255
11247
|
var runner;
|
|
11256
11248
|
var defaultSuite;
|
|
11257
11249
|
var currentTestFilepath;
|
|
11258
|
-
function
|
|
11250
|
+
function assert3(condition, message) {
|
|
11259
11251
|
if (!condition) {
|
|
11260
11252
|
throw new Error(`Vitest failed to find ${message}. This is a bug in Vitest. Please, open an issue with reproduction.`);
|
|
11261
11253
|
}
|
|
@@ -11264,12 +11256,12 @@ function getTestFilepath() {
|
|
|
11264
11256
|
return currentTestFilepath;
|
|
11265
11257
|
}
|
|
11266
11258
|
function getRunner() {
|
|
11267
|
-
|
|
11259
|
+
assert3(runner, "the runner");
|
|
11268
11260
|
return runner;
|
|
11269
11261
|
}
|
|
11270
11262
|
function getCurrentSuite() {
|
|
11271
11263
|
const currentSuite = collectorContext.currentSuite || defaultSuite;
|
|
11272
|
-
|
|
11264
|
+
assert3(currentSuite, "the current suite");
|
|
11273
11265
|
return currentSuite;
|
|
11274
11266
|
}
|
|
11275
11267
|
function createSuiteHooks() {
|
|
@@ -11657,8 +11649,8 @@ function formatTemplateString(cases, args) {
|
|
|
11657
11649
|
const res = [];
|
|
11658
11650
|
for (let i = 0; i < Math.floor(args.length / header.length); i++) {
|
|
11659
11651
|
const oneCase = {};
|
|
11660
|
-
for (let
|
|
11661
|
-
oneCase[header[
|
|
11652
|
+
for (let j = 0; j < header.length; j++) {
|
|
11653
|
+
oneCase[header[j]] = args[i * header.length + j];
|
|
11662
11654
|
}
|
|
11663
11655
|
res.push(oneCase);
|
|
11664
11656
|
}
|
|
@@ -11911,25 +11903,25 @@ function encodeUint8Array(bytes) {
|
|
|
11911
11903
|
for (let i = 0; i < len; i += 3) {
|
|
11912
11904
|
if (len === i + 1) {
|
|
11913
11905
|
const a3 = (bytes[i] & 252) >> 2;
|
|
11914
|
-
const
|
|
11906
|
+
const b = (bytes[i] & 3) << 4;
|
|
11915
11907
|
base64 += table[a3];
|
|
11916
|
-
base64 += table[
|
|
11908
|
+
base64 += table[b];
|
|
11917
11909
|
base64 += "==";
|
|
11918
11910
|
} else if (len === i + 2) {
|
|
11919
11911
|
const a3 = (bytes[i] & 252) >> 2;
|
|
11920
|
-
const
|
|
11912
|
+
const b = (bytes[i] & 3) << 4 | (bytes[i + 1] & 240) >> 4;
|
|
11921
11913
|
const c = (bytes[i + 1] & 15) << 2;
|
|
11922
11914
|
base64 += table[a3];
|
|
11923
|
-
base64 += table[
|
|
11915
|
+
base64 += table[b];
|
|
11924
11916
|
base64 += table[c];
|
|
11925
11917
|
base64 += "=";
|
|
11926
11918
|
} else {
|
|
11927
11919
|
const a3 = (bytes[i] & 252) >> 2;
|
|
11928
|
-
const
|
|
11920
|
+
const b = (bytes[i] & 3) << 4 | (bytes[i + 1] & 240) >> 4;
|
|
11929
11921
|
const c = (bytes[i + 1] & 15) << 2 | (bytes[i + 2] & 192) >> 6;
|
|
11930
11922
|
const d = bytes[i + 2] & 63;
|
|
11931
11923
|
base64 += table[a3];
|
|
11932
|
-
base64 += table[
|
|
11924
|
+
base64 += table[b];
|
|
11933
11925
|
base64 += table[c];
|
|
11934
11926
|
base64 += table[d];
|
|
11935
11927
|
}
|
|
@@ -11994,7 +11986,7 @@ function createTestHook(name, handler) {
|
|
|
11994
11986
|
};
|
|
11995
11987
|
}
|
|
11996
11988
|
|
|
11997
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.
|
|
11989
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.14_@vitest+ui@3.2.4_jiti@2.6.0_jsdom_cd26cd65b25b201827057a23fd622128/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js
|
|
11998
11990
|
var NAME_WORKER_STATE = "__vitest_worker__";
|
|
11999
11991
|
function getWorkerState() {
|
|
12000
11992
|
const workerState = globalThis[NAME_WORKER_STATE];
|
|
@@ -12042,10 +12034,10 @@ async function waitForImportsToResolve() {
|
|
|
12042
12034
|
await waitForImportsToResolve();
|
|
12043
12035
|
}
|
|
12044
12036
|
|
|
12045
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.
|
|
12037
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.14_@vitest+ui@3.2.4_jiti@2.6.0_jsdom_cd26cd65b25b201827057a23fd622128/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js
|
|
12046
12038
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
12047
|
-
function getDefaultExportFromCjs3(
|
|
12048
|
-
return
|
|
12039
|
+
function getDefaultExportFromCjs3(x) {
|
|
12040
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
12049
12041
|
}
|
|
12050
12042
|
|
|
12051
12043
|
// ../../node_modules/.pnpm/@vitest+snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js
|
|
@@ -12144,8 +12136,8 @@ function decode(mappings) {
|
|
|
12144
12136
|
function sort(line) {
|
|
12145
12137
|
line.sort(sortComparator$1);
|
|
12146
12138
|
}
|
|
12147
|
-
function sortComparator$1(a3,
|
|
12148
|
-
return a3[0] -
|
|
12139
|
+
function sortComparator$1(a3, b) {
|
|
12140
|
+
return a3[0] - b[0];
|
|
12149
12141
|
}
|
|
12150
12142
|
var schemeRegex = /^[\w+.-]+:\/\//;
|
|
12151
12143
|
var urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
|
|
@@ -12359,8 +12351,8 @@ function nextUnsortedSegmentLine(mappings, start) {
|
|
|
12359
12351
|
return mappings.length;
|
|
12360
12352
|
}
|
|
12361
12353
|
function isSorted(line) {
|
|
12362
|
-
for (let
|
|
12363
|
-
if (line[
|
|
12354
|
+
for (let j = 1; j < line.length; j++) {
|
|
12355
|
+
if (line[j][COLUMN] < line[j - 1][COLUMN]) {
|
|
12364
12356
|
return false;
|
|
12365
12357
|
}
|
|
12366
12358
|
}
|
|
@@ -12371,8 +12363,8 @@ function sortSegments(line, owned) {
|
|
|
12371
12363
|
line = line.slice();
|
|
12372
12364
|
return line.sort(sortComparator);
|
|
12373
12365
|
}
|
|
12374
|
-
function sortComparator(a3,
|
|
12375
|
-
return a3[COLUMN] -
|
|
12366
|
+
function sortComparator(a3, b) {
|
|
12367
|
+
return a3[COLUMN] - b[COLUMN];
|
|
12376
12368
|
}
|
|
12377
12369
|
var found = false;
|
|
12378
12370
|
function binarySearch(haystack, needle, low, high) {
|
|
@@ -12505,8 +12497,8 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
|
12505
12497
|
return -1;
|
|
12506
12498
|
return index2;
|
|
12507
12499
|
}
|
|
12508
|
-
function notNullish2(
|
|
12509
|
-
return
|
|
12500
|
+
function notNullish2(v) {
|
|
12501
|
+
return v != null;
|
|
12510
12502
|
}
|
|
12511
12503
|
function isPrimitive3(value) {
|
|
12512
12504
|
return value === null || typeof value !== "function" && typeof value !== "object";
|
|
@@ -12721,7 +12713,7 @@ function parseErrorStacktrace(e, options = {}) {
|
|
|
12721
12713
|
}
|
|
12722
12714
|
}
|
|
12723
12715
|
if (options.frameFilter) {
|
|
12724
|
-
stackFrames = stackFrames.filter((
|
|
12716
|
+
stackFrames = stackFrames.filter((f3) => options.frameFilter(e, f3) !== false);
|
|
12725
12717
|
}
|
|
12726
12718
|
e.stacks = stackFrames;
|
|
12727
12719
|
return stackFrames;
|
|
@@ -12731,8 +12723,8 @@ try {
|
|
|
12731
12723
|
if (Array.isArray(getPromiseDetails(Promise.resolve()))) ;
|
|
12732
12724
|
} catch (notNode) {
|
|
12733
12725
|
}
|
|
12734
|
-
function getDefaultExportFromCjs4(
|
|
12735
|
-
return
|
|
12726
|
+
function getDefaultExportFromCjs4(x) {
|
|
12727
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
12736
12728
|
}
|
|
12737
12729
|
var reservedWords2 = {
|
|
12738
12730
|
keyword: [
|
|
@@ -12786,7 +12778,7 @@ var reservedWords2 = {
|
|
|
12786
12778
|
};
|
|
12787
12779
|
new Set(reservedWords2.keyword);
|
|
12788
12780
|
new Set(reservedWords2.strict);
|
|
12789
|
-
var
|
|
12781
|
+
var f2 = {
|
|
12790
12782
|
reset: [0, 0],
|
|
12791
12783
|
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
12792
12784
|
dim: [2, 22, "\x1B[22m\x1B[2m"],
|
|
@@ -12829,7 +12821,7 @@ var f3 = {
|
|
|
12829
12821
|
bgCyanBright: [106, 49],
|
|
12830
12822
|
bgWhiteBright: [107, 49]
|
|
12831
12823
|
};
|
|
12832
|
-
var
|
|
12824
|
+
var h2 = Object.entries(f2);
|
|
12833
12825
|
function a2(n) {
|
|
12834
12826
|
return String(n);
|
|
12835
12827
|
}
|
|
@@ -12841,27 +12833,27 @@ function C2(n = false) {
|
|
|
12841
12833
|
}
|
|
12842
12834
|
function p2(n = false) {
|
|
12843
12835
|
let e = C2(n), i = (r2, t, c, o) => {
|
|
12844
|
-
let
|
|
12836
|
+
let l = "", s2 = 0;
|
|
12845
12837
|
do
|
|
12846
|
-
|
|
12838
|
+
l += r2.substring(s2, o) + c, s2 = o + t.length, o = r2.indexOf(t, s2);
|
|
12847
12839
|
while (~o);
|
|
12848
|
-
return
|
|
12840
|
+
return l + r2.substring(s2);
|
|
12849
12841
|
}, g = (r2, t, c = r2) => {
|
|
12850
|
-
let o = (
|
|
12851
|
-
let s2 = String(
|
|
12852
|
-
return ~
|
|
12842
|
+
let o = (l) => {
|
|
12843
|
+
let s2 = String(l), b = s2.indexOf(t, r2.length);
|
|
12844
|
+
return ~b ? r2 + i(s2, t, c, b) + t : r2 + s2 + t;
|
|
12853
12845
|
};
|
|
12854
12846
|
return o.open = r2, o.close = t, o;
|
|
12855
|
-
},
|
|
12847
|
+
}, u2 = {
|
|
12856
12848
|
isColorSupported: e
|
|
12857
12849
|
}, d = (r2) => `\x1B[${r2}m`;
|
|
12858
|
-
for (let [r2, t] of
|
|
12859
|
-
|
|
12850
|
+
for (let [r2, t] of h2)
|
|
12851
|
+
u2[r2] = e ? g(
|
|
12860
12852
|
d(t[0]),
|
|
12861
12853
|
d(t[1]),
|
|
12862
12854
|
t[2]
|
|
12863
12855
|
) : a2;
|
|
12864
|
-
return
|
|
12856
|
+
return u2;
|
|
12865
12857
|
}
|
|
12866
12858
|
p2();
|
|
12867
12859
|
var lineSplitRE = /\r?\n/;
|
|
@@ -12895,7 +12887,7 @@ function offsetToLineNumber(source, offset) {
|
|
|
12895
12887
|
return line + 1;
|
|
12896
12888
|
}
|
|
12897
12889
|
async function saveInlineSnapshots(environment, snapshots) {
|
|
12898
|
-
const MagicString = (await import('./magic-string.es-
|
|
12890
|
+
const MagicString = (await import('./magic-string.es-WQRLTQPQ.js')).default;
|
|
12899
12891
|
const files = new Set(snapshots.map((i) => i.file));
|
|
12900
12892
|
await Promise.all(Array.from(files).map(async (file) => {
|
|
12901
12893
|
const snaps = snapshots.filter((i) => i.file === file);
|
|
@@ -13046,7 +13038,7 @@ var hasRequiredNaturalCompare;
|
|
|
13046
13038
|
function requireNaturalCompare() {
|
|
13047
13039
|
if (hasRequiredNaturalCompare) return naturalCompare$1.exports;
|
|
13048
13040
|
hasRequiredNaturalCompare = 1;
|
|
13049
|
-
var naturalCompare2 = function(a3,
|
|
13041
|
+
var naturalCompare2 = function(a3, b) {
|
|
13050
13042
|
var i, codeA, codeB = 1, posA = 0, posB = 0, alphabet = String.alphabet;
|
|
13051
13043
|
function getCode(str, pos, code) {
|
|
13052
13044
|
if (code) {
|
|
@@ -13056,12 +13048,12 @@ function requireNaturalCompare() {
|
|
|
13056
13048
|
code = alphabet && alphabet.indexOf(str.charAt(pos));
|
|
13057
13049
|
return code > -1 ? code + 76 : (code = str.charCodeAt(pos) || 0, code < 45 || code > 127) ? code : code < 46 ? 65 : code < 48 ? code - 1 : code < 58 ? code + 18 : code < 65 ? code - 11 : code < 91 ? code + 11 : code < 97 ? code - 37 : code < 123 ? code + 5 : code - 63;
|
|
13058
13050
|
}
|
|
13059
|
-
if ((a3 += "") != (
|
|
13051
|
+
if ((a3 += "") != (b += "")) for (; codeB; ) {
|
|
13060
13052
|
codeA = getCode(a3, posA++);
|
|
13061
|
-
codeB = getCode(
|
|
13053
|
+
codeB = getCode(b, posB++);
|
|
13062
13054
|
if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
|
|
13063
13055
|
codeA = getCode(a3, posA, posA);
|
|
13064
|
-
codeB = getCode(
|
|
13056
|
+
codeB = getCode(b, posB, posA = i);
|
|
13065
13057
|
posB = i;
|
|
13066
13058
|
}
|
|
13067
13059
|
if (codeA != codeB) return codeA < codeB ? -1 : 1;
|
|
@@ -13252,14 +13244,14 @@ var CounterMap = class extends DefaultMap {
|
|
|
13252
13244
|
return this._total;
|
|
13253
13245
|
}
|
|
13254
13246
|
let total = 0;
|
|
13255
|
-
for (const
|
|
13256
|
-
total +=
|
|
13247
|
+
for (const x of this.values()) {
|
|
13248
|
+
total += x;
|
|
13257
13249
|
}
|
|
13258
13250
|
return total;
|
|
13259
13251
|
}
|
|
13260
13252
|
};
|
|
13261
|
-
function isSameStackPosition(
|
|
13262
|
-
return
|
|
13253
|
+
function isSameStackPosition(x, y) {
|
|
13254
|
+
return x.file === y.file && x.column === y.column && x.line === y.line;
|
|
13263
13255
|
}
|
|
13264
13256
|
var SnapshotState = class _SnapshotState {
|
|
13265
13257
|
_counters = new CounterMap();
|
|
@@ -13672,11 +13664,11 @@ var SnapshotClient = class {
|
|
|
13672
13664
|
}
|
|
13673
13665
|
};
|
|
13674
13666
|
|
|
13675
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.
|
|
13667
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.14_@vitest+ui@3.2.4_jiti@2.6.0_jsdom_cd26cd65b25b201827057a23fd622128/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js
|
|
13676
13668
|
var RealDate = Date;
|
|
13677
13669
|
var now2 = null;
|
|
13678
13670
|
var MockDate = class _MockDate extends RealDate {
|
|
13679
|
-
constructor(
|
|
13671
|
+
constructor(y, m2, d, h3, M, s2, ms) {
|
|
13680
13672
|
super();
|
|
13681
13673
|
let date;
|
|
13682
13674
|
switch (arguments.length) {
|
|
@@ -13685,15 +13677,15 @@ var MockDate = class _MockDate extends RealDate {
|
|
|
13685
13677
|
else date = new RealDate();
|
|
13686
13678
|
break;
|
|
13687
13679
|
case 1:
|
|
13688
|
-
date = new RealDate(
|
|
13680
|
+
date = new RealDate(y);
|
|
13689
13681
|
break;
|
|
13690
13682
|
default:
|
|
13691
13683
|
d = typeof d === "undefined" ? 1 : d;
|
|
13692
|
-
|
|
13693
|
-
|
|
13684
|
+
h3 = h3 || 0;
|
|
13685
|
+
M = M || 0;
|
|
13694
13686
|
s2 = s2 || 0;
|
|
13695
13687
|
ms = ms || 0;
|
|
13696
|
-
date = new RealDate(
|
|
13688
|
+
date = new RealDate(y, m2, d, h3, M, s2, ms);
|
|
13697
13689
|
break;
|
|
13698
13690
|
}
|
|
13699
13691
|
Object.setPrototypeOf(date, _MockDate.prototype);
|
|
@@ -13720,7 +13712,7 @@ function resetDate() {
|
|
|
13720
13712
|
globalThis.Date = RealDate;
|
|
13721
13713
|
}
|
|
13722
13714
|
|
|
13723
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.
|
|
13715
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.14_@vitest+ui@3.2.4_jiti@2.6.0_jsdom_cd26cd65b25b201827057a23fd622128/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js
|
|
13724
13716
|
var unsupported = [
|
|
13725
13717
|
"matchSnapshot",
|
|
13726
13718
|
"toMatchSnapshot",
|
|
@@ -14091,11 +14083,11 @@ function createExpect(test5) {
|
|
|
14091
14083
|
const expect2 = (value, message) => {
|
|
14092
14084
|
const { assertionCalls } = getState(expect2);
|
|
14093
14085
|
setState({ assertionCalls: assertionCalls + 1 }, expect2);
|
|
14094
|
-
const
|
|
14086
|
+
const assert4 = expect(value, message);
|
|
14095
14087
|
const _test2 = test5 || getCurrentTest();
|
|
14096
14088
|
if (_test2)
|
|
14097
|
-
return
|
|
14098
|
-
else return
|
|
14089
|
+
return assert4.withTest(_test2);
|
|
14090
|
+
else return assert4;
|
|
14099
14091
|
};
|
|
14100
14092
|
Object.assign(expect2, expect);
|
|
14101
14093
|
Object.assign(expect2, globalThis[ASYMMETRIC_MATCHERS_OBJECT]);
|
|
@@ -14122,7 +14114,7 @@ function createExpect(test5) {
|
|
|
14122
14114
|
};
|
|
14123
14115
|
expect2.poll = createExpectPoll(expect2);
|
|
14124
14116
|
expect2.unreachable = (message) => {
|
|
14125
|
-
|
|
14117
|
+
assert2.fail(`expected${message ? ` "${message}" ` : " "}not to be reached`);
|
|
14126
14118
|
};
|
|
14127
14119
|
function assertions(expected) {
|
|
14128
14120
|
const errorGen = () => new Error(`expected number of assertions to be ${expected}, but got ${expect2.getState().assertionCalls}`);
|
|
@@ -14241,10 +14233,10 @@ function requireCalledInOrder() {
|
|
|
14241
14233
|
}
|
|
14242
14234
|
return callMap[spy.id] < spy.callCount;
|
|
14243
14235
|
}
|
|
14244
|
-
function checkAdjacentCalls(callMap, spy, index2,
|
|
14236
|
+
function checkAdjacentCalls(callMap, spy, index2, spies2) {
|
|
14245
14237
|
var calledBeforeNext = true;
|
|
14246
|
-
if (index2 !==
|
|
14247
|
-
calledBeforeNext = spy.calledBefore(
|
|
14238
|
+
if (index2 !== spies2.length - 1) {
|
|
14239
|
+
calledBeforeNext = spy.calledBefore(spies2[index2 + 1]);
|
|
14248
14240
|
}
|
|
14249
14241
|
if (hasCallsLeft(callMap, spy) && calledBeforeNext) {
|
|
14250
14242
|
callMap[spy.id] += 1;
|
|
@@ -14252,9 +14244,9 @@ function requireCalledInOrder() {
|
|
|
14252
14244
|
}
|
|
14253
14245
|
return false;
|
|
14254
14246
|
}
|
|
14255
|
-
function calledInOrder(
|
|
14247
|
+
function calledInOrder(spies2) {
|
|
14256
14248
|
var callMap = {};
|
|
14257
|
-
var _spies = arguments.length > 1 ? arguments :
|
|
14249
|
+
var _spies = arguments.length > 1 ? arguments : spies2;
|
|
14258
14250
|
return every2(_spies, checkAdjacentCalls.bind(null, callMap));
|
|
14259
14251
|
}
|
|
14260
14252
|
calledInOrder_1 = calledInOrder;
|
|
@@ -14351,15 +14343,15 @@ function requireOrderByFirstCall() {
|
|
|
14351
14343
|
hasRequiredOrderByFirstCall = 1;
|
|
14352
14344
|
var sort2 = requireArray().sort;
|
|
14353
14345
|
var slice = requireArray().slice;
|
|
14354
|
-
function comparator(a3,
|
|
14346
|
+
function comparator(a3, b) {
|
|
14355
14347
|
var aCall = a3.getCall(0);
|
|
14356
|
-
var bCall =
|
|
14348
|
+
var bCall = b.getCall(0);
|
|
14357
14349
|
var aId = aCall && aCall.callId || -1;
|
|
14358
14350
|
var bId = bCall && bCall.callId || -1;
|
|
14359
14351
|
return aId < bId ? -1 : 1;
|
|
14360
14352
|
}
|
|
14361
|
-
function orderByFirstCall(
|
|
14362
|
-
return sort2(slice(
|
|
14353
|
+
function orderByFirstCall(spies2) {
|
|
14354
|
+
return sort2(slice(spies2), comparator);
|
|
14363
14355
|
}
|
|
14364
14356
|
orderByFirstCall_1 = orderByFirstCall;
|
|
14365
14357
|
return orderByFirstCall_1;
|
|
@@ -14686,11 +14678,11 @@ function requireFakeTimersSrc() {
|
|
|
14686
14678
|
return 0;
|
|
14687
14679
|
}
|
|
14688
14680
|
const strings = str.split(":");
|
|
14689
|
-
const
|
|
14690
|
-
let i =
|
|
14681
|
+
const l = strings.length;
|
|
14682
|
+
let i = l;
|
|
14691
14683
|
let ms = 0;
|
|
14692
14684
|
let parsed;
|
|
14693
|
-
if (
|
|
14685
|
+
if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) {
|
|
14694
14686
|
throw new Error(
|
|
14695
14687
|
"tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits"
|
|
14696
14688
|
);
|
|
@@ -14700,7 +14692,7 @@ function requireFakeTimersSrc() {
|
|
|
14700
14692
|
if (parsed >= 60) {
|
|
14701
14693
|
throw new Error(`Invalid time ${str}`);
|
|
14702
14694
|
}
|
|
14703
|
-
ms += parsed * Math.pow(60,
|
|
14695
|
+
ms += parsed * Math.pow(60, l - i - 1);
|
|
14704
14696
|
}
|
|
14705
14697
|
return ms * 1e3;
|
|
14706
14698
|
}
|
|
@@ -14939,29 +14931,29 @@ ${job.error.stack.split("\n").slice(matchedLineIndex + 1).join("\n")}`;
|
|
|
14939
14931
|
}
|
|
14940
14932
|
return timer.id;
|
|
14941
14933
|
}
|
|
14942
|
-
function compareTimers(a3,
|
|
14943
|
-
if (a3.callAt <
|
|
14934
|
+
function compareTimers(a3, b) {
|
|
14935
|
+
if (a3.callAt < b.callAt) {
|
|
14944
14936
|
return -1;
|
|
14945
14937
|
}
|
|
14946
|
-
if (a3.callAt >
|
|
14938
|
+
if (a3.callAt > b.callAt) {
|
|
14947
14939
|
return 1;
|
|
14948
14940
|
}
|
|
14949
|
-
if (a3.immediate && !
|
|
14941
|
+
if (a3.immediate && !b.immediate) {
|
|
14950
14942
|
return -1;
|
|
14951
14943
|
}
|
|
14952
|
-
if (!a3.immediate &&
|
|
14944
|
+
if (!a3.immediate && b.immediate) {
|
|
14953
14945
|
return 1;
|
|
14954
14946
|
}
|
|
14955
|
-
if (a3.createdAt <
|
|
14947
|
+
if (a3.createdAt < b.createdAt) {
|
|
14956
14948
|
return -1;
|
|
14957
14949
|
}
|
|
14958
|
-
if (a3.createdAt >
|
|
14950
|
+
if (a3.createdAt > b.createdAt) {
|
|
14959
14951
|
return 1;
|
|
14960
14952
|
}
|
|
14961
|
-
if (a3.id <
|
|
14953
|
+
if (a3.id < b.id) {
|
|
14962
14954
|
return -1;
|
|
14963
14955
|
}
|
|
14964
|
-
if (a3.id >
|
|
14956
|
+
if (a3.id > b.id) {
|
|
14965
14957
|
return 1;
|
|
14966
14958
|
}
|
|
14967
14959
|
}
|
|
@@ -15072,10 +15064,10 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`
|
|
|
15072
15064
|
}
|
|
15073
15065
|
}
|
|
15074
15066
|
function uninstall(clock, config2) {
|
|
15075
|
-
let method, i,
|
|
15067
|
+
let method, i, l;
|
|
15076
15068
|
const installedHrTime = "_hrtime";
|
|
15077
15069
|
const installedNextTick = "_nextTick";
|
|
15078
|
-
for (i = 0,
|
|
15070
|
+
for (i = 0, l = clock.methods.length; i < l; i++) {
|
|
15079
15071
|
method = clock.methods[i];
|
|
15080
15072
|
if (method === "hrtime" && _global.process) {
|
|
15081
15073
|
_global.process.hrtime = clock[installedHrTime];
|
|
@@ -15106,14 +15098,14 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`
|
|
|
15106
15098
|
}
|
|
15107
15099
|
}
|
|
15108
15100
|
if (clock.timersModuleMethods !== void 0) {
|
|
15109
|
-
for (let
|
|
15110
|
-
const entry = clock.timersModuleMethods[
|
|
15101
|
+
for (let j = 0; j < clock.timersModuleMethods.length; j++) {
|
|
15102
|
+
const entry = clock.timersModuleMethods[j];
|
|
15111
15103
|
timersModule[entry.methodName] = entry.original;
|
|
15112
15104
|
}
|
|
15113
15105
|
}
|
|
15114
15106
|
if (clock.timersPromisesModuleMethods !== void 0) {
|
|
15115
|
-
for (let
|
|
15116
|
-
const entry = clock.timersPromisesModuleMethods[
|
|
15107
|
+
for (let j = 0; j < clock.timersPromisesModuleMethods.length; j++) {
|
|
15108
|
+
const entry = clock.timersPromisesModuleMethods[j];
|
|
15117
15109
|
timersPromisesModule[entry.methodName] = entry.original;
|
|
15118
15110
|
}
|
|
15119
15111
|
}
|
|
@@ -15618,7 +15610,7 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`
|
|
|
15618
15610
|
});
|
|
15619
15611
|
};
|
|
15620
15612
|
}
|
|
15621
|
-
clock.reset = function
|
|
15613
|
+
clock.reset = function reset2() {
|
|
15622
15614
|
nanos = 0;
|
|
15623
15615
|
clock.timers = {};
|
|
15624
15616
|
clock.jobs = [];
|
|
@@ -15689,7 +15681,7 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`
|
|
|
15689
15681
|
`non-existent timers and/or objects cannot be faked: '${timer}'`
|
|
15690
15682
|
);
|
|
15691
15683
|
}
|
|
15692
|
-
let i,
|
|
15684
|
+
let i, l;
|
|
15693
15685
|
const clock = createClock(config2.now, config2.loopLimit);
|
|
15694
15686
|
clock.shouldClearNativeTimers = config2.shouldClearNativeTimers;
|
|
15695
15687
|
clock.uninstall = function() {
|
|
@@ -15740,7 +15732,7 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`
|
|
|
15740
15732
|
if (_global === globalObject && timersPromisesModule) {
|
|
15741
15733
|
clock.timersPromisesModuleMethods = [];
|
|
15742
15734
|
}
|
|
15743
|
-
for (i = 0,
|
|
15735
|
+
for (i = 0, l = clock.methods.length; i < l; i++) {
|
|
15744
15736
|
const nameOfMethodToReplace = clock.methods[i];
|
|
15745
15737
|
if (!isPresent[nameOfMethodToReplace]) {
|
|
15746
15738
|
handleMissingTimer(nameOfMethodToReplace);
|
|
@@ -16325,7 +16317,7 @@ function createVitest() {
|
|
|
16325
16317
|
return item;
|
|
16326
16318
|
},
|
|
16327
16319
|
isMockFunction(fn2) {
|
|
16328
|
-
return
|
|
16320
|
+
return isMockFunction2(fn2);
|
|
16329
16321
|
},
|
|
16330
16322
|
clearAllMocks() {
|
|
16331
16323
|
[...mocks].reverse().forEach((spy) => spy.mockClear());
|
|
@@ -16406,7 +16398,7 @@ function getImporter(name) {
|
|
|
16406
16398
|
return stack?.file || "";
|
|
16407
16399
|
}
|
|
16408
16400
|
|
|
16409
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.
|
|
16401
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.14_@vitest+ui@3.2.4_jiti@2.6.0_jsdom_cd26cd65b25b201827057a23fd622128/node_modules/vitest/dist/chunks/benchmark.CYdenmiT.js
|
|
16410
16402
|
var benchFns = /* @__PURE__ */ new WeakMap();
|
|
16411
16403
|
var benchOptsMap = /* @__PURE__ */ new WeakMap();
|
|
16412
16404
|
var bench = createBenchmark(function(name, fn2 = noop, options = {}) {
|
|
@@ -16432,12 +16424,12 @@ function formatName2(name) {
|
|
|
16432
16424
|
return typeof name === "string" ? name : typeof name === "function" ? name.name || "<anonymous>" : String(name);
|
|
16433
16425
|
}
|
|
16434
16426
|
|
|
16435
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.
|
|
16427
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.14_@vitest+ui@3.2.4_jiti@2.6.0_jsdom_cd26cd65b25b201827057a23fd622128/node_modules/vitest/dist/chunks/index.CdQS2e2Q.js
|
|
16436
16428
|
__toESM(require_dist(), 1);
|
|
16437
16429
|
var assertType = function assertType2() {
|
|
16438
16430
|
};
|
|
16439
16431
|
|
|
16440
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.
|
|
16432
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.14_@vitest+ui@3.2.4_jiti@2.6.0_jsdom_cd26cd65b25b201827057a23fd622128/node_modules/vitest/dist/index.js
|
|
16441
16433
|
var import_expect_type2 = __toESM(require_dist(), 1);
|
|
16442
16434
|
var export_expectTypeOf = import_expect_type2.expectTypeOf;
|
|
16443
16435
|
/*! Bundled license information:
|
|
@@ -16480,7 +16472,7 @@ var export_expectTypeOf = import_expect_type2.expectTypeOf;
|
|
|
16480
16472
|
* LICENSE file in the root directory of this source tree.
|
|
16481
16473
|
*)
|
|
16482
16474
|
|
|
16483
|
-
chai/
|
|
16475
|
+
chai/chai.js:
|
|
16484
16476
|
(*!
|
|
16485
16477
|
* Chai - flag utility
|
|
16486
16478
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
@@ -16732,6 +16724,6 @@ chai/index.js:
|
|
|
16732
16724
|
*)
|
|
16733
16725
|
*/
|
|
16734
16726
|
|
|
16735
|
-
export { afterAll, afterEach, assert, assertType, beforeAll, beforeEach, bench, chai_exports as chai, createExpect, describe, globalExpect as expect, export_expectTypeOf as expectTypeOf, inject, it, onTestFailed, onTestFinished, should, suite, test3 as test, vi, vitest };
|
|
16736
|
-
//# sourceMappingURL=dist-
|
|
16737
|
-
//# sourceMappingURL=dist-
|
|
16727
|
+
export { afterAll, afterEach, assert2 as assert, assertType, beforeAll, beforeEach, bench, chai_exports as chai, createExpect, describe, globalExpect as expect, export_expectTypeOf as expectTypeOf, inject, it, onTestFailed, onTestFinished, should, suite, test3 as test, vi, vitest };
|
|
16728
|
+
//# sourceMappingURL=dist-U76IQBNC.js.map
|
|
16729
|
+
//# sourceMappingURL=dist-U76IQBNC.js.map
|