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