@rstest/core 0.8.5 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +2 -2
- package/dist/0~130.js +0 -1
- package/dist/0~1472.js +2 -2
- package/dist/0~2173.js +104 -74
- package/dist/{0~3919.js → 0~262.js} +31 -30
- package/dist/0~3062.js +1 -1
- package/dist/0~3346.js +1 -1
- package/dist/0~5835.js +17 -4
- package/dist/0~6923.js +11 -3
- package/dist/0~7583.js +2 -2
- package/dist/0~7882.js +37 -36
- package/dist/0~89.js +50 -31
- package/dist/0~9634.js +5 -5
- package/dist/0~9744.js +1014 -0
- package/dist/1294.js +1 -0
- package/dist/3160.js +14 -64
- package/dist/{5960.js → 4597.js} +0 -1
- package/dist/6151.js +3119 -51
- package/dist/9131.js +178 -100
- package/dist/browser-runtime/389.js +3398 -362
- package/dist/browser-runtime/index.d.ts +40 -10
- package/dist/browser.d.ts +53 -10
- package/dist/index.d.ts +44 -79
- package/dist/mockRuntimeCode.js +15 -9
- package/dist/worker.d.ts +13 -1521
- package/dist/worker.js +14 -8
- package/package.json +18 -15
- package/dist/0~1981.js +0 -2
- package/dist/0~9348.js +0 -951
- package/dist/721.js +0 -8
package/dist/6151.js
CHANGED
|
@@ -6,7 +6,6 @@ import { getRealTimers, TestRegisterError, formatTestError, formatName } from ".
|
|
|
6
6
|
import { ROOT_SUITE_NAME } from "./1157.js";
|
|
7
7
|
import { parse } from "./1672.js";
|
|
8
8
|
import "./4899.js";
|
|
9
|
-
import "./721.js";
|
|
10
9
|
__webpack_require__.add({
|
|
11
10
|
"../../node_modules/.pnpm/@sinonjs+commons@3.0.1/node_modules/@sinonjs/commons/lib/called-in-order.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
12
11
|
var every = __webpack_require__("../../node_modules/.pnpm/@sinonjs+commons@3.0.1/node_modules/@sinonjs/commons/lib/prototypes/array.js").every;
|
|
@@ -9609,6 +9608,2998 @@ const JestExtend = (chai, utils)=>{
|
|
|
9609
9608
|
use(JestExtendPlugin(chai, expect, expects));
|
|
9610
9609
|
});
|
|
9611
9610
|
};
|
|
9611
|
+
var chai_defProp = Object.defineProperty;
|
|
9612
|
+
var __defNormalProp = (obj, key, value)=>key in obj ? chai_defProp(obj, key, {
|
|
9613
|
+
enumerable: true,
|
|
9614
|
+
configurable: true,
|
|
9615
|
+
writable: true,
|
|
9616
|
+
value
|
|
9617
|
+
}) : obj[key] = value;
|
|
9618
|
+
var chai_name = (target, value)=>chai_defProp(target, "name", {
|
|
9619
|
+
value,
|
|
9620
|
+
configurable: true
|
|
9621
|
+
});
|
|
9622
|
+
var chai_export = (target, all)=>{
|
|
9623
|
+
for(var name in all)chai_defProp(target, name, {
|
|
9624
|
+
get: all[name],
|
|
9625
|
+
enumerable: true
|
|
9626
|
+
});
|
|
9627
|
+
};
|
|
9628
|
+
var __publicField = (obj, key, value)=>__defNormalProp(obj, "symbol" != typeof key ? key + "" : key, value);
|
|
9629
|
+
var chai_utils_exports = {};
|
|
9630
|
+
chai_export(chai_utils_exports, {
|
|
9631
|
+
addChainableMethod: ()=>chai_addChainableMethod,
|
|
9632
|
+
addLengthGuard: ()=>chai_addLengthGuard,
|
|
9633
|
+
addMethod: ()=>node_modules_chai_addMethod,
|
|
9634
|
+
addProperty: ()=>chai_addProperty,
|
|
9635
|
+
checkError: ()=>chai_check_error_exports,
|
|
9636
|
+
compareByInspect: ()=>chai_compareByInspect,
|
|
9637
|
+
eql: ()=>chai_deep_eql_default,
|
|
9638
|
+
events: ()=>events,
|
|
9639
|
+
expectTypes: ()=>chai_expectTypes,
|
|
9640
|
+
flag: ()=>chai_flag,
|
|
9641
|
+
getActual: ()=>chai_getActual,
|
|
9642
|
+
getMessage: ()=>chai_getMessage2,
|
|
9643
|
+
getName: ()=>chai_getName,
|
|
9644
|
+
getOperator: ()=>chai_getOperator,
|
|
9645
|
+
getOwnEnumerableProperties: ()=>chai_getOwnEnumerableProperties,
|
|
9646
|
+
getOwnEnumerablePropertySymbols: ()=>chai_getOwnEnumerablePropertySymbols,
|
|
9647
|
+
getPathInfo: ()=>chai_getPathInfo,
|
|
9648
|
+
hasProperty: ()=>chai_hasProperty,
|
|
9649
|
+
inspect: ()=>chai_inspect2,
|
|
9650
|
+
isNaN: ()=>chai_isNaN2,
|
|
9651
|
+
isNumeric: ()=>chai_isNumeric,
|
|
9652
|
+
isProxyEnabled: ()=>chai_isProxyEnabled,
|
|
9653
|
+
isRegExp: ()=>chai_isRegExp2,
|
|
9654
|
+
objDisplay: ()=>node_modules_chai_objDisplay,
|
|
9655
|
+
overwriteChainableMethod: ()=>chai_overwriteChainableMethod,
|
|
9656
|
+
overwriteMethod: ()=>chai_overwriteMethod,
|
|
9657
|
+
overwriteProperty: ()=>chai_overwriteProperty,
|
|
9658
|
+
proxify: ()=>chai_proxify,
|
|
9659
|
+
test: ()=>node_modules_chai_test,
|
|
9660
|
+
transferFlags: ()=>chai_transferFlags,
|
|
9661
|
+
type: ()=>node_modules_chai_type
|
|
9662
|
+
});
|
|
9663
|
+
var chai_check_error_exports = {};
|
|
9664
|
+
chai_export(chai_check_error_exports, {
|
|
9665
|
+
compatibleConstructor: ()=>chai_compatibleConstructor,
|
|
9666
|
+
compatibleInstance: ()=>chai_compatibleInstance,
|
|
9667
|
+
compatibleMessage: ()=>chai_compatibleMessage,
|
|
9668
|
+
getConstructorName: ()=>node_modules_chai_getConstructorName,
|
|
9669
|
+
getMessage: ()=>chai_getMessage
|
|
9670
|
+
});
|
|
9671
|
+
function chai_isErrorInstance(obj) {
|
|
9672
|
+
return obj instanceof Error || "[object Error]" === Object.prototype.toString.call(obj);
|
|
9673
|
+
}
|
|
9674
|
+
chai_name(chai_isErrorInstance, "isErrorInstance");
|
|
9675
|
+
function chai_isRegExp(obj) {
|
|
9676
|
+
return "[object RegExp]" === Object.prototype.toString.call(obj);
|
|
9677
|
+
}
|
|
9678
|
+
chai_name(chai_isRegExp, "isRegExp");
|
|
9679
|
+
function chai_compatibleInstance(thrown, errorLike) {
|
|
9680
|
+
return chai_isErrorInstance(errorLike) && thrown === errorLike;
|
|
9681
|
+
}
|
|
9682
|
+
chai_name(chai_compatibleInstance, "compatibleInstance");
|
|
9683
|
+
function chai_compatibleConstructor(thrown, errorLike) {
|
|
9684
|
+
if (chai_isErrorInstance(errorLike)) return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor;
|
|
9685
|
+
if (("object" == typeof errorLike || "function" == typeof errorLike) && errorLike.prototype) return thrown.constructor === errorLike || thrown instanceof errorLike;
|
|
9686
|
+
return false;
|
|
9687
|
+
}
|
|
9688
|
+
chai_name(chai_compatibleConstructor, "compatibleConstructor");
|
|
9689
|
+
function chai_compatibleMessage(thrown, errMatcher) {
|
|
9690
|
+
const comparisonString = "string" == typeof thrown ? thrown : thrown.message;
|
|
9691
|
+
if (chai_isRegExp(errMatcher)) return errMatcher.test(comparisonString);
|
|
9692
|
+
if ("string" == typeof errMatcher) return -1 !== comparisonString.indexOf(errMatcher);
|
|
9693
|
+
return false;
|
|
9694
|
+
}
|
|
9695
|
+
chai_name(chai_compatibleMessage, "compatibleMessage");
|
|
9696
|
+
function node_modules_chai_getConstructorName(errorLike) {
|
|
9697
|
+
let constructorName = errorLike;
|
|
9698
|
+
if (chai_isErrorInstance(errorLike)) constructorName = errorLike.constructor.name;
|
|
9699
|
+
else if ("function" == typeof errorLike) {
|
|
9700
|
+
constructorName = errorLike.name;
|
|
9701
|
+
if ("" === constructorName) {
|
|
9702
|
+
const newConstructorName = new errorLike().name;
|
|
9703
|
+
constructorName = newConstructorName || constructorName;
|
|
9704
|
+
}
|
|
9705
|
+
}
|
|
9706
|
+
return constructorName;
|
|
9707
|
+
}
|
|
9708
|
+
chai_name(node_modules_chai_getConstructorName, "getConstructorName");
|
|
9709
|
+
function chai_getMessage(errorLike) {
|
|
9710
|
+
let msg = "";
|
|
9711
|
+
if (errorLike && errorLike.message) msg = errorLike.message;
|
|
9712
|
+
else if ("string" == typeof errorLike) msg = errorLike;
|
|
9713
|
+
return msg;
|
|
9714
|
+
}
|
|
9715
|
+
chai_name(chai_getMessage, "getMessage");
|
|
9716
|
+
function chai_flag(obj, key, value) {
|
|
9717
|
+
let flags = obj.__flags || (obj.__flags = /* @__PURE__ */ Object.create(null));
|
|
9718
|
+
if (3 !== arguments.length) return flags[key];
|
|
9719
|
+
flags[key] = value;
|
|
9720
|
+
}
|
|
9721
|
+
chai_name(chai_flag, "flag");
|
|
9722
|
+
function node_modules_chai_test(obj, args) {
|
|
9723
|
+
let negate = chai_flag(obj, "negate"), expr = args[0];
|
|
9724
|
+
return negate ? !expr : expr;
|
|
9725
|
+
}
|
|
9726
|
+
chai_name(node_modules_chai_test, "test");
|
|
9727
|
+
function node_modules_chai_type(obj) {
|
|
9728
|
+
if (void 0 === obj) return "undefined";
|
|
9729
|
+
if (null === obj) return "null";
|
|
9730
|
+
const stringTag = obj[Symbol.toStringTag];
|
|
9731
|
+
if ("string" == typeof stringTag) return stringTag;
|
|
9732
|
+
const type3 = Object.prototype.toString.call(obj).slice(8, -1);
|
|
9733
|
+
return type3;
|
|
9734
|
+
}
|
|
9735
|
+
chai_name(node_modules_chai_type, "type");
|
|
9736
|
+
var chai_canElideFrames = "captureStackTrace" in Error;
|
|
9737
|
+
var node_modules_chai_AssertionError = class _AssertionError extends Error {
|
|
9738
|
+
constructor(message = "Unspecified AssertionError", props, ssf){
|
|
9739
|
+
super(message);
|
|
9740
|
+
__publicField(this, "message");
|
|
9741
|
+
this.message = message;
|
|
9742
|
+
if (chai_canElideFrames) Error.captureStackTrace(this, ssf || _AssertionError);
|
|
9743
|
+
for(const key in props)if (!(key in this)) this[key] = props[key];
|
|
9744
|
+
}
|
|
9745
|
+
get name() {
|
|
9746
|
+
return "AssertionError";
|
|
9747
|
+
}
|
|
9748
|
+
get ok() {
|
|
9749
|
+
return false;
|
|
9750
|
+
}
|
|
9751
|
+
toJSON(stack) {
|
|
9752
|
+
return {
|
|
9753
|
+
...this,
|
|
9754
|
+
name: this.name,
|
|
9755
|
+
message: this.message,
|
|
9756
|
+
ok: false,
|
|
9757
|
+
stack: false !== stack ? this.stack : void 0
|
|
9758
|
+
};
|
|
9759
|
+
}
|
|
9760
|
+
};
|
|
9761
|
+
chai_name(node_modules_chai_AssertionError, "AssertionError");
|
|
9762
|
+
var chai_6_2_2_node_modules_chai_AssertionError = node_modules_chai_AssertionError;
|
|
9763
|
+
function chai_expectTypes(obj, types) {
|
|
9764
|
+
let flagMsg = chai_flag(obj, "message");
|
|
9765
|
+
let ssfi = chai_flag(obj, "ssfi");
|
|
9766
|
+
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
9767
|
+
obj = chai_flag(obj, "object");
|
|
9768
|
+
types = types.map(function(t) {
|
|
9769
|
+
return t.toLowerCase();
|
|
9770
|
+
});
|
|
9771
|
+
types.sort();
|
|
9772
|
+
let str = types.map(function(t, index) {
|
|
9773
|
+
let art = ~[
|
|
9774
|
+
"a",
|
|
9775
|
+
"e",
|
|
9776
|
+
"i",
|
|
9777
|
+
"o",
|
|
9778
|
+
"u"
|
|
9779
|
+
].indexOf(t.charAt(0)) ? "an" : "a";
|
|
9780
|
+
let or = types.length > 1 && index === types.length - 1 ? "or " : "";
|
|
9781
|
+
return or + art + " " + t;
|
|
9782
|
+
}).join(", ");
|
|
9783
|
+
let objType = node_modules_chai_type(obj).toLowerCase();
|
|
9784
|
+
if (!types.some(function(expected) {
|
|
9785
|
+
return objType === expected;
|
|
9786
|
+
})) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + "object tested must be " + str + ", but " + objType + " given", void 0, ssfi);
|
|
9787
|
+
}
|
|
9788
|
+
chai_name(chai_expectTypes, "expectTypes");
|
|
9789
|
+
function chai_getActual(obj, args) {
|
|
9790
|
+
return args.length > 4 ? args[4] : obj._obj;
|
|
9791
|
+
}
|
|
9792
|
+
chai_name(chai_getActual, "getActual");
|
|
9793
|
+
var node_modules_chai_ansiColors = {
|
|
9794
|
+
bold: [
|
|
9795
|
+
"1",
|
|
9796
|
+
"22"
|
|
9797
|
+
],
|
|
9798
|
+
dim: [
|
|
9799
|
+
"2",
|
|
9800
|
+
"22"
|
|
9801
|
+
],
|
|
9802
|
+
italic: [
|
|
9803
|
+
"3",
|
|
9804
|
+
"23"
|
|
9805
|
+
],
|
|
9806
|
+
underline: [
|
|
9807
|
+
"4",
|
|
9808
|
+
"24"
|
|
9809
|
+
],
|
|
9810
|
+
inverse: [
|
|
9811
|
+
"7",
|
|
9812
|
+
"27"
|
|
9813
|
+
],
|
|
9814
|
+
hidden: [
|
|
9815
|
+
"8",
|
|
9816
|
+
"28"
|
|
9817
|
+
],
|
|
9818
|
+
strike: [
|
|
9819
|
+
"9",
|
|
9820
|
+
"29"
|
|
9821
|
+
],
|
|
9822
|
+
black: [
|
|
9823
|
+
"30",
|
|
9824
|
+
"39"
|
|
9825
|
+
],
|
|
9826
|
+
red: [
|
|
9827
|
+
"31",
|
|
9828
|
+
"39"
|
|
9829
|
+
],
|
|
9830
|
+
green: [
|
|
9831
|
+
"32",
|
|
9832
|
+
"39"
|
|
9833
|
+
],
|
|
9834
|
+
yellow: [
|
|
9835
|
+
"33",
|
|
9836
|
+
"39"
|
|
9837
|
+
],
|
|
9838
|
+
blue: [
|
|
9839
|
+
"34",
|
|
9840
|
+
"39"
|
|
9841
|
+
],
|
|
9842
|
+
magenta: [
|
|
9843
|
+
"35",
|
|
9844
|
+
"39"
|
|
9845
|
+
],
|
|
9846
|
+
cyan: [
|
|
9847
|
+
"36",
|
|
9848
|
+
"39"
|
|
9849
|
+
],
|
|
9850
|
+
white: [
|
|
9851
|
+
"37",
|
|
9852
|
+
"39"
|
|
9853
|
+
],
|
|
9854
|
+
brightblack: [
|
|
9855
|
+
"30;1",
|
|
9856
|
+
"39"
|
|
9857
|
+
],
|
|
9858
|
+
brightred: [
|
|
9859
|
+
"31;1",
|
|
9860
|
+
"39"
|
|
9861
|
+
],
|
|
9862
|
+
brightgreen: [
|
|
9863
|
+
"32;1",
|
|
9864
|
+
"39"
|
|
9865
|
+
],
|
|
9866
|
+
brightyellow: [
|
|
9867
|
+
"33;1",
|
|
9868
|
+
"39"
|
|
9869
|
+
],
|
|
9870
|
+
brightblue: [
|
|
9871
|
+
"34;1",
|
|
9872
|
+
"39"
|
|
9873
|
+
],
|
|
9874
|
+
brightmagenta: [
|
|
9875
|
+
"35;1",
|
|
9876
|
+
"39"
|
|
9877
|
+
],
|
|
9878
|
+
brightcyan: [
|
|
9879
|
+
"36;1",
|
|
9880
|
+
"39"
|
|
9881
|
+
],
|
|
9882
|
+
brightwhite: [
|
|
9883
|
+
"37;1",
|
|
9884
|
+
"39"
|
|
9885
|
+
],
|
|
9886
|
+
grey: [
|
|
9887
|
+
"90",
|
|
9888
|
+
"39"
|
|
9889
|
+
]
|
|
9890
|
+
};
|
|
9891
|
+
var node_modules_chai_styles = {
|
|
9892
|
+
special: "cyan",
|
|
9893
|
+
number: "yellow",
|
|
9894
|
+
bigint: "yellow",
|
|
9895
|
+
boolean: "yellow",
|
|
9896
|
+
undefined: "grey",
|
|
9897
|
+
null: "bold",
|
|
9898
|
+
string: "green",
|
|
9899
|
+
symbol: "green",
|
|
9900
|
+
date: "magenta",
|
|
9901
|
+
regexp: "red"
|
|
9902
|
+
};
|
|
9903
|
+
var node_modules_chai_truncator = "\u2026";
|
|
9904
|
+
function node_modules_chai_colorise(value, styleType) {
|
|
9905
|
+
const color = node_modules_chai_ansiColors[node_modules_chai_styles[styleType]] || node_modules_chai_ansiColors[styleType] || "";
|
|
9906
|
+
if (!color) return String(value);
|
|
9907
|
+
return `\x1B[${color[0]}m${String(value)}\x1B[${color[1]}m`;
|
|
9908
|
+
}
|
|
9909
|
+
chai_name(node_modules_chai_colorise, "colorise");
|
|
9910
|
+
function node_modules_chai_normaliseOptions({ showHidden = false, depth = 2, colors = false, customInspect = true, showProxy = false, maxArrayLength = 1 / 0, breakLength = 1 / 0, seen = [], truncate: truncate2 = 1 / 0, stylize = String } = {}, inspect3) {
|
|
9911
|
+
const options = {
|
|
9912
|
+
showHidden: Boolean(showHidden),
|
|
9913
|
+
depth: Number(depth),
|
|
9914
|
+
colors: Boolean(colors),
|
|
9915
|
+
customInspect: Boolean(customInspect),
|
|
9916
|
+
showProxy: Boolean(showProxy),
|
|
9917
|
+
maxArrayLength: Number(maxArrayLength),
|
|
9918
|
+
breakLength: Number(breakLength),
|
|
9919
|
+
truncate: Number(truncate2),
|
|
9920
|
+
seen,
|
|
9921
|
+
inspect: inspect3,
|
|
9922
|
+
stylize
|
|
9923
|
+
};
|
|
9924
|
+
if (options.colors) options.stylize = node_modules_chai_colorise;
|
|
9925
|
+
return options;
|
|
9926
|
+
}
|
|
9927
|
+
chai_name(node_modules_chai_normaliseOptions, "normaliseOptions");
|
|
9928
|
+
function node_modules_chai_isHighSurrogate(char) {
|
|
9929
|
+
return char >= "\uD800" && char <= "\uDBFF";
|
|
9930
|
+
}
|
|
9931
|
+
chai_name(node_modules_chai_isHighSurrogate, "isHighSurrogate");
|
|
9932
|
+
function node_modules_chai_truncate(string, length, tail = node_modules_chai_truncator) {
|
|
9933
|
+
string = String(string);
|
|
9934
|
+
const tailLength = tail.length;
|
|
9935
|
+
const stringLength = string.length;
|
|
9936
|
+
if (tailLength > length && stringLength > tailLength) return tail;
|
|
9937
|
+
if (stringLength > length && stringLength > tailLength) {
|
|
9938
|
+
let end = length - tailLength;
|
|
9939
|
+
if (end > 0 && node_modules_chai_isHighSurrogate(string[end - 1])) end -= 1;
|
|
9940
|
+
return `${string.slice(0, end)}${tail}`;
|
|
9941
|
+
}
|
|
9942
|
+
return string;
|
|
9943
|
+
}
|
|
9944
|
+
chai_name(node_modules_chai_truncate, "truncate");
|
|
9945
|
+
function node_modules_chai_inspectList(list, options, inspectItem, separator = ", ") {
|
|
9946
|
+
inspectItem = inspectItem || options.inspect;
|
|
9947
|
+
const size = list.length;
|
|
9948
|
+
if (0 === size) return "";
|
|
9949
|
+
const originalLength = options.truncate;
|
|
9950
|
+
let output = "";
|
|
9951
|
+
let peek = "";
|
|
9952
|
+
let truncated = "";
|
|
9953
|
+
for(let i = 0; i < size; i += 1){
|
|
9954
|
+
const last = i + 1 === list.length;
|
|
9955
|
+
const secondToLast = i + 2 === list.length;
|
|
9956
|
+
truncated = `${node_modules_chai_truncator}(${list.length - i})`;
|
|
9957
|
+
const value = list[i];
|
|
9958
|
+
options.truncate = originalLength - output.length - (last ? 0 : separator.length);
|
|
9959
|
+
const string = peek || inspectItem(value, options) + (last ? "" : separator);
|
|
9960
|
+
const nextLength = output.length + string.length;
|
|
9961
|
+
const truncatedLength = nextLength + truncated.length;
|
|
9962
|
+
if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) break;
|
|
9963
|
+
if (!last && !secondToLast && truncatedLength > originalLength) break;
|
|
9964
|
+
peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator);
|
|
9965
|
+
if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) break;
|
|
9966
|
+
output += string;
|
|
9967
|
+
if (!last && !secondToLast && nextLength + peek.length >= originalLength) {
|
|
9968
|
+
truncated = `${node_modules_chai_truncator}(${list.length - i - 1})`;
|
|
9969
|
+
break;
|
|
9970
|
+
}
|
|
9971
|
+
truncated = "";
|
|
9972
|
+
}
|
|
9973
|
+
return `${output}${truncated}`;
|
|
9974
|
+
}
|
|
9975
|
+
chai_name(node_modules_chai_inspectList, "inspectList");
|
|
9976
|
+
function node_modules_chai_quoteComplexKey(key) {
|
|
9977
|
+
if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) return key;
|
|
9978
|
+
return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
|
|
9979
|
+
}
|
|
9980
|
+
chai_name(node_modules_chai_quoteComplexKey, "quoteComplexKey");
|
|
9981
|
+
function node_modules_chai_inspectProperty([key, value], options) {
|
|
9982
|
+
options.truncate -= 2;
|
|
9983
|
+
if ("string" == typeof key) key = node_modules_chai_quoteComplexKey(key);
|
|
9984
|
+
else if ("number" != typeof key) key = `[${options.inspect(key, options)}]`;
|
|
9985
|
+
options.truncate -= key.length;
|
|
9986
|
+
value = options.inspect(value, options);
|
|
9987
|
+
return `${key}: ${value}`;
|
|
9988
|
+
}
|
|
9989
|
+
chai_name(node_modules_chai_inspectProperty, "inspectProperty");
|
|
9990
|
+
function node_modules_chai_inspectArray(array, options) {
|
|
9991
|
+
const nonIndexProperties = Object.keys(array).slice(array.length);
|
|
9992
|
+
if (!array.length && !nonIndexProperties.length) return "[]";
|
|
9993
|
+
options.truncate -= 4;
|
|
9994
|
+
const listContents = node_modules_chai_inspectList(array, options);
|
|
9995
|
+
options.truncate -= listContents.length;
|
|
9996
|
+
let propertyContents = "";
|
|
9997
|
+
if (nonIndexProperties.length) propertyContents = node_modules_chai_inspectList(nonIndexProperties.map((key)=>[
|
|
9998
|
+
key,
|
|
9999
|
+
array[key]
|
|
10000
|
+
]), options, node_modules_chai_inspectProperty);
|
|
10001
|
+
return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`;
|
|
10002
|
+
}
|
|
10003
|
+
chai_name(node_modules_chai_inspectArray, "inspectArray");
|
|
10004
|
+
var node_modules_chai_getArrayName = /* @__PURE__ */ chai_name((array)=>{
|
|
10005
|
+
if ("function" == typeof Buffer && array instanceof Buffer) return "Buffer";
|
|
10006
|
+
if (array[Symbol.toStringTag]) return array[Symbol.toStringTag];
|
|
10007
|
+
return array.constructor.name;
|
|
10008
|
+
}, "getArrayName");
|
|
10009
|
+
function node_modules_chai_inspectTypedArray(array, options) {
|
|
10010
|
+
const name = node_modules_chai_getArrayName(array);
|
|
10011
|
+
options.truncate -= name.length + 4;
|
|
10012
|
+
const nonIndexProperties = Object.keys(array).slice(array.length);
|
|
10013
|
+
if (!array.length && !nonIndexProperties.length) return `${name}[]`;
|
|
10014
|
+
let output = "";
|
|
10015
|
+
for(let i = 0; i < array.length; i++){
|
|
10016
|
+
const string = `${options.stylize(node_modules_chai_truncate(array[i], options.truncate), "number")}${i === array.length - 1 ? "" : ", "}`;
|
|
10017
|
+
options.truncate -= string.length;
|
|
10018
|
+
if (array[i] !== array.length && options.truncate <= 3) {
|
|
10019
|
+
output += `${node_modules_chai_truncator}(${array.length - array[i] + 1})`;
|
|
10020
|
+
break;
|
|
10021
|
+
}
|
|
10022
|
+
output += string;
|
|
10023
|
+
}
|
|
10024
|
+
let propertyContents = "";
|
|
10025
|
+
if (nonIndexProperties.length) propertyContents = node_modules_chai_inspectList(nonIndexProperties.map((key)=>[
|
|
10026
|
+
key,
|
|
10027
|
+
array[key]
|
|
10028
|
+
]), options, node_modules_chai_inspectProperty);
|
|
10029
|
+
return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ""} ]`;
|
|
10030
|
+
}
|
|
10031
|
+
chai_name(node_modules_chai_inspectTypedArray, "inspectTypedArray");
|
|
10032
|
+
function node_modules_chai_inspectDate(dateObject, options) {
|
|
10033
|
+
const stringRepresentation = dateObject.toJSON();
|
|
10034
|
+
if (null === stringRepresentation) return "Invalid Date";
|
|
10035
|
+
const split = stringRepresentation.split("T");
|
|
10036
|
+
const date = split[0];
|
|
10037
|
+
return options.stylize(`${date}T${node_modules_chai_truncate(split[1], options.truncate - date.length - 1)}`, "date");
|
|
10038
|
+
}
|
|
10039
|
+
chai_name(node_modules_chai_inspectDate, "inspectDate");
|
|
10040
|
+
function node_modules_chai_inspectFunction(func, options) {
|
|
10041
|
+
const functionType = func[Symbol.toStringTag] || "Function";
|
|
10042
|
+
const name = func.name;
|
|
10043
|
+
if (!name) return options.stylize(`[${functionType}]`, "special");
|
|
10044
|
+
return options.stylize(`[${functionType} ${node_modules_chai_truncate(name, options.truncate - 11)}]`, "special");
|
|
10045
|
+
}
|
|
10046
|
+
chai_name(node_modules_chai_inspectFunction, "inspectFunction");
|
|
10047
|
+
function node_modules_chai_inspectMapEntry([key, value], options) {
|
|
10048
|
+
options.truncate -= 4;
|
|
10049
|
+
key = options.inspect(key, options);
|
|
10050
|
+
options.truncate -= key.length;
|
|
10051
|
+
value = options.inspect(value, options);
|
|
10052
|
+
return `${key} => ${value}`;
|
|
10053
|
+
}
|
|
10054
|
+
chai_name(node_modules_chai_inspectMapEntry, "inspectMapEntry");
|
|
10055
|
+
function node_modules_chai_mapToEntries(map) {
|
|
10056
|
+
const entries = [];
|
|
10057
|
+
map.forEach((value, key)=>{
|
|
10058
|
+
entries.push([
|
|
10059
|
+
key,
|
|
10060
|
+
value
|
|
10061
|
+
]);
|
|
10062
|
+
});
|
|
10063
|
+
return entries;
|
|
10064
|
+
}
|
|
10065
|
+
chai_name(node_modules_chai_mapToEntries, "mapToEntries");
|
|
10066
|
+
function node_modules_chai_inspectMap(map, options) {
|
|
10067
|
+
if (0 === map.size) return "Map{}";
|
|
10068
|
+
options.truncate -= 7;
|
|
10069
|
+
return `Map{ ${node_modules_chai_inspectList(node_modules_chai_mapToEntries(map), options, node_modules_chai_inspectMapEntry)} }`;
|
|
10070
|
+
}
|
|
10071
|
+
chai_name(node_modules_chai_inspectMap, "inspectMap");
|
|
10072
|
+
var node_modules_chai_isNaN = Number.isNaN || ((i)=>i !== i);
|
|
10073
|
+
function node_modules_chai_inspectNumber(number, options) {
|
|
10074
|
+
if (node_modules_chai_isNaN(number)) return options.stylize("NaN", "number");
|
|
10075
|
+
if (number === 1 / 0) return options.stylize("Infinity", "number");
|
|
10076
|
+
if (number === -1 / 0) return options.stylize("-Infinity", "number");
|
|
10077
|
+
if (0 === number) return options.stylize(1 / number === 1 / 0 ? "+0" : "-0", "number");
|
|
10078
|
+
return options.stylize(node_modules_chai_truncate(String(number), options.truncate), "number");
|
|
10079
|
+
}
|
|
10080
|
+
chai_name(node_modules_chai_inspectNumber, "inspectNumber");
|
|
10081
|
+
function node_modules_chai_inspectBigInt(number, options) {
|
|
10082
|
+
let nums = node_modules_chai_truncate(number.toString(), options.truncate - 1);
|
|
10083
|
+
if (nums !== node_modules_chai_truncator) nums += "n";
|
|
10084
|
+
return options.stylize(nums, "bigint");
|
|
10085
|
+
}
|
|
10086
|
+
chai_name(node_modules_chai_inspectBigInt, "inspectBigInt");
|
|
10087
|
+
function node_modules_chai_inspectRegExp(value, options) {
|
|
10088
|
+
const flags = value.toString().split("/")[2];
|
|
10089
|
+
const sourceLength = options.truncate - (2 + flags.length);
|
|
10090
|
+
const source = value.source;
|
|
10091
|
+
return options.stylize(`/${node_modules_chai_truncate(source, sourceLength)}/${flags}`, "regexp");
|
|
10092
|
+
}
|
|
10093
|
+
chai_name(node_modules_chai_inspectRegExp, "inspectRegExp");
|
|
10094
|
+
function node_modules_chai_arrayFromSet(set2) {
|
|
10095
|
+
const values = [];
|
|
10096
|
+
set2.forEach((value)=>{
|
|
10097
|
+
values.push(value);
|
|
10098
|
+
});
|
|
10099
|
+
return values;
|
|
10100
|
+
}
|
|
10101
|
+
chai_name(node_modules_chai_arrayFromSet, "arrayFromSet");
|
|
10102
|
+
function node_modules_chai_inspectSet(set2, options) {
|
|
10103
|
+
if (0 === set2.size) return "Set{}";
|
|
10104
|
+
options.truncate -= 7;
|
|
10105
|
+
return `Set{ ${node_modules_chai_inspectList(node_modules_chai_arrayFromSet(set2), options)} }`;
|
|
10106
|
+
}
|
|
10107
|
+
chai_name(node_modules_chai_inspectSet, "inspectSet");
|
|
10108
|
+
var node_modules_chai_stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g");
|
|
10109
|
+
var node_modules_chai_escapeCharacters = {
|
|
10110
|
+
"\b": "\\b",
|
|
10111
|
+
" ": "\\t",
|
|
10112
|
+
"\n": "\\n",
|
|
10113
|
+
"\f": "\\f",
|
|
10114
|
+
"\r": "\\r",
|
|
10115
|
+
"'": "\\'",
|
|
10116
|
+
"\\": "\\\\"
|
|
10117
|
+
};
|
|
10118
|
+
var node_modules_chai_hex = 16;
|
|
10119
|
+
var node_modules_chai_unicodeLength = 4;
|
|
10120
|
+
function node_modules_chai_escape(char) {
|
|
10121
|
+
return node_modules_chai_escapeCharacters[char] || `\\u${`0000${char.charCodeAt(0).toString(node_modules_chai_hex)}`.slice(-node_modules_chai_unicodeLength)}`;
|
|
10122
|
+
}
|
|
10123
|
+
chai_name(node_modules_chai_escape, "escape");
|
|
10124
|
+
function node_modules_chai_inspectString(string, options) {
|
|
10125
|
+
if (node_modules_chai_stringEscapeChars.test(string)) string = string.replace(node_modules_chai_stringEscapeChars, node_modules_chai_escape);
|
|
10126
|
+
return options.stylize(`'${node_modules_chai_truncate(string, options.truncate - 2)}'`, "string");
|
|
10127
|
+
}
|
|
10128
|
+
chai_name(node_modules_chai_inspectString, "inspectString");
|
|
10129
|
+
function node_modules_chai_inspectSymbol(value) {
|
|
10130
|
+
if ("description" in Symbol.prototype) return value.description ? `Symbol(${value.description})` : "Symbol()";
|
|
10131
|
+
return value.toString();
|
|
10132
|
+
}
|
|
10133
|
+
chai_name(node_modules_chai_inspectSymbol, "inspectSymbol");
|
|
10134
|
+
var node_modules_chai_getPromiseValue = /* @__PURE__ */ chai_name(()=>"Promise{\u2026}", "getPromiseValue");
|
|
10135
|
+
var chai_promise_default = node_modules_chai_getPromiseValue;
|
|
10136
|
+
function node_modules_chai_inspectObject(object, options) {
|
|
10137
|
+
const properties = Object.getOwnPropertyNames(object);
|
|
10138
|
+
const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [];
|
|
10139
|
+
if (0 === properties.length && 0 === symbols.length) return "{}";
|
|
10140
|
+
options.truncate -= 4;
|
|
10141
|
+
options.seen = options.seen || [];
|
|
10142
|
+
if (options.seen.includes(object)) return "[Circular]";
|
|
10143
|
+
options.seen.push(object);
|
|
10144
|
+
const propertyContents = node_modules_chai_inspectList(properties.map((key)=>[
|
|
10145
|
+
key,
|
|
10146
|
+
object[key]
|
|
10147
|
+
]), options, node_modules_chai_inspectProperty);
|
|
10148
|
+
const symbolContents = node_modules_chai_inspectList(symbols.map((key)=>[
|
|
10149
|
+
key,
|
|
10150
|
+
object[key]
|
|
10151
|
+
]), options, node_modules_chai_inspectProperty);
|
|
10152
|
+
options.seen.pop();
|
|
10153
|
+
let sep = "";
|
|
10154
|
+
if (propertyContents && symbolContents) sep = ", ";
|
|
10155
|
+
return `{ ${propertyContents}${sep}${symbolContents} }`;
|
|
10156
|
+
}
|
|
10157
|
+
chai_name(node_modules_chai_inspectObject, "inspectObject");
|
|
10158
|
+
var node_modules_chai_toStringTag = "u" > typeof Symbol && Symbol.toStringTag ? Symbol.toStringTag : false;
|
|
10159
|
+
function node_modules_chai_inspectClass(value, options) {
|
|
10160
|
+
let name = "";
|
|
10161
|
+
if (node_modules_chai_toStringTag && node_modules_chai_toStringTag in value) name = value[node_modules_chai_toStringTag];
|
|
10162
|
+
name = name || value.constructor.name;
|
|
10163
|
+
if (!name || "_class" === name) name = "<Anonymous Class>";
|
|
10164
|
+
options.truncate -= name.length;
|
|
10165
|
+
return `${name}${node_modules_chai_inspectObject(value, options)}`;
|
|
10166
|
+
}
|
|
10167
|
+
chai_name(node_modules_chai_inspectClass, "inspectClass");
|
|
10168
|
+
function node_modules_chai_inspectArguments(args, options) {
|
|
10169
|
+
if (0 === args.length) return "Arguments[]";
|
|
10170
|
+
options.truncate -= 13;
|
|
10171
|
+
return `Arguments[ ${node_modules_chai_inspectList(args, options)} ]`;
|
|
10172
|
+
}
|
|
10173
|
+
chai_name(node_modules_chai_inspectArguments, "inspectArguments");
|
|
10174
|
+
var node_modules_chai_errorKeys = [
|
|
10175
|
+
"stack",
|
|
10176
|
+
"line",
|
|
10177
|
+
"column",
|
|
10178
|
+
"name",
|
|
10179
|
+
"message",
|
|
10180
|
+
"fileName",
|
|
10181
|
+
"lineNumber",
|
|
10182
|
+
"columnNumber",
|
|
10183
|
+
"number",
|
|
10184
|
+
"description",
|
|
10185
|
+
"cause"
|
|
10186
|
+
];
|
|
10187
|
+
function chai_inspectObject2(error, options) {
|
|
10188
|
+
const properties = Object.getOwnPropertyNames(error).filter((key)=>-1 === node_modules_chai_errorKeys.indexOf(key));
|
|
10189
|
+
const name = error.name;
|
|
10190
|
+
options.truncate -= name.length;
|
|
10191
|
+
let message = "";
|
|
10192
|
+
if ("string" == typeof error.message) message = node_modules_chai_truncate(error.message, options.truncate);
|
|
10193
|
+
else properties.unshift("message");
|
|
10194
|
+
message = message ? `: ${message}` : "";
|
|
10195
|
+
options.truncate -= message.length + 5;
|
|
10196
|
+
options.seen = options.seen || [];
|
|
10197
|
+
if (options.seen.includes(error)) return "[Circular]";
|
|
10198
|
+
options.seen.push(error);
|
|
10199
|
+
const propertyContents = node_modules_chai_inspectList(properties.map((key)=>[
|
|
10200
|
+
key,
|
|
10201
|
+
error[key]
|
|
10202
|
+
]), options, node_modules_chai_inspectProperty);
|
|
10203
|
+
return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`;
|
|
10204
|
+
}
|
|
10205
|
+
chai_name(chai_inspectObject2, "inspectObject");
|
|
10206
|
+
function node_modules_chai_inspectAttribute([key, value], options) {
|
|
10207
|
+
options.truncate -= 3;
|
|
10208
|
+
if (!value) return `${options.stylize(String(key), "yellow")}`;
|
|
10209
|
+
return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`;
|
|
10210
|
+
}
|
|
10211
|
+
chai_name(node_modules_chai_inspectAttribute, "inspectAttribute");
|
|
10212
|
+
function node_modules_chai_inspectNodeCollection(collection, options) {
|
|
10213
|
+
return node_modules_chai_inspectList(collection, options, node_modules_chai_inspectNode, "\n");
|
|
10214
|
+
}
|
|
10215
|
+
chai_name(node_modules_chai_inspectNodeCollection, "inspectNodeCollection");
|
|
10216
|
+
function node_modules_chai_inspectNode(node, options) {
|
|
10217
|
+
switch(node.nodeType){
|
|
10218
|
+
case 1:
|
|
10219
|
+
return node_modules_chai_inspectHTML(node, options);
|
|
10220
|
+
case 3:
|
|
10221
|
+
return options.inspect(node.data, options);
|
|
10222
|
+
default:
|
|
10223
|
+
return options.inspect(node, options);
|
|
10224
|
+
}
|
|
10225
|
+
}
|
|
10226
|
+
chai_name(node_modules_chai_inspectNode, "inspectNode");
|
|
10227
|
+
function node_modules_chai_inspectHTML(element, options) {
|
|
10228
|
+
const properties = element.getAttributeNames();
|
|
10229
|
+
const name = element.tagName.toLowerCase();
|
|
10230
|
+
const head = options.stylize(`<${name}`, "special");
|
|
10231
|
+
const headClose = options.stylize(">", "special");
|
|
10232
|
+
const tail = options.stylize(`</${name}>`, "special");
|
|
10233
|
+
options.truncate -= 2 * name.length + 5;
|
|
10234
|
+
let propertyContents = "";
|
|
10235
|
+
if (properties.length > 0) {
|
|
10236
|
+
propertyContents += " ";
|
|
10237
|
+
propertyContents += node_modules_chai_inspectList(properties.map((key)=>[
|
|
10238
|
+
key,
|
|
10239
|
+
element.getAttribute(key)
|
|
10240
|
+
]), options, node_modules_chai_inspectAttribute, " ");
|
|
10241
|
+
}
|
|
10242
|
+
options.truncate -= propertyContents.length;
|
|
10243
|
+
const truncate2 = options.truncate;
|
|
10244
|
+
let children = node_modules_chai_inspectNodeCollection(element.children, options);
|
|
10245
|
+
if (children && children.length > truncate2) children = `${node_modules_chai_truncator}(${element.children.length})`;
|
|
10246
|
+
return `${head}${propertyContents}${headClose}${children}${tail}`;
|
|
10247
|
+
}
|
|
10248
|
+
chai_name(node_modules_chai_inspectHTML, "inspectHTML");
|
|
10249
|
+
var node_modules_chai_symbolsSupported = "function" == typeof Symbol && "function" == typeof Symbol.for;
|
|
10250
|
+
var node_modules_chai_chaiInspect = node_modules_chai_symbolsSupported ? /* @__PURE__ */ Symbol.for("chai/inspect") : "@@chai/inspect";
|
|
10251
|
+
var node_modules_chai_nodeInspect = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
10252
|
+
var node_modules_chai_constructorMap = /* @__PURE__ */ new WeakMap();
|
|
10253
|
+
var node_modules_chai_stringTagMap = {};
|
|
10254
|
+
var node_modules_chai_baseTypesMap = {
|
|
10255
|
+
undefined: /* @__PURE__ */ chai_name((value, options)=>options.stylize("undefined", "undefined"), "undefined"),
|
|
10256
|
+
null: /* @__PURE__ */ chai_name((value, options)=>options.stylize("null", "null"), "null"),
|
|
10257
|
+
boolean: /* @__PURE__ */ chai_name((value, options)=>options.stylize(String(value), "boolean"), "boolean"),
|
|
10258
|
+
Boolean: /* @__PURE__ */ chai_name((value, options)=>options.stylize(String(value), "boolean"), "Boolean"),
|
|
10259
|
+
number: node_modules_chai_inspectNumber,
|
|
10260
|
+
Number: node_modules_chai_inspectNumber,
|
|
10261
|
+
bigint: node_modules_chai_inspectBigInt,
|
|
10262
|
+
BigInt: node_modules_chai_inspectBigInt,
|
|
10263
|
+
string: node_modules_chai_inspectString,
|
|
10264
|
+
String: node_modules_chai_inspectString,
|
|
10265
|
+
function: node_modules_chai_inspectFunction,
|
|
10266
|
+
Function: node_modules_chai_inspectFunction,
|
|
10267
|
+
symbol: node_modules_chai_inspectSymbol,
|
|
10268
|
+
Symbol: node_modules_chai_inspectSymbol,
|
|
10269
|
+
Array: node_modules_chai_inspectArray,
|
|
10270
|
+
Date: node_modules_chai_inspectDate,
|
|
10271
|
+
Map: node_modules_chai_inspectMap,
|
|
10272
|
+
Set: node_modules_chai_inspectSet,
|
|
10273
|
+
RegExp: node_modules_chai_inspectRegExp,
|
|
10274
|
+
Promise: chai_promise_default,
|
|
10275
|
+
WeakSet: /* @__PURE__ */ chai_name((value, options)=>options.stylize("WeakSet{\u2026}", "special"), "WeakSet"),
|
|
10276
|
+
WeakMap: /* @__PURE__ */ chai_name((value, options)=>options.stylize("WeakMap{\u2026}", "special"), "WeakMap"),
|
|
10277
|
+
Arguments: node_modules_chai_inspectArguments,
|
|
10278
|
+
Int8Array: node_modules_chai_inspectTypedArray,
|
|
10279
|
+
Uint8Array: node_modules_chai_inspectTypedArray,
|
|
10280
|
+
Uint8ClampedArray: node_modules_chai_inspectTypedArray,
|
|
10281
|
+
Int16Array: node_modules_chai_inspectTypedArray,
|
|
10282
|
+
Uint16Array: node_modules_chai_inspectTypedArray,
|
|
10283
|
+
Int32Array: node_modules_chai_inspectTypedArray,
|
|
10284
|
+
Uint32Array: node_modules_chai_inspectTypedArray,
|
|
10285
|
+
Float32Array: node_modules_chai_inspectTypedArray,
|
|
10286
|
+
Float64Array: node_modules_chai_inspectTypedArray,
|
|
10287
|
+
Generator: /* @__PURE__ */ chai_name(()=>"", "Generator"),
|
|
10288
|
+
DataView: /* @__PURE__ */ chai_name(()=>"", "DataView"),
|
|
10289
|
+
ArrayBuffer: /* @__PURE__ */ chai_name(()=>"", "ArrayBuffer"),
|
|
10290
|
+
Error: chai_inspectObject2,
|
|
10291
|
+
HTMLCollection: node_modules_chai_inspectNodeCollection,
|
|
10292
|
+
NodeList: node_modules_chai_inspectNodeCollection
|
|
10293
|
+
};
|
|
10294
|
+
var node_modules_chai_inspectCustom = /* @__PURE__ */ chai_name((value, options, type3, inspectFn)=>{
|
|
10295
|
+
if (node_modules_chai_chaiInspect in value && "function" == typeof value[node_modules_chai_chaiInspect]) return value[node_modules_chai_chaiInspect](options);
|
|
10296
|
+
if (node_modules_chai_nodeInspect in value && "function" == typeof value[node_modules_chai_nodeInspect]) return value[node_modules_chai_nodeInspect](options.depth, options, inspectFn);
|
|
10297
|
+
if ("inspect" in value && "function" == typeof value.inspect) return value.inspect(options.depth, options);
|
|
10298
|
+
if ("constructor" in value && node_modules_chai_constructorMap.has(value.constructor)) return node_modules_chai_constructorMap.get(value.constructor)(value, options);
|
|
10299
|
+
if (node_modules_chai_stringTagMap[type3]) return node_modules_chai_stringTagMap[type3](value, options);
|
|
10300
|
+
return "";
|
|
10301
|
+
}, "inspectCustom");
|
|
10302
|
+
var node_modules_chai_toString = Object.prototype.toString;
|
|
10303
|
+
function node_modules_chai_inspect(value, opts = {}) {
|
|
10304
|
+
const options = node_modules_chai_normaliseOptions(opts, node_modules_chai_inspect);
|
|
10305
|
+
const { customInspect } = options;
|
|
10306
|
+
let type3 = null === value ? "null" : typeof value;
|
|
10307
|
+
if ("object" === type3) type3 = node_modules_chai_toString.call(value).slice(8, -1);
|
|
10308
|
+
if (type3 in node_modules_chai_baseTypesMap) return node_modules_chai_baseTypesMap[type3](value, options);
|
|
10309
|
+
if (customInspect && value) {
|
|
10310
|
+
const output = node_modules_chai_inspectCustom(value, options, type3, node_modules_chai_inspect);
|
|
10311
|
+
if (output) {
|
|
10312
|
+
if ("string" == typeof output) return output;
|
|
10313
|
+
return node_modules_chai_inspect(output, options);
|
|
10314
|
+
}
|
|
10315
|
+
}
|
|
10316
|
+
const proto = value ? Object.getPrototypeOf(value) : false;
|
|
10317
|
+
if (proto === Object.prototype || null === proto) return node_modules_chai_inspectObject(value, options);
|
|
10318
|
+
if (value && "function" == typeof HTMLElement && value instanceof HTMLElement) return node_modules_chai_inspectHTML(value, options);
|
|
10319
|
+
if ("constructor" in value) {
|
|
10320
|
+
if (value.constructor !== Object) return node_modules_chai_inspectClass(value, options);
|
|
10321
|
+
return node_modules_chai_inspectObject(value, options);
|
|
10322
|
+
}
|
|
10323
|
+
if (value === Object(value)) return node_modules_chai_inspectObject(value, options);
|
|
10324
|
+
return options.stylize(String(value), type3);
|
|
10325
|
+
}
|
|
10326
|
+
chai_name(node_modules_chai_inspect, "inspect");
|
|
10327
|
+
var node_modules_chai_config = {
|
|
10328
|
+
includeStack: false,
|
|
10329
|
+
showDiff: true,
|
|
10330
|
+
truncateThreshold: 40,
|
|
10331
|
+
useProxy: true,
|
|
10332
|
+
proxyExcludedKeys: [
|
|
10333
|
+
"then",
|
|
10334
|
+
"catch",
|
|
10335
|
+
"inspect",
|
|
10336
|
+
"toJSON"
|
|
10337
|
+
],
|
|
10338
|
+
deepEqual: null
|
|
10339
|
+
};
|
|
10340
|
+
function chai_inspect2(obj, showHidden, depth, colors) {
|
|
10341
|
+
let options = {
|
|
10342
|
+
colors,
|
|
10343
|
+
depth: void 0 === depth ? 2 : depth,
|
|
10344
|
+
showHidden,
|
|
10345
|
+
truncate: node_modules_chai_config.truncateThreshold ? node_modules_chai_config.truncateThreshold : 1 / 0
|
|
10346
|
+
};
|
|
10347
|
+
return node_modules_chai_inspect(obj, options);
|
|
10348
|
+
}
|
|
10349
|
+
chai_name(chai_inspect2, "inspect");
|
|
10350
|
+
function node_modules_chai_objDisplay(obj) {
|
|
10351
|
+
let str = chai_inspect2(obj), type3 = Object.prototype.toString.call(obj);
|
|
10352
|
+
if (!node_modules_chai_config.truncateThreshold || !(str.length >= node_modules_chai_config.truncateThreshold)) return str;
|
|
10353
|
+
if ("[object Function]" === type3) return obj.name && "" !== obj.name ? "[Function: " + obj.name + "]" : "[Function]";
|
|
10354
|
+
if ("[object Array]" === type3) return "[ Array(" + obj.length + ") ]";
|
|
10355
|
+
{
|
|
10356
|
+
if ("[object Object]" !== type3) return str;
|
|
10357
|
+
let keys = Object.keys(obj), kstr = keys.length > 2 ? keys.splice(0, 2).join(", ") + ", ..." : keys.join(", ");
|
|
10358
|
+
return "{ Object (" + kstr + ") }";
|
|
10359
|
+
}
|
|
10360
|
+
}
|
|
10361
|
+
chai_name(node_modules_chai_objDisplay, "objDisplay");
|
|
10362
|
+
function chai_getMessage2(obj, args) {
|
|
10363
|
+
let negate = chai_flag(obj, "negate");
|
|
10364
|
+
let val = chai_flag(obj, "object");
|
|
10365
|
+
let expected = args[3];
|
|
10366
|
+
let actual = chai_getActual(obj, args);
|
|
10367
|
+
let msg = negate ? args[2] : args[1];
|
|
10368
|
+
let flagMsg = chai_flag(obj, "message");
|
|
10369
|
+
if ("function" == typeof msg) msg = msg();
|
|
10370
|
+
msg = msg || "";
|
|
10371
|
+
msg = msg.replace(/#\{this\}/g, function() {
|
|
10372
|
+
return node_modules_chai_objDisplay(val);
|
|
10373
|
+
}).replace(/#\{act\}/g, function() {
|
|
10374
|
+
return node_modules_chai_objDisplay(actual);
|
|
10375
|
+
}).replace(/#\{exp\}/g, function() {
|
|
10376
|
+
return node_modules_chai_objDisplay(expected);
|
|
10377
|
+
});
|
|
10378
|
+
return flagMsg ? flagMsg + ": " + msg : msg;
|
|
10379
|
+
}
|
|
10380
|
+
chai_name(chai_getMessage2, "getMessage");
|
|
10381
|
+
function chai_transferFlags(assertion, object, includeAll) {
|
|
10382
|
+
let flags = assertion.__flags || (assertion.__flags = /* @__PURE__ */ Object.create(null));
|
|
10383
|
+
if (!object.__flags) object.__flags = /* @__PURE__ */ Object.create(null);
|
|
10384
|
+
includeAll = 3 === arguments.length ? includeAll : true;
|
|
10385
|
+
for(let flag3 in flags)if (includeAll || "object" !== flag3 && "ssfi" !== flag3 && "lockSsfi" !== flag3 && "message" != flag3) object.__flags[flag3] = flags[flag3];
|
|
10386
|
+
}
|
|
10387
|
+
chai_name(chai_transferFlags, "transferFlags");
|
|
10388
|
+
function chai_type2(obj) {
|
|
10389
|
+
if (void 0 === obj) return "undefined";
|
|
10390
|
+
if (null === obj) return "null";
|
|
10391
|
+
const stringTag = obj[Symbol.toStringTag];
|
|
10392
|
+
if ("string" == typeof stringTag) return stringTag;
|
|
10393
|
+
const sliceStart = 8;
|
|
10394
|
+
const sliceEnd = -1;
|
|
10395
|
+
return Object.prototype.toString.call(obj).slice(sliceStart, sliceEnd);
|
|
10396
|
+
}
|
|
10397
|
+
chai_name(chai_type2, "type");
|
|
10398
|
+
function chai_FakeMap() {
|
|
10399
|
+
this._key = "chai/deep-eql__" + Math.random() + Date.now();
|
|
10400
|
+
}
|
|
10401
|
+
chai_name(chai_FakeMap, "FakeMap");
|
|
10402
|
+
chai_FakeMap.prototype = {
|
|
10403
|
+
get: /* @__PURE__ */ chai_name(function get(key) {
|
|
10404
|
+
return key[this._key];
|
|
10405
|
+
}, "get"),
|
|
10406
|
+
set: /* @__PURE__ */ chai_name(function set(key, value) {
|
|
10407
|
+
if (Object.isExtensible(key)) Object.defineProperty(key, this._key, {
|
|
10408
|
+
value,
|
|
10409
|
+
configurable: true
|
|
10410
|
+
});
|
|
10411
|
+
}, "set")
|
|
10412
|
+
};
|
|
10413
|
+
var chai_MemoizeMap = "function" == typeof WeakMap ? WeakMap : chai_FakeMap;
|
|
10414
|
+
function chai_memoizeCompare(leftHandOperand, rightHandOperand, memoizeMap) {
|
|
10415
|
+
if (!memoizeMap || node_modules_chai_isPrimitive(leftHandOperand) || node_modules_chai_isPrimitive(rightHandOperand)) return null;
|
|
10416
|
+
var leftHandMap = memoizeMap.get(leftHandOperand);
|
|
10417
|
+
if (leftHandMap) {
|
|
10418
|
+
var result = leftHandMap.get(rightHandOperand);
|
|
10419
|
+
if ("boolean" == typeof result) return result;
|
|
10420
|
+
}
|
|
10421
|
+
return null;
|
|
10422
|
+
}
|
|
10423
|
+
chai_name(chai_memoizeCompare, "memoizeCompare");
|
|
10424
|
+
function chai_memoizeSet(leftHandOperand, rightHandOperand, memoizeMap, result) {
|
|
10425
|
+
if (!memoizeMap || node_modules_chai_isPrimitive(leftHandOperand) || node_modules_chai_isPrimitive(rightHandOperand)) return;
|
|
10426
|
+
var leftHandMap = memoizeMap.get(leftHandOperand);
|
|
10427
|
+
if (leftHandMap) leftHandMap.set(rightHandOperand, result);
|
|
10428
|
+
else {
|
|
10429
|
+
leftHandMap = new chai_MemoizeMap();
|
|
10430
|
+
leftHandMap.set(rightHandOperand, result);
|
|
10431
|
+
memoizeMap.set(leftHandOperand, leftHandMap);
|
|
10432
|
+
}
|
|
10433
|
+
}
|
|
10434
|
+
chai_name(chai_memoizeSet, "memoizeSet");
|
|
10435
|
+
var chai_deep_eql_default = chai_deepEqual;
|
|
10436
|
+
function chai_deepEqual(leftHandOperand, rightHandOperand, options) {
|
|
10437
|
+
if (options && options.comparator) return chai_extensiveDeepEqual(leftHandOperand, rightHandOperand, options);
|
|
10438
|
+
var simpleResult = chai_simpleEqual(leftHandOperand, rightHandOperand);
|
|
10439
|
+
if (null !== simpleResult) return simpleResult;
|
|
10440
|
+
return chai_extensiveDeepEqual(leftHandOperand, rightHandOperand, options);
|
|
10441
|
+
}
|
|
10442
|
+
chai_name(chai_deepEqual, "deepEqual");
|
|
10443
|
+
function chai_simpleEqual(leftHandOperand, rightHandOperand) {
|
|
10444
|
+
if (leftHandOperand === rightHandOperand) return 0 !== leftHandOperand || 1 / leftHandOperand === 1 / rightHandOperand;
|
|
10445
|
+
if (leftHandOperand !== leftHandOperand && rightHandOperand !== rightHandOperand) return true;
|
|
10446
|
+
if (node_modules_chai_isPrimitive(leftHandOperand) || node_modules_chai_isPrimitive(rightHandOperand)) return false;
|
|
10447
|
+
return null;
|
|
10448
|
+
}
|
|
10449
|
+
chai_name(chai_simpleEqual, "simpleEqual");
|
|
10450
|
+
function chai_extensiveDeepEqual(leftHandOperand, rightHandOperand, options) {
|
|
10451
|
+
options = options || {};
|
|
10452
|
+
options.memoize = false === options.memoize ? false : options.memoize || new chai_MemoizeMap();
|
|
10453
|
+
var comparator = options && options.comparator;
|
|
10454
|
+
var memoizeResultLeft = chai_memoizeCompare(leftHandOperand, rightHandOperand, options.memoize);
|
|
10455
|
+
if (null !== memoizeResultLeft) return memoizeResultLeft;
|
|
10456
|
+
var memoizeResultRight = chai_memoizeCompare(rightHandOperand, leftHandOperand, options.memoize);
|
|
10457
|
+
if (null !== memoizeResultRight) return memoizeResultRight;
|
|
10458
|
+
if (comparator) {
|
|
10459
|
+
var comparatorResult = comparator(leftHandOperand, rightHandOperand);
|
|
10460
|
+
if (false === comparatorResult || true === comparatorResult) {
|
|
10461
|
+
chai_memoizeSet(leftHandOperand, rightHandOperand, options.memoize, comparatorResult);
|
|
10462
|
+
return comparatorResult;
|
|
10463
|
+
}
|
|
10464
|
+
var simpleResult = chai_simpleEqual(leftHandOperand, rightHandOperand);
|
|
10465
|
+
if (null !== simpleResult) return simpleResult;
|
|
10466
|
+
}
|
|
10467
|
+
var leftHandType = chai_type2(leftHandOperand);
|
|
10468
|
+
if (leftHandType !== chai_type2(rightHandOperand)) {
|
|
10469
|
+
chai_memoizeSet(leftHandOperand, rightHandOperand, options.memoize, false);
|
|
10470
|
+
return false;
|
|
10471
|
+
}
|
|
10472
|
+
chai_memoizeSet(leftHandOperand, rightHandOperand, options.memoize, true);
|
|
10473
|
+
var result = chai_extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options);
|
|
10474
|
+
chai_memoizeSet(leftHandOperand, rightHandOperand, options.memoize, result);
|
|
10475
|
+
return result;
|
|
10476
|
+
}
|
|
10477
|
+
chai_name(chai_extensiveDeepEqual, "extensiveDeepEqual");
|
|
10478
|
+
function chai_extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options) {
|
|
10479
|
+
switch(leftHandType){
|
|
10480
|
+
case "String":
|
|
10481
|
+
case "Number":
|
|
10482
|
+
case "Boolean":
|
|
10483
|
+
case "Date":
|
|
10484
|
+
return chai_deepEqual(leftHandOperand.valueOf(), rightHandOperand.valueOf());
|
|
10485
|
+
case "Promise":
|
|
10486
|
+
case "Symbol":
|
|
10487
|
+
case "function":
|
|
10488
|
+
case "WeakMap":
|
|
10489
|
+
case "WeakSet":
|
|
10490
|
+
return leftHandOperand === rightHandOperand;
|
|
10491
|
+
case "Error":
|
|
10492
|
+
return chai_keysEqual(leftHandOperand, rightHandOperand, [
|
|
10493
|
+
"name",
|
|
10494
|
+
"message",
|
|
10495
|
+
"code"
|
|
10496
|
+
], options);
|
|
10497
|
+
case "Arguments":
|
|
10498
|
+
case "Int8Array":
|
|
10499
|
+
case "Uint8Array":
|
|
10500
|
+
case "Uint8ClampedArray":
|
|
10501
|
+
case "Int16Array":
|
|
10502
|
+
case "Uint16Array":
|
|
10503
|
+
case "Int32Array":
|
|
10504
|
+
case "Uint32Array":
|
|
10505
|
+
case "Float32Array":
|
|
10506
|
+
case "Float64Array":
|
|
10507
|
+
case "Array":
|
|
10508
|
+
return chai_iterableEqual(leftHandOperand, rightHandOperand, options);
|
|
10509
|
+
case "RegExp":
|
|
10510
|
+
return chai_regexpEqual(leftHandOperand, rightHandOperand);
|
|
10511
|
+
case "Generator":
|
|
10512
|
+
return chai_generatorEqual(leftHandOperand, rightHandOperand, options);
|
|
10513
|
+
case "DataView":
|
|
10514
|
+
return chai_iterableEqual(new Uint8Array(leftHandOperand.buffer), new Uint8Array(rightHandOperand.buffer), options);
|
|
10515
|
+
case "ArrayBuffer":
|
|
10516
|
+
return chai_iterableEqual(new Uint8Array(leftHandOperand), new Uint8Array(rightHandOperand), options);
|
|
10517
|
+
case "Set":
|
|
10518
|
+
return chai_entriesEqual(leftHandOperand, rightHandOperand, options);
|
|
10519
|
+
case "Map":
|
|
10520
|
+
return chai_entriesEqual(leftHandOperand, rightHandOperand, options);
|
|
10521
|
+
case "Temporal.PlainDate":
|
|
10522
|
+
case "Temporal.PlainTime":
|
|
10523
|
+
case "Temporal.PlainDateTime":
|
|
10524
|
+
case "Temporal.Instant":
|
|
10525
|
+
case "Temporal.ZonedDateTime":
|
|
10526
|
+
case "Temporal.PlainYearMonth":
|
|
10527
|
+
case "Temporal.PlainMonthDay":
|
|
10528
|
+
return leftHandOperand.equals(rightHandOperand);
|
|
10529
|
+
case "Temporal.Duration":
|
|
10530
|
+
return leftHandOperand.total("nanoseconds") === rightHandOperand.total("nanoseconds");
|
|
10531
|
+
case "Temporal.TimeZone":
|
|
10532
|
+
case "Temporal.Calendar":
|
|
10533
|
+
return leftHandOperand.toString() === rightHandOperand.toString();
|
|
10534
|
+
default:
|
|
10535
|
+
return chai_objectEqual(leftHandOperand, rightHandOperand, options);
|
|
10536
|
+
}
|
|
10537
|
+
}
|
|
10538
|
+
chai_name(chai_extensiveDeepEqualByType, "extensiveDeepEqualByType");
|
|
10539
|
+
function chai_regexpEqual(leftHandOperand, rightHandOperand) {
|
|
10540
|
+
return leftHandOperand.toString() === rightHandOperand.toString();
|
|
10541
|
+
}
|
|
10542
|
+
chai_name(chai_regexpEqual, "regexpEqual");
|
|
10543
|
+
function chai_entriesEqual(leftHandOperand, rightHandOperand, options) {
|
|
10544
|
+
try {
|
|
10545
|
+
if (leftHandOperand.size !== rightHandOperand.size) return false;
|
|
10546
|
+
if (0 === leftHandOperand.size) return true;
|
|
10547
|
+
} catch (sizeError) {
|
|
10548
|
+
return false;
|
|
10549
|
+
}
|
|
10550
|
+
var leftHandItems = [];
|
|
10551
|
+
var rightHandItems = [];
|
|
10552
|
+
leftHandOperand.forEach(/* @__PURE__ */ chai_name(function gatherEntries(key, value) {
|
|
10553
|
+
leftHandItems.push([
|
|
10554
|
+
key,
|
|
10555
|
+
value
|
|
10556
|
+
]);
|
|
10557
|
+
}, "gatherEntries"));
|
|
10558
|
+
rightHandOperand.forEach(/* @__PURE__ */ chai_name(function gatherEntries(key, value) {
|
|
10559
|
+
rightHandItems.push([
|
|
10560
|
+
key,
|
|
10561
|
+
value
|
|
10562
|
+
]);
|
|
10563
|
+
}, "gatherEntries"));
|
|
10564
|
+
return chai_iterableEqual(leftHandItems.sort(), rightHandItems.sort(), options);
|
|
10565
|
+
}
|
|
10566
|
+
chai_name(chai_entriesEqual, "entriesEqual");
|
|
10567
|
+
function chai_iterableEqual(leftHandOperand, rightHandOperand, options) {
|
|
10568
|
+
var length = leftHandOperand.length;
|
|
10569
|
+
if (length !== rightHandOperand.length) return false;
|
|
10570
|
+
if (0 === length) return true;
|
|
10571
|
+
var index = -1;
|
|
10572
|
+
while(++index < length)if (false === chai_deepEqual(leftHandOperand[index], rightHandOperand[index], options)) return false;
|
|
10573
|
+
return true;
|
|
10574
|
+
}
|
|
10575
|
+
chai_name(chai_iterableEqual, "iterableEqual");
|
|
10576
|
+
function chai_generatorEqual(leftHandOperand, rightHandOperand, options) {
|
|
10577
|
+
return chai_iterableEqual(chai_getGeneratorEntries(leftHandOperand), chai_getGeneratorEntries(rightHandOperand), options);
|
|
10578
|
+
}
|
|
10579
|
+
chai_name(chai_generatorEqual, "generatorEqual");
|
|
10580
|
+
function chai_hasIteratorFunction(target) {
|
|
10581
|
+
return "u" > typeof Symbol && "object" == typeof target && void 0 !== Symbol.iterator && "function" == typeof target[Symbol.iterator];
|
|
10582
|
+
}
|
|
10583
|
+
chai_name(chai_hasIteratorFunction, "hasIteratorFunction");
|
|
10584
|
+
function chai_getIteratorEntries(target) {
|
|
10585
|
+
if (chai_hasIteratorFunction(target)) try {
|
|
10586
|
+
return chai_getGeneratorEntries(target[Symbol.iterator]());
|
|
10587
|
+
} catch (iteratorError) {}
|
|
10588
|
+
return [];
|
|
10589
|
+
}
|
|
10590
|
+
chai_name(chai_getIteratorEntries, "getIteratorEntries");
|
|
10591
|
+
function chai_getGeneratorEntries(generator) {
|
|
10592
|
+
var generatorResult = generator.next();
|
|
10593
|
+
var accumulator = [
|
|
10594
|
+
generatorResult.value
|
|
10595
|
+
];
|
|
10596
|
+
while(false === generatorResult.done){
|
|
10597
|
+
generatorResult = generator.next();
|
|
10598
|
+
accumulator.push(generatorResult.value);
|
|
10599
|
+
}
|
|
10600
|
+
return accumulator;
|
|
10601
|
+
}
|
|
10602
|
+
chai_name(chai_getGeneratorEntries, "getGeneratorEntries");
|
|
10603
|
+
function chai_getEnumerableKeys(target) {
|
|
10604
|
+
var keys = [];
|
|
10605
|
+
for(var key in target)keys.push(key);
|
|
10606
|
+
return keys;
|
|
10607
|
+
}
|
|
10608
|
+
chai_name(chai_getEnumerableKeys, "getEnumerableKeys");
|
|
10609
|
+
function chai_getEnumerableSymbols(target) {
|
|
10610
|
+
var keys = [];
|
|
10611
|
+
var allKeys = Object.getOwnPropertySymbols(target);
|
|
10612
|
+
for(var i = 0; i < allKeys.length; i += 1){
|
|
10613
|
+
var key = allKeys[i];
|
|
10614
|
+
if (Object.getOwnPropertyDescriptor(target, key).enumerable) keys.push(key);
|
|
10615
|
+
}
|
|
10616
|
+
return keys;
|
|
10617
|
+
}
|
|
10618
|
+
chai_name(chai_getEnumerableSymbols, "getEnumerableSymbols");
|
|
10619
|
+
function chai_keysEqual(leftHandOperand, rightHandOperand, keys, options) {
|
|
10620
|
+
var length = keys.length;
|
|
10621
|
+
if (0 === length) return true;
|
|
10622
|
+
for(var i = 0; i < length; i += 1)if (false === chai_deepEqual(leftHandOperand[keys[i]], rightHandOperand[keys[i]], options)) return false;
|
|
10623
|
+
return true;
|
|
10624
|
+
}
|
|
10625
|
+
chai_name(chai_keysEqual, "keysEqual");
|
|
10626
|
+
function chai_objectEqual(leftHandOperand, rightHandOperand, options) {
|
|
10627
|
+
var leftHandKeys = chai_getEnumerableKeys(leftHandOperand);
|
|
10628
|
+
var rightHandKeys = chai_getEnumerableKeys(rightHandOperand);
|
|
10629
|
+
var leftHandSymbols = chai_getEnumerableSymbols(leftHandOperand);
|
|
10630
|
+
var rightHandSymbols = chai_getEnumerableSymbols(rightHandOperand);
|
|
10631
|
+
leftHandKeys = leftHandKeys.concat(leftHandSymbols);
|
|
10632
|
+
rightHandKeys = rightHandKeys.concat(rightHandSymbols);
|
|
10633
|
+
if (leftHandKeys.length && leftHandKeys.length === rightHandKeys.length) {
|
|
10634
|
+
if (false === chai_iterableEqual(chai_mapSymbols(leftHandKeys).sort(), chai_mapSymbols(rightHandKeys).sort())) return false;
|
|
10635
|
+
return chai_keysEqual(leftHandOperand, rightHandOperand, leftHandKeys, options);
|
|
10636
|
+
}
|
|
10637
|
+
var leftHandEntries = chai_getIteratorEntries(leftHandOperand);
|
|
10638
|
+
var rightHandEntries = chai_getIteratorEntries(rightHandOperand);
|
|
10639
|
+
if (leftHandEntries.length && leftHandEntries.length === rightHandEntries.length) {
|
|
10640
|
+
leftHandEntries.sort();
|
|
10641
|
+
rightHandEntries.sort();
|
|
10642
|
+
return chai_iterableEqual(leftHandEntries, rightHandEntries, options);
|
|
10643
|
+
}
|
|
10644
|
+
if (0 === leftHandKeys.length && 0 === leftHandEntries.length && 0 === rightHandKeys.length && 0 === rightHandEntries.length) return true;
|
|
10645
|
+
return false;
|
|
10646
|
+
}
|
|
10647
|
+
chai_name(chai_objectEqual, "objectEqual");
|
|
10648
|
+
function node_modules_chai_isPrimitive(value) {
|
|
10649
|
+
return null === value || "object" != typeof value;
|
|
10650
|
+
}
|
|
10651
|
+
chai_name(node_modules_chai_isPrimitive, "isPrimitive");
|
|
10652
|
+
function chai_mapSymbols(arr) {
|
|
10653
|
+
return arr.map(/* @__PURE__ */ chai_name(function mapSymbol(entry) {
|
|
10654
|
+
if ("symbol" == typeof entry) return entry.toString();
|
|
10655
|
+
return entry;
|
|
10656
|
+
}, "mapSymbol"));
|
|
10657
|
+
}
|
|
10658
|
+
chai_name(chai_mapSymbols, "mapSymbols");
|
|
10659
|
+
function chai_hasProperty(obj, name) {
|
|
10660
|
+
if (null == obj) return false;
|
|
10661
|
+
return name in Object(obj);
|
|
10662
|
+
}
|
|
10663
|
+
chai_name(chai_hasProperty, "hasProperty");
|
|
10664
|
+
function chai_parsePath(path) {
|
|
10665
|
+
const str = path.replace(/([^\\])\[/g, "$1.[");
|
|
10666
|
+
const parts = str.match(/(\\\.|[^.]+?)+/g);
|
|
10667
|
+
return parts.map((value)=>{
|
|
10668
|
+
if ("constructor" === value || "__proto__" === value || "prototype" === value) return {};
|
|
10669
|
+
const regexp = /^\[(\d+)\]$/;
|
|
10670
|
+
const mArr = regexp.exec(value);
|
|
10671
|
+
let parsed = null;
|
|
10672
|
+
parsed = mArr ? {
|
|
10673
|
+
i: parseFloat(mArr[1])
|
|
10674
|
+
} : {
|
|
10675
|
+
p: value.replace(/\\([.[\]])/g, "$1")
|
|
10676
|
+
};
|
|
10677
|
+
return parsed;
|
|
10678
|
+
});
|
|
10679
|
+
}
|
|
10680
|
+
chai_name(chai_parsePath, "parsePath");
|
|
10681
|
+
function chai_internalGetPathValue(obj, parsed, pathDepth) {
|
|
10682
|
+
let temporaryValue = obj;
|
|
10683
|
+
let res = null;
|
|
10684
|
+
pathDepth = void 0 === pathDepth ? parsed.length : pathDepth;
|
|
10685
|
+
for(let i = 0; i < pathDepth; i++){
|
|
10686
|
+
const part = parsed[i];
|
|
10687
|
+
if (temporaryValue) {
|
|
10688
|
+
temporaryValue = void 0 === part.p ? temporaryValue[part.i] : temporaryValue[part.p];
|
|
10689
|
+
if (i === pathDepth - 1) res = temporaryValue;
|
|
10690
|
+
}
|
|
10691
|
+
}
|
|
10692
|
+
return res;
|
|
10693
|
+
}
|
|
10694
|
+
chai_name(chai_internalGetPathValue, "internalGetPathValue");
|
|
10695
|
+
function chai_getPathInfo(obj, path) {
|
|
10696
|
+
const parsed = chai_parsePath(path);
|
|
10697
|
+
const last = parsed[parsed.length - 1];
|
|
10698
|
+
const info = {
|
|
10699
|
+
parent: parsed.length > 1 ? chai_internalGetPathValue(obj, parsed, parsed.length - 1) : obj,
|
|
10700
|
+
name: last.p || last.i,
|
|
10701
|
+
value: chai_internalGetPathValue(obj, parsed)
|
|
10702
|
+
};
|
|
10703
|
+
info.exists = chai_hasProperty(info.parent, info.name);
|
|
10704
|
+
return info;
|
|
10705
|
+
}
|
|
10706
|
+
chai_name(chai_getPathInfo, "getPathInfo");
|
|
10707
|
+
var chai_Assertion = class _Assertion {
|
|
10708
|
+
constructor(obj, msg, ssfi, lockSsfi){
|
|
10709
|
+
__publicField(this, "__flags", {});
|
|
10710
|
+
chai_flag(this, "ssfi", ssfi || _Assertion);
|
|
10711
|
+
chai_flag(this, "lockSsfi", lockSsfi);
|
|
10712
|
+
chai_flag(this, "object", obj);
|
|
10713
|
+
chai_flag(this, "message", msg);
|
|
10714
|
+
chai_flag(this, "eql", node_modules_chai_config.deepEqual || chai_deep_eql_default);
|
|
10715
|
+
return chai_proxify(this);
|
|
10716
|
+
}
|
|
10717
|
+
static get includeStack() {
|
|
10718
|
+
console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead.");
|
|
10719
|
+
return node_modules_chai_config.includeStack;
|
|
10720
|
+
}
|
|
10721
|
+
static set includeStack(value) {
|
|
10722
|
+
console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead.");
|
|
10723
|
+
node_modules_chai_config.includeStack = value;
|
|
10724
|
+
}
|
|
10725
|
+
static get showDiff() {
|
|
10726
|
+
console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead.");
|
|
10727
|
+
return node_modules_chai_config.showDiff;
|
|
10728
|
+
}
|
|
10729
|
+
static set showDiff(value) {
|
|
10730
|
+
console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead.");
|
|
10731
|
+
node_modules_chai_config.showDiff = value;
|
|
10732
|
+
}
|
|
10733
|
+
static addProperty(name, fn) {
|
|
10734
|
+
chai_addProperty(this.prototype, name, fn);
|
|
10735
|
+
}
|
|
10736
|
+
static addMethod(name, fn) {
|
|
10737
|
+
node_modules_chai_addMethod(this.prototype, name, fn);
|
|
10738
|
+
}
|
|
10739
|
+
static addChainableMethod(name, fn, chainingBehavior) {
|
|
10740
|
+
chai_addChainableMethod(this.prototype, name, fn, chainingBehavior);
|
|
10741
|
+
}
|
|
10742
|
+
static overwriteProperty(name, fn) {
|
|
10743
|
+
chai_overwriteProperty(this.prototype, name, fn);
|
|
10744
|
+
}
|
|
10745
|
+
static overwriteMethod(name, fn) {
|
|
10746
|
+
chai_overwriteMethod(this.prototype, name, fn);
|
|
10747
|
+
}
|
|
10748
|
+
static overwriteChainableMethod(name, fn, chainingBehavior) {
|
|
10749
|
+
chai_overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
|
|
10750
|
+
}
|
|
10751
|
+
assert(_expr, msg, _negateMsg, expected, _actual, showDiff) {
|
|
10752
|
+
const ok = node_modules_chai_test(this, arguments);
|
|
10753
|
+
if (false !== showDiff) showDiff = true;
|
|
10754
|
+
if (void 0 === expected && void 0 === _actual) showDiff = false;
|
|
10755
|
+
if (true !== node_modules_chai_config.showDiff) showDiff = false;
|
|
10756
|
+
if (!ok) {
|
|
10757
|
+
msg = chai_getMessage2(this, arguments);
|
|
10758
|
+
const actual = chai_getActual(this, arguments);
|
|
10759
|
+
const assertionErrorObjectProperties = {
|
|
10760
|
+
actual,
|
|
10761
|
+
expected,
|
|
10762
|
+
showDiff
|
|
10763
|
+
};
|
|
10764
|
+
const operator = chai_getOperator(this, arguments);
|
|
10765
|
+
if (operator) assertionErrorObjectProperties.operator = operator;
|
|
10766
|
+
throw new chai_6_2_2_node_modules_chai_AssertionError(msg, assertionErrorObjectProperties, node_modules_chai_config.includeStack ? this.assert : chai_flag(this, "ssfi"));
|
|
10767
|
+
}
|
|
10768
|
+
}
|
|
10769
|
+
get _obj() {
|
|
10770
|
+
return chai_flag(this, "object");
|
|
10771
|
+
}
|
|
10772
|
+
set _obj(val) {
|
|
10773
|
+
chai_flag(this, "object", val);
|
|
10774
|
+
}
|
|
10775
|
+
};
|
|
10776
|
+
chai_name(chai_Assertion, "Assertion");
|
|
10777
|
+
var node_modules_chai_Assertion = chai_Assertion;
|
|
10778
|
+
var events = new EventTarget();
|
|
10779
|
+
var chai_PluginEvent = class extends Event {
|
|
10780
|
+
constructor(type3, name, fn){
|
|
10781
|
+
super(type3);
|
|
10782
|
+
this.name = String(name);
|
|
10783
|
+
this.fn = fn;
|
|
10784
|
+
}
|
|
10785
|
+
};
|
|
10786
|
+
chai_name(chai_PluginEvent, "PluginEvent");
|
|
10787
|
+
var PluginEvent = chai_PluginEvent;
|
|
10788
|
+
function chai_isProxyEnabled() {
|
|
10789
|
+
return node_modules_chai_config.useProxy && "u" > typeof Proxy && "u" > typeof Reflect;
|
|
10790
|
+
}
|
|
10791
|
+
chai_name(chai_isProxyEnabled, "isProxyEnabled");
|
|
10792
|
+
function chai_addProperty(ctx, name, getter) {
|
|
10793
|
+
getter = void 0 === getter ? function() {} : getter;
|
|
10794
|
+
Object.defineProperty(ctx, name, {
|
|
10795
|
+
get: /* @__PURE__ */ chai_name(function propertyGetter() {
|
|
10796
|
+
if (!chai_isProxyEnabled() && !chai_flag(this, "lockSsfi")) chai_flag(this, "ssfi", propertyGetter);
|
|
10797
|
+
let result = getter.call(this);
|
|
10798
|
+
if (void 0 !== result) return result;
|
|
10799
|
+
let newAssertion = new node_modules_chai_Assertion();
|
|
10800
|
+
chai_transferFlags(this, newAssertion);
|
|
10801
|
+
return newAssertion;
|
|
10802
|
+
}, "propertyGetter"),
|
|
10803
|
+
configurable: true
|
|
10804
|
+
});
|
|
10805
|
+
events.dispatchEvent(new PluginEvent("addProperty", name, getter));
|
|
10806
|
+
}
|
|
10807
|
+
chai_name(chai_addProperty, "addProperty");
|
|
10808
|
+
var chai_fnLengthDesc = Object.getOwnPropertyDescriptor(function() {}, "length");
|
|
10809
|
+
function chai_addLengthGuard(fn, assertionName, isChainable) {
|
|
10810
|
+
if (!chai_fnLengthDesc.configurable) return fn;
|
|
10811
|
+
Object.defineProperty(fn, "length", {
|
|
10812
|
+
get: /* @__PURE__ */ chai_name(function() {
|
|
10813
|
+
if (isChainable) throw Error("Invalid Chai property: " + assertionName + '.length. Due to a compatibility issue, "length" cannot directly follow "' + assertionName + '". Use "' + assertionName + '.lengthOf" instead.');
|
|
10814
|
+
throw Error("Invalid Chai property: " + assertionName + '.length. See docs for proper usage of "' + assertionName + '".');
|
|
10815
|
+
}, "get")
|
|
10816
|
+
});
|
|
10817
|
+
return fn;
|
|
10818
|
+
}
|
|
10819
|
+
chai_name(chai_addLengthGuard, "addLengthGuard");
|
|
10820
|
+
function chai_getProperties(object) {
|
|
10821
|
+
let result = Object.getOwnPropertyNames(object);
|
|
10822
|
+
function addProperty2(property) {
|
|
10823
|
+
if (-1 === result.indexOf(property)) result.push(property);
|
|
10824
|
+
}
|
|
10825
|
+
chai_name(addProperty2, "addProperty");
|
|
10826
|
+
let proto = Object.getPrototypeOf(object);
|
|
10827
|
+
while(null !== proto){
|
|
10828
|
+
Object.getOwnPropertyNames(proto).forEach(addProperty2);
|
|
10829
|
+
proto = Object.getPrototypeOf(proto);
|
|
10830
|
+
}
|
|
10831
|
+
return result;
|
|
10832
|
+
}
|
|
10833
|
+
chai_name(chai_getProperties, "getProperties");
|
|
10834
|
+
var chai_builtins = [
|
|
10835
|
+
"__flags",
|
|
10836
|
+
"__methods",
|
|
10837
|
+
"_obj",
|
|
10838
|
+
"assert"
|
|
10839
|
+
];
|
|
10840
|
+
function chai_proxify(obj, nonChainableMethodName) {
|
|
10841
|
+
if (!chai_isProxyEnabled()) return obj;
|
|
10842
|
+
return new Proxy(obj, {
|
|
10843
|
+
get: /* @__PURE__ */ chai_name(function proxyGetter(target, property) {
|
|
10844
|
+
if ("string" == typeof property && -1 === node_modules_chai_config.proxyExcludedKeys.indexOf(property) && !Reflect.has(target, property)) {
|
|
10845
|
+
if (nonChainableMethodName) throw Error("Invalid Chai property: " + nonChainableMethodName + "." + property + '. See docs for proper usage of "' + nonChainableMethodName + '".');
|
|
10846
|
+
let suggestion = null;
|
|
10847
|
+
let suggestionDistance = 4;
|
|
10848
|
+
chai_getProperties(target).forEach(function(prop) {
|
|
10849
|
+
if (!Object.prototype.hasOwnProperty(prop) && -1 === chai_builtins.indexOf(prop)) {
|
|
10850
|
+
let dist = chai_stringDistanceCapped(property, prop, suggestionDistance);
|
|
10851
|
+
if (dist < suggestionDistance) {
|
|
10852
|
+
suggestion = prop;
|
|
10853
|
+
suggestionDistance = dist;
|
|
10854
|
+
}
|
|
10855
|
+
}
|
|
10856
|
+
});
|
|
10857
|
+
if (null !== suggestion) throw Error("Invalid Chai property: " + property + '. Did you mean "' + suggestion + '"?');
|
|
10858
|
+
throw Error("Invalid Chai property: " + property);
|
|
10859
|
+
}
|
|
10860
|
+
if (-1 === chai_builtins.indexOf(property) && !chai_flag(target, "lockSsfi")) chai_flag(target, "ssfi", proxyGetter);
|
|
10861
|
+
return Reflect.get(target, property);
|
|
10862
|
+
}, "proxyGetter")
|
|
10863
|
+
});
|
|
10864
|
+
}
|
|
10865
|
+
chai_name(chai_proxify, "proxify");
|
|
10866
|
+
function chai_stringDistanceCapped(strA, strB, cap) {
|
|
10867
|
+
if (Math.abs(strA.length - strB.length) >= cap) return cap;
|
|
10868
|
+
let memo = [];
|
|
10869
|
+
for(let i = 0; i <= strA.length; i++){
|
|
10870
|
+
memo[i] = Array(strB.length + 1).fill(0);
|
|
10871
|
+
memo[i][0] = i;
|
|
10872
|
+
}
|
|
10873
|
+
for(let j = 0; j < strB.length; j++)memo[0][j] = j;
|
|
10874
|
+
for(let i = 1; i <= strA.length; i++){
|
|
10875
|
+
let ch = strA.charCodeAt(i - 1);
|
|
10876
|
+
for(let j = 1; j <= strB.length; j++){
|
|
10877
|
+
if (Math.abs(i - j) >= cap) {
|
|
10878
|
+
memo[i][j] = cap;
|
|
10879
|
+
continue;
|
|
10880
|
+
}
|
|
10881
|
+
memo[i][j] = Math.min(memo[i - 1][j] + 1, memo[i][j - 1] + 1, memo[i - 1][j - 1] + (ch === strB.charCodeAt(j - 1) ? 0 : 1));
|
|
10882
|
+
}
|
|
10883
|
+
}
|
|
10884
|
+
return memo[strA.length][strB.length];
|
|
10885
|
+
}
|
|
10886
|
+
chai_name(chai_stringDistanceCapped, "stringDistanceCapped");
|
|
10887
|
+
function node_modules_chai_addMethod(ctx, name, method) {
|
|
10888
|
+
let methodWrapper = /* @__PURE__ */ chai_name(function() {
|
|
10889
|
+
if (!chai_flag(this, "lockSsfi")) chai_flag(this, "ssfi", methodWrapper);
|
|
10890
|
+
let result = method.apply(this, arguments);
|
|
10891
|
+
if (void 0 !== result) return result;
|
|
10892
|
+
let newAssertion = new node_modules_chai_Assertion();
|
|
10893
|
+
chai_transferFlags(this, newAssertion);
|
|
10894
|
+
return newAssertion;
|
|
10895
|
+
}, "methodWrapper");
|
|
10896
|
+
chai_addLengthGuard(methodWrapper, name, false);
|
|
10897
|
+
ctx[name] = chai_proxify(methodWrapper, name);
|
|
10898
|
+
events.dispatchEvent(new PluginEvent("addMethod", name, method));
|
|
10899
|
+
}
|
|
10900
|
+
chai_name(node_modules_chai_addMethod, "addMethod");
|
|
10901
|
+
function chai_overwriteProperty(ctx, name, getter) {
|
|
10902
|
+
let _get = Object.getOwnPropertyDescriptor(ctx, name), _super = /* @__PURE__ */ chai_name(function() {}, "_super");
|
|
10903
|
+
if (_get && "function" == typeof _get.get) _super = _get.get;
|
|
10904
|
+
Object.defineProperty(ctx, name, {
|
|
10905
|
+
get: /* @__PURE__ */ chai_name(function overwritingPropertyGetter() {
|
|
10906
|
+
if (!chai_isProxyEnabled() && !chai_flag(this, "lockSsfi")) chai_flag(this, "ssfi", overwritingPropertyGetter);
|
|
10907
|
+
let origLockSsfi = chai_flag(this, "lockSsfi");
|
|
10908
|
+
chai_flag(this, "lockSsfi", true);
|
|
10909
|
+
let result = getter(_super).call(this);
|
|
10910
|
+
chai_flag(this, "lockSsfi", origLockSsfi);
|
|
10911
|
+
if (void 0 !== result) return result;
|
|
10912
|
+
let newAssertion = new node_modules_chai_Assertion();
|
|
10913
|
+
chai_transferFlags(this, newAssertion);
|
|
10914
|
+
return newAssertion;
|
|
10915
|
+
}, "overwritingPropertyGetter"),
|
|
10916
|
+
configurable: true
|
|
10917
|
+
});
|
|
10918
|
+
}
|
|
10919
|
+
chai_name(chai_overwriteProperty, "overwriteProperty");
|
|
10920
|
+
function chai_overwriteMethod(ctx, name, method) {
|
|
10921
|
+
let _method = ctx[name], _super = /* @__PURE__ */ chai_name(function() {
|
|
10922
|
+
throw new Error(name + " is not a function");
|
|
10923
|
+
}, "_super");
|
|
10924
|
+
if (_method && "function" == typeof _method) _super = _method;
|
|
10925
|
+
let overwritingMethodWrapper = /* @__PURE__ */ chai_name(function() {
|
|
10926
|
+
if (!chai_flag(this, "lockSsfi")) chai_flag(this, "ssfi", overwritingMethodWrapper);
|
|
10927
|
+
let origLockSsfi = chai_flag(this, "lockSsfi");
|
|
10928
|
+
chai_flag(this, "lockSsfi", true);
|
|
10929
|
+
let result = method(_super).apply(this, arguments);
|
|
10930
|
+
chai_flag(this, "lockSsfi", origLockSsfi);
|
|
10931
|
+
if (void 0 !== result) return result;
|
|
10932
|
+
let newAssertion = new node_modules_chai_Assertion();
|
|
10933
|
+
chai_transferFlags(this, newAssertion);
|
|
10934
|
+
return newAssertion;
|
|
10935
|
+
}, "overwritingMethodWrapper");
|
|
10936
|
+
chai_addLengthGuard(overwritingMethodWrapper, name, false);
|
|
10937
|
+
ctx[name] = chai_proxify(overwritingMethodWrapper, name);
|
|
10938
|
+
}
|
|
10939
|
+
chai_name(chai_overwriteMethod, "overwriteMethod");
|
|
10940
|
+
var chai_canSetPrototype = "function" == typeof Object.setPrototypeOf;
|
|
10941
|
+
var node_modules_chai_testFn = /* @__PURE__ */ chai_name(function() {}, "testFn");
|
|
10942
|
+
var chai_excludeNames = Object.getOwnPropertyNames(node_modules_chai_testFn).filter(function(name) {
|
|
10943
|
+
let propDesc = Object.getOwnPropertyDescriptor(node_modules_chai_testFn, name);
|
|
10944
|
+
if ("object" != typeof propDesc) return true;
|
|
10945
|
+
return !propDesc.configurable;
|
|
10946
|
+
});
|
|
10947
|
+
var chai_call = Function.prototype.call;
|
|
10948
|
+
var chai_apply = Function.prototype.apply;
|
|
10949
|
+
var chai_PluginAddChainableMethodEvent = class extends PluginEvent {
|
|
10950
|
+
constructor(type3, name, fn, chainingBehavior){
|
|
10951
|
+
super(type3, name, fn);
|
|
10952
|
+
this.chainingBehavior = chainingBehavior;
|
|
10953
|
+
}
|
|
10954
|
+
};
|
|
10955
|
+
chai_name(chai_PluginAddChainableMethodEvent, "PluginAddChainableMethodEvent");
|
|
10956
|
+
var PluginAddChainableMethodEvent = chai_PluginAddChainableMethodEvent;
|
|
10957
|
+
function chai_addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
10958
|
+
if ("function" != typeof chainingBehavior) chainingBehavior = /* @__PURE__ */ chai_name(function() {}, "chainingBehavior");
|
|
10959
|
+
let chainableBehavior = {
|
|
10960
|
+
method,
|
|
10961
|
+
chainingBehavior
|
|
10962
|
+
};
|
|
10963
|
+
if (!ctx.__methods) ctx.__methods = {};
|
|
10964
|
+
ctx.__methods[name] = chainableBehavior;
|
|
10965
|
+
Object.defineProperty(ctx, name, {
|
|
10966
|
+
get: /* @__PURE__ */ chai_name(function chainableMethodGetter() {
|
|
10967
|
+
chainableBehavior.chainingBehavior.call(this);
|
|
10968
|
+
let chainableMethodWrapper = /* @__PURE__ */ chai_name(function() {
|
|
10969
|
+
if (!chai_flag(this, "lockSsfi")) chai_flag(this, "ssfi", chainableMethodWrapper);
|
|
10970
|
+
let result = chainableBehavior.method.apply(this, arguments);
|
|
10971
|
+
if (void 0 !== result) return result;
|
|
10972
|
+
let newAssertion = new node_modules_chai_Assertion();
|
|
10973
|
+
chai_transferFlags(this, newAssertion);
|
|
10974
|
+
return newAssertion;
|
|
10975
|
+
}, "chainableMethodWrapper");
|
|
10976
|
+
chai_addLengthGuard(chainableMethodWrapper, name, true);
|
|
10977
|
+
if (chai_canSetPrototype) {
|
|
10978
|
+
let prototype = Object.create(this);
|
|
10979
|
+
prototype.call = chai_call;
|
|
10980
|
+
prototype.apply = chai_apply;
|
|
10981
|
+
Object.setPrototypeOf(chainableMethodWrapper, prototype);
|
|
10982
|
+
} else {
|
|
10983
|
+
let asserterNames = Object.getOwnPropertyNames(ctx);
|
|
10984
|
+
asserterNames.forEach(function(asserterName) {
|
|
10985
|
+
if (-1 !== chai_excludeNames.indexOf(asserterName)) return;
|
|
10986
|
+
let pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
|
|
10987
|
+
Object.defineProperty(chainableMethodWrapper, asserterName, pd);
|
|
10988
|
+
});
|
|
10989
|
+
}
|
|
10990
|
+
chai_transferFlags(this, chainableMethodWrapper);
|
|
10991
|
+
return chai_proxify(chainableMethodWrapper);
|
|
10992
|
+
}, "chainableMethodGetter"),
|
|
10993
|
+
configurable: true
|
|
10994
|
+
});
|
|
10995
|
+
events.dispatchEvent(new PluginAddChainableMethodEvent("addChainableMethod", name, method, chainingBehavior));
|
|
10996
|
+
}
|
|
10997
|
+
chai_name(chai_addChainableMethod, "addChainableMethod");
|
|
10998
|
+
function chai_overwriteChainableMethod(ctx, name, method, chainingBehavior) {
|
|
10999
|
+
let chainableBehavior = ctx.__methods[name];
|
|
11000
|
+
let _chainingBehavior = chainableBehavior.chainingBehavior;
|
|
11001
|
+
chainableBehavior.chainingBehavior = /* @__PURE__ */ chai_name(function overwritingChainableMethodGetter() {
|
|
11002
|
+
let result = chainingBehavior(_chainingBehavior).call(this);
|
|
11003
|
+
if (void 0 !== result) return result;
|
|
11004
|
+
let newAssertion = new node_modules_chai_Assertion();
|
|
11005
|
+
chai_transferFlags(this, newAssertion);
|
|
11006
|
+
return newAssertion;
|
|
11007
|
+
}, "overwritingChainableMethodGetter");
|
|
11008
|
+
let _method = chainableBehavior.method;
|
|
11009
|
+
chainableBehavior.method = /* @__PURE__ */ chai_name(function overwritingChainableMethodWrapper() {
|
|
11010
|
+
let result = method(_method).apply(this, arguments);
|
|
11011
|
+
if (void 0 !== result) return result;
|
|
11012
|
+
let newAssertion = new node_modules_chai_Assertion();
|
|
11013
|
+
chai_transferFlags(this, newAssertion);
|
|
11014
|
+
return newAssertion;
|
|
11015
|
+
}, "overwritingChainableMethodWrapper");
|
|
11016
|
+
}
|
|
11017
|
+
chai_name(chai_overwriteChainableMethod, "overwriteChainableMethod");
|
|
11018
|
+
function chai_compareByInspect(a, b) {
|
|
11019
|
+
return chai_inspect2(a) < chai_inspect2(b) ? -1 : 1;
|
|
11020
|
+
}
|
|
11021
|
+
chai_name(chai_compareByInspect, "compareByInspect");
|
|
11022
|
+
function chai_getOwnEnumerablePropertySymbols(obj) {
|
|
11023
|
+
if ("function" != typeof Object.getOwnPropertySymbols) return [];
|
|
11024
|
+
return Object.getOwnPropertySymbols(obj).filter(function(sym) {
|
|
11025
|
+
return Object.getOwnPropertyDescriptor(obj, sym).enumerable;
|
|
11026
|
+
});
|
|
11027
|
+
}
|
|
11028
|
+
chai_name(chai_getOwnEnumerablePropertySymbols, "getOwnEnumerablePropertySymbols");
|
|
11029
|
+
function chai_getOwnEnumerableProperties(obj) {
|
|
11030
|
+
return Object.keys(obj).concat(chai_getOwnEnumerablePropertySymbols(obj));
|
|
11031
|
+
}
|
|
11032
|
+
chai_name(chai_getOwnEnumerableProperties, "getOwnEnumerableProperties");
|
|
11033
|
+
var chai_isNaN2 = Number.isNaN;
|
|
11034
|
+
function chai_isObjectType(obj) {
|
|
11035
|
+
let objectType = node_modules_chai_type(obj);
|
|
11036
|
+
let objectTypes = [
|
|
11037
|
+
"Array",
|
|
11038
|
+
"Object",
|
|
11039
|
+
"Function"
|
|
11040
|
+
];
|
|
11041
|
+
return -1 !== objectTypes.indexOf(objectType);
|
|
11042
|
+
}
|
|
11043
|
+
chai_name(chai_isObjectType, "isObjectType");
|
|
11044
|
+
function chai_getOperator(obj, args) {
|
|
11045
|
+
let operator = chai_flag(obj, "operator");
|
|
11046
|
+
let negate = chai_flag(obj, "negate");
|
|
11047
|
+
let expected = args[3];
|
|
11048
|
+
let msg = negate ? args[2] : args[1];
|
|
11049
|
+
if (operator) return operator;
|
|
11050
|
+
if ("function" == typeof msg) msg = msg();
|
|
11051
|
+
msg = msg || "";
|
|
11052
|
+
if (!msg) return;
|
|
11053
|
+
if (/\shave\s/.test(msg)) return;
|
|
11054
|
+
let isObject = chai_isObjectType(expected);
|
|
11055
|
+
if (/\snot\s/.test(msg)) return isObject ? "notDeepStrictEqual" : "notStrictEqual";
|
|
11056
|
+
return isObject ? "deepStrictEqual" : "strictEqual";
|
|
11057
|
+
}
|
|
11058
|
+
chai_name(chai_getOperator, "getOperator");
|
|
11059
|
+
function chai_getName(fn) {
|
|
11060
|
+
return fn.name;
|
|
11061
|
+
}
|
|
11062
|
+
chai_name(chai_getName, "getName");
|
|
11063
|
+
function chai_isRegExp2(obj) {
|
|
11064
|
+
return "[object RegExp]" === Object.prototype.toString.call(obj);
|
|
11065
|
+
}
|
|
11066
|
+
chai_name(chai_isRegExp2, "isRegExp");
|
|
11067
|
+
function chai_isNumeric(obj) {
|
|
11068
|
+
return [
|
|
11069
|
+
"Number",
|
|
11070
|
+
"BigInt"
|
|
11071
|
+
].includes(node_modules_chai_type(obj));
|
|
11072
|
+
}
|
|
11073
|
+
chai_name(chai_isNumeric, "isNumeric");
|
|
11074
|
+
var { flag: chai_flag2 } = chai_utils_exports;
|
|
11075
|
+
[
|
|
11076
|
+
"to",
|
|
11077
|
+
"be",
|
|
11078
|
+
"been",
|
|
11079
|
+
"is",
|
|
11080
|
+
"and",
|
|
11081
|
+
"has",
|
|
11082
|
+
"have",
|
|
11083
|
+
"with",
|
|
11084
|
+
"that",
|
|
11085
|
+
"which",
|
|
11086
|
+
"at",
|
|
11087
|
+
"of",
|
|
11088
|
+
"same",
|
|
11089
|
+
"but",
|
|
11090
|
+
"does",
|
|
11091
|
+
"still",
|
|
11092
|
+
"also"
|
|
11093
|
+
].forEach(function(chain) {
|
|
11094
|
+
node_modules_chai_Assertion.addProperty(chain);
|
|
11095
|
+
});
|
|
11096
|
+
node_modules_chai_Assertion.addProperty("not", function() {
|
|
11097
|
+
chai_flag2(this, "negate", true);
|
|
11098
|
+
});
|
|
11099
|
+
node_modules_chai_Assertion.addProperty("deep", function() {
|
|
11100
|
+
chai_flag2(this, "deep", true);
|
|
11101
|
+
});
|
|
11102
|
+
node_modules_chai_Assertion.addProperty("nested", function() {
|
|
11103
|
+
chai_flag2(this, "nested", true);
|
|
11104
|
+
});
|
|
11105
|
+
node_modules_chai_Assertion.addProperty("own", function() {
|
|
11106
|
+
chai_flag2(this, "own", true);
|
|
11107
|
+
});
|
|
11108
|
+
node_modules_chai_Assertion.addProperty("ordered", function() {
|
|
11109
|
+
chai_flag2(this, "ordered", true);
|
|
11110
|
+
});
|
|
11111
|
+
node_modules_chai_Assertion.addProperty("any", function() {
|
|
11112
|
+
chai_flag2(this, "any", true);
|
|
11113
|
+
chai_flag2(this, "all", false);
|
|
11114
|
+
});
|
|
11115
|
+
node_modules_chai_Assertion.addProperty("all", function() {
|
|
11116
|
+
chai_flag2(this, "all", true);
|
|
11117
|
+
chai_flag2(this, "any", false);
|
|
11118
|
+
});
|
|
11119
|
+
var chai_functionTypes = {
|
|
11120
|
+
function: [
|
|
11121
|
+
"function",
|
|
11122
|
+
"asyncfunction",
|
|
11123
|
+
"generatorfunction",
|
|
11124
|
+
"asyncgeneratorfunction"
|
|
11125
|
+
],
|
|
11126
|
+
asyncfunction: [
|
|
11127
|
+
"asyncfunction",
|
|
11128
|
+
"asyncgeneratorfunction"
|
|
11129
|
+
],
|
|
11130
|
+
generatorfunction: [
|
|
11131
|
+
"generatorfunction",
|
|
11132
|
+
"asyncgeneratorfunction"
|
|
11133
|
+
],
|
|
11134
|
+
asyncgeneratorfunction: [
|
|
11135
|
+
"asyncgeneratorfunction"
|
|
11136
|
+
]
|
|
11137
|
+
};
|
|
11138
|
+
function chai_an(type3, msg) {
|
|
11139
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11140
|
+
type3 = type3.toLowerCase();
|
|
11141
|
+
let obj = chai_flag2(this, "object"), article = ~[
|
|
11142
|
+
"a",
|
|
11143
|
+
"e",
|
|
11144
|
+
"i",
|
|
11145
|
+
"o",
|
|
11146
|
+
"u"
|
|
11147
|
+
].indexOf(type3.charAt(0)) ? "an " : "a ";
|
|
11148
|
+
const detectedType = node_modules_chai_type(obj).toLowerCase();
|
|
11149
|
+
if (chai_functionTypes["function"].includes(type3)) this.assert(chai_functionTypes[type3].includes(detectedType), "expected #{this} to be " + article + type3, "expected #{this} not to be " + article + type3);
|
|
11150
|
+
else this.assert(type3 === detectedType, "expected #{this} to be " + article + type3, "expected #{this} not to be " + article + type3);
|
|
11151
|
+
}
|
|
11152
|
+
chai_name(chai_an, "an");
|
|
11153
|
+
node_modules_chai_Assertion.addChainableMethod("an", chai_an);
|
|
11154
|
+
node_modules_chai_Assertion.addChainableMethod("a", chai_an);
|
|
11155
|
+
function chai_SameValueZero(a, b) {
|
|
11156
|
+
return chai_isNaN2(a) && chai_isNaN2(b) || a === b;
|
|
11157
|
+
}
|
|
11158
|
+
chai_name(chai_SameValueZero, "SameValueZero");
|
|
11159
|
+
function chai_includeChainingBehavior() {
|
|
11160
|
+
chai_flag2(this, "contains", true);
|
|
11161
|
+
}
|
|
11162
|
+
chai_name(chai_includeChainingBehavior, "includeChainingBehavior");
|
|
11163
|
+
function chai_include(val, msg) {
|
|
11164
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11165
|
+
let obj = chai_flag2(this, "object"), objType = node_modules_chai_type(obj).toLowerCase(), flagMsg = chai_flag2(this, "message"), negate = chai_flag2(this, "negate"), ssfi = chai_flag2(this, "ssfi"), isDeep = chai_flag2(this, "deep"), descriptor = isDeep ? "deep " : "", isEql = isDeep ? chai_flag2(this, "eql") : chai_SameValueZero;
|
|
11166
|
+
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
11167
|
+
let included = false;
|
|
11168
|
+
switch(objType){
|
|
11169
|
+
case "string":
|
|
11170
|
+
included = -1 !== obj.indexOf(val);
|
|
11171
|
+
break;
|
|
11172
|
+
case "weakset":
|
|
11173
|
+
if (isDeep) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + "unable to use .deep.include with WeakSet", void 0, ssfi);
|
|
11174
|
+
included = obj.has(val);
|
|
11175
|
+
break;
|
|
11176
|
+
case "map":
|
|
11177
|
+
obj.forEach(function(item) {
|
|
11178
|
+
included = included || isEql(item, val);
|
|
11179
|
+
});
|
|
11180
|
+
break;
|
|
11181
|
+
case "set":
|
|
11182
|
+
if (isDeep) obj.forEach(function(item) {
|
|
11183
|
+
included = included || isEql(item, val);
|
|
11184
|
+
});
|
|
11185
|
+
else included = obj.has(val);
|
|
11186
|
+
break;
|
|
11187
|
+
case "array":
|
|
11188
|
+
included = isDeep ? obj.some(function(item) {
|
|
11189
|
+
return isEql(item, val);
|
|
11190
|
+
}) : -1 !== obj.indexOf(val);
|
|
11191
|
+
break;
|
|
11192
|
+
default:
|
|
11193
|
+
{
|
|
11194
|
+
if (val !== Object(val)) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + "the given combination of arguments (" + objType + " and " + node_modules_chai_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 " + node_modules_chai_type(val).toLowerCase(), void 0, ssfi);
|
|
11195
|
+
let props = Object.keys(val);
|
|
11196
|
+
let firstErr = null;
|
|
11197
|
+
let numErrs = 0;
|
|
11198
|
+
props.forEach(function(prop) {
|
|
11199
|
+
let propAssertion = new node_modules_chai_Assertion(obj);
|
|
11200
|
+
chai_transferFlags(this, propAssertion, true);
|
|
11201
|
+
chai_flag2(propAssertion, "lockSsfi", true);
|
|
11202
|
+
if (!negate || 1 === props.length) return void propAssertion.property(prop, val[prop]);
|
|
11203
|
+
try {
|
|
11204
|
+
propAssertion.property(prop, val[prop]);
|
|
11205
|
+
} catch (err) {
|
|
11206
|
+
if (!chai_check_error_exports.compatibleConstructor(err, chai_6_2_2_node_modules_chai_AssertionError)) throw err;
|
|
11207
|
+
if (null === firstErr) firstErr = err;
|
|
11208
|
+
numErrs++;
|
|
11209
|
+
}
|
|
11210
|
+
}, this);
|
|
11211
|
+
if (negate && props.length > 1 && numErrs === props.length) throw firstErr;
|
|
11212
|
+
return;
|
|
11213
|
+
}
|
|
11214
|
+
}
|
|
11215
|
+
this.assert(included, "expected #{this} to " + descriptor + "include " + chai_inspect2(val), "expected #{this} to not " + descriptor + "include " + chai_inspect2(val));
|
|
11216
|
+
}
|
|
11217
|
+
chai_name(chai_include, "include");
|
|
11218
|
+
node_modules_chai_Assertion.addChainableMethod("include", chai_include, chai_includeChainingBehavior);
|
|
11219
|
+
node_modules_chai_Assertion.addChainableMethod("contain", chai_include, chai_includeChainingBehavior);
|
|
11220
|
+
node_modules_chai_Assertion.addChainableMethod("contains", chai_include, chai_includeChainingBehavior);
|
|
11221
|
+
node_modules_chai_Assertion.addChainableMethod("includes", chai_include, chai_includeChainingBehavior);
|
|
11222
|
+
node_modules_chai_Assertion.addProperty("ok", function() {
|
|
11223
|
+
this.assert(chai_flag2(this, "object"), "expected #{this} to be truthy", "expected #{this} to be falsy");
|
|
11224
|
+
});
|
|
11225
|
+
node_modules_chai_Assertion.addProperty("true", function() {
|
|
11226
|
+
this.assert(true === chai_flag2(this, "object"), "expected #{this} to be true", "expected #{this} to be false", !chai_flag2(this, "negate"));
|
|
11227
|
+
});
|
|
11228
|
+
node_modules_chai_Assertion.addProperty("numeric", function() {
|
|
11229
|
+
const object = chai_flag2(this, "object");
|
|
11230
|
+
this.assert([
|
|
11231
|
+
"Number",
|
|
11232
|
+
"BigInt"
|
|
11233
|
+
].includes(node_modules_chai_type(object)), "expected #{this} to be numeric", "expected #{this} to not be numeric", !chai_flag2(this, "negate"));
|
|
11234
|
+
});
|
|
11235
|
+
node_modules_chai_Assertion.addProperty("callable", function() {
|
|
11236
|
+
const val = chai_flag2(this, "object");
|
|
11237
|
+
const ssfi = chai_flag2(this, "ssfi");
|
|
11238
|
+
const message = chai_flag2(this, "message");
|
|
11239
|
+
const msg = message ? `${message}: ` : "";
|
|
11240
|
+
const negate = chai_flag2(this, "negate");
|
|
11241
|
+
const assertionMessage = negate ? `${msg}expected ${chai_inspect2(val)} not to be a callable function` : `${msg}expected ${chai_inspect2(val)} to be a callable function`;
|
|
11242
|
+
const isCallable = [
|
|
11243
|
+
"Function",
|
|
11244
|
+
"AsyncFunction",
|
|
11245
|
+
"GeneratorFunction",
|
|
11246
|
+
"AsyncGeneratorFunction"
|
|
11247
|
+
].includes(node_modules_chai_type(val));
|
|
11248
|
+
if (isCallable && negate || !isCallable && !negate) throw new chai_6_2_2_node_modules_chai_AssertionError(assertionMessage, void 0, ssfi);
|
|
11249
|
+
});
|
|
11250
|
+
node_modules_chai_Assertion.addProperty("false", function() {
|
|
11251
|
+
this.assert(false === chai_flag2(this, "object"), "expected #{this} to be false", "expected #{this} to be true", !!chai_flag2(this, "negate"));
|
|
11252
|
+
});
|
|
11253
|
+
node_modules_chai_Assertion.addProperty("null", function() {
|
|
11254
|
+
this.assert(null === chai_flag2(this, "object"), "expected #{this} to be null", "expected #{this} not to be null");
|
|
11255
|
+
});
|
|
11256
|
+
node_modules_chai_Assertion.addProperty("undefined", function() {
|
|
11257
|
+
this.assert(void 0 === chai_flag2(this, "object"), "expected #{this} to be undefined", "expected #{this} not to be undefined");
|
|
11258
|
+
});
|
|
11259
|
+
node_modules_chai_Assertion.addProperty("NaN", function() {
|
|
11260
|
+
this.assert(chai_isNaN2(chai_flag2(this, "object")), "expected #{this} to be NaN", "expected #{this} not to be NaN");
|
|
11261
|
+
});
|
|
11262
|
+
function chai_assertExist() {
|
|
11263
|
+
let val = chai_flag2(this, "object");
|
|
11264
|
+
this.assert(null != val, "expected #{this} to exist", "expected #{this} to not exist");
|
|
11265
|
+
}
|
|
11266
|
+
chai_name(chai_assertExist, "assertExist");
|
|
11267
|
+
node_modules_chai_Assertion.addProperty("exist", chai_assertExist);
|
|
11268
|
+
node_modules_chai_Assertion.addProperty("exists", chai_assertExist);
|
|
11269
|
+
node_modules_chai_Assertion.addProperty("empty", function() {
|
|
11270
|
+
let val = chai_flag2(this, "object"), ssfi = chai_flag2(this, "ssfi"), flagMsg = chai_flag2(this, "message"), itemsCount;
|
|
11271
|
+
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
11272
|
+
switch(node_modules_chai_type(val).toLowerCase()){
|
|
11273
|
+
case "array":
|
|
11274
|
+
case "string":
|
|
11275
|
+
itemsCount = val.length;
|
|
11276
|
+
break;
|
|
11277
|
+
case "map":
|
|
11278
|
+
case "set":
|
|
11279
|
+
itemsCount = val.size;
|
|
11280
|
+
break;
|
|
11281
|
+
case "weakmap":
|
|
11282
|
+
case "weakset":
|
|
11283
|
+
throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + ".empty was passed a weak collection", void 0, ssfi);
|
|
11284
|
+
case "function":
|
|
11285
|
+
{
|
|
11286
|
+
const msg = flagMsg + ".empty was passed a function " + chai_getName(val);
|
|
11287
|
+
throw new chai_6_2_2_node_modules_chai_AssertionError(msg.trim(), void 0, ssfi);
|
|
11288
|
+
}
|
|
11289
|
+
default:
|
|
11290
|
+
if (val !== Object(val)) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + ".empty was passed non-string primitive " + chai_inspect2(val), void 0, ssfi);
|
|
11291
|
+
itemsCount = Object.keys(val).length;
|
|
11292
|
+
}
|
|
11293
|
+
this.assert(0 === itemsCount, "expected #{this} to be empty", "expected #{this} not to be empty");
|
|
11294
|
+
});
|
|
11295
|
+
function chai_checkArguments() {
|
|
11296
|
+
let obj = chai_flag2(this, "object"), type3 = node_modules_chai_type(obj);
|
|
11297
|
+
this.assert("Arguments" === type3, "expected #{this} to be arguments but got " + type3, "expected #{this} to not be arguments");
|
|
11298
|
+
}
|
|
11299
|
+
chai_name(chai_checkArguments, "checkArguments");
|
|
11300
|
+
node_modules_chai_Assertion.addProperty("arguments", chai_checkArguments);
|
|
11301
|
+
node_modules_chai_Assertion.addProperty("Arguments", chai_checkArguments);
|
|
11302
|
+
function chai_assertEqual(val, msg) {
|
|
11303
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11304
|
+
let obj = chai_flag2(this, "object");
|
|
11305
|
+
if (chai_flag2(this, "deep")) {
|
|
11306
|
+
let prevLockSsfi = chai_flag2(this, "lockSsfi");
|
|
11307
|
+
chai_flag2(this, "lockSsfi", true);
|
|
11308
|
+
this.eql(val);
|
|
11309
|
+
chai_flag2(this, "lockSsfi", prevLockSsfi);
|
|
11310
|
+
} else this.assert(val === obj, "expected #{this} to equal #{exp}", "expected #{this} to not equal #{exp}", val, this._obj, true);
|
|
11311
|
+
}
|
|
11312
|
+
chai_name(chai_assertEqual, "assertEqual");
|
|
11313
|
+
node_modules_chai_Assertion.addMethod("equal", chai_assertEqual);
|
|
11314
|
+
node_modules_chai_Assertion.addMethod("equals", chai_assertEqual);
|
|
11315
|
+
node_modules_chai_Assertion.addMethod("eq", chai_assertEqual);
|
|
11316
|
+
function chai_assertEql(obj, msg) {
|
|
11317
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11318
|
+
let eql = chai_flag2(this, "eql");
|
|
11319
|
+
this.assert(eql(obj, chai_flag2(this, "object")), "expected #{this} to deeply equal #{exp}", "expected #{this} to not deeply equal #{exp}", obj, this._obj, true);
|
|
11320
|
+
}
|
|
11321
|
+
chai_name(chai_assertEql, "assertEql");
|
|
11322
|
+
node_modules_chai_Assertion.addMethod("eql", chai_assertEql);
|
|
11323
|
+
node_modules_chai_Assertion.addMethod("eqls", chai_assertEql);
|
|
11324
|
+
function chai_assertAbove(n, msg) {
|
|
11325
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11326
|
+
let obj = chai_flag2(this, "object"), doLength = chai_flag2(this, "doLength"), flagMsg = chai_flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = chai_flag2(this, "ssfi"), objType = node_modules_chai_type(obj).toLowerCase(), nType = node_modules_chai_type(n).toLowerCase();
|
|
11327
|
+
if (doLength && "map" !== objType && "set" !== objType) new node_modules_chai_Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
11328
|
+
if (doLength || "date" !== objType || "date" === nType) {
|
|
11329
|
+
if (!chai_isNumeric(n) && (doLength || chai_isNumeric(obj))) throw new chai_6_2_2_node_modules_chai_AssertionError(msgPrefix + "the argument to above must be a number", void 0, ssfi);
|
|
11330
|
+
else if (!doLength && "date" !== objType && !chai_isNumeric(obj)) {
|
|
11331
|
+
let printObj = "string" === objType ? "'" + obj + "'" : obj;
|
|
11332
|
+
throw new chai_6_2_2_node_modules_chai_AssertionError(msgPrefix + "expected " + printObj + " to be a number or a date", void 0, ssfi);
|
|
11333
|
+
}
|
|
11334
|
+
} else throw new chai_6_2_2_node_modules_chai_AssertionError(msgPrefix + "the argument to above must be a date", void 0, ssfi);
|
|
11335
|
+
if (doLength) {
|
|
11336
|
+
let descriptor = "length", itemsCount;
|
|
11337
|
+
if ("map" === objType || "set" === objType) {
|
|
11338
|
+
descriptor = "size";
|
|
11339
|
+
itemsCount = obj.size;
|
|
11340
|
+
} else itemsCount = obj.length;
|
|
11341
|
+
this.assert(itemsCount > n, "expected #{this} to have a " + descriptor + " above #{exp} but got #{act}", "expected #{this} to not have a " + descriptor + " above #{exp}", n, itemsCount);
|
|
11342
|
+
} else this.assert(obj > n, "expected #{this} to be above #{exp}", "expected #{this} to be at most #{exp}", n);
|
|
11343
|
+
}
|
|
11344
|
+
chai_name(chai_assertAbove, "assertAbove");
|
|
11345
|
+
node_modules_chai_Assertion.addMethod("above", chai_assertAbove);
|
|
11346
|
+
node_modules_chai_Assertion.addMethod("gt", chai_assertAbove);
|
|
11347
|
+
node_modules_chai_Assertion.addMethod("greaterThan", chai_assertAbove);
|
|
11348
|
+
function chai_assertLeast(n, msg) {
|
|
11349
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11350
|
+
let obj = chai_flag2(this, "object"), doLength = chai_flag2(this, "doLength"), flagMsg = chai_flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = chai_flag2(this, "ssfi"), objType = node_modules_chai_type(obj).toLowerCase(), nType = node_modules_chai_type(n).toLowerCase(), errorMessage, shouldThrow = true;
|
|
11351
|
+
if (doLength && "map" !== objType && "set" !== objType) new node_modules_chai_Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
11352
|
+
if (doLength || "date" !== objType || "date" === nType) if (!chai_isNumeric(n) && (doLength || chai_isNumeric(obj))) errorMessage = msgPrefix + "the argument to least must be a number";
|
|
11353
|
+
else if (doLength || "date" === objType || chai_isNumeric(obj)) shouldThrow = false;
|
|
11354
|
+
else {
|
|
11355
|
+
let printObj = "string" === objType ? "'" + obj + "'" : obj;
|
|
11356
|
+
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
11357
|
+
}
|
|
11358
|
+
else errorMessage = msgPrefix + "the argument to least must be a date";
|
|
11359
|
+
if (shouldThrow) throw new chai_6_2_2_node_modules_chai_AssertionError(errorMessage, void 0, ssfi);
|
|
11360
|
+
if (doLength) {
|
|
11361
|
+
let descriptor = "length", itemsCount;
|
|
11362
|
+
if ("map" === objType || "set" === objType) {
|
|
11363
|
+
descriptor = "size";
|
|
11364
|
+
itemsCount = obj.size;
|
|
11365
|
+
} else itemsCount = obj.length;
|
|
11366
|
+
this.assert(itemsCount >= n, "expected #{this} to have a " + descriptor + " at least #{exp} but got #{act}", "expected #{this} to have a " + descriptor + " below #{exp}", n, itemsCount);
|
|
11367
|
+
} else this.assert(obj >= n, "expected #{this} to be at least #{exp}", "expected #{this} to be below #{exp}", n);
|
|
11368
|
+
}
|
|
11369
|
+
chai_name(chai_assertLeast, "assertLeast");
|
|
11370
|
+
node_modules_chai_Assertion.addMethod("least", chai_assertLeast);
|
|
11371
|
+
node_modules_chai_Assertion.addMethod("gte", chai_assertLeast);
|
|
11372
|
+
node_modules_chai_Assertion.addMethod("greaterThanOrEqual", chai_assertLeast);
|
|
11373
|
+
function chai_assertBelow(n, msg) {
|
|
11374
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11375
|
+
let obj = chai_flag2(this, "object"), doLength = chai_flag2(this, "doLength"), flagMsg = chai_flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = chai_flag2(this, "ssfi"), objType = node_modules_chai_type(obj).toLowerCase(), nType = node_modules_chai_type(n).toLowerCase(), errorMessage, shouldThrow = true;
|
|
11376
|
+
if (doLength && "map" !== objType && "set" !== objType) new node_modules_chai_Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
11377
|
+
if (doLength || "date" !== objType || "date" === nType) if (!chai_isNumeric(n) && (doLength || chai_isNumeric(obj))) errorMessage = msgPrefix + "the argument to below must be a number";
|
|
11378
|
+
else if (doLength || "date" === objType || chai_isNumeric(obj)) shouldThrow = false;
|
|
11379
|
+
else {
|
|
11380
|
+
let printObj = "string" === objType ? "'" + obj + "'" : obj;
|
|
11381
|
+
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
11382
|
+
}
|
|
11383
|
+
else errorMessage = msgPrefix + "the argument to below must be a date";
|
|
11384
|
+
if (shouldThrow) throw new chai_6_2_2_node_modules_chai_AssertionError(errorMessage, void 0, ssfi);
|
|
11385
|
+
if (doLength) {
|
|
11386
|
+
let descriptor = "length", itemsCount;
|
|
11387
|
+
if ("map" === objType || "set" === objType) {
|
|
11388
|
+
descriptor = "size";
|
|
11389
|
+
itemsCount = obj.size;
|
|
11390
|
+
} else itemsCount = obj.length;
|
|
11391
|
+
this.assert(itemsCount < n, "expected #{this} to have a " + descriptor + " below #{exp} but got #{act}", "expected #{this} to not have a " + descriptor + " below #{exp}", n, itemsCount);
|
|
11392
|
+
} else this.assert(obj < n, "expected #{this} to be below #{exp}", "expected #{this} to be at least #{exp}", n);
|
|
11393
|
+
}
|
|
11394
|
+
chai_name(chai_assertBelow, "assertBelow");
|
|
11395
|
+
node_modules_chai_Assertion.addMethod("below", chai_assertBelow);
|
|
11396
|
+
node_modules_chai_Assertion.addMethod("lt", chai_assertBelow);
|
|
11397
|
+
node_modules_chai_Assertion.addMethod("lessThan", chai_assertBelow);
|
|
11398
|
+
function chai_assertMost(n, msg) {
|
|
11399
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11400
|
+
let obj = chai_flag2(this, "object"), doLength = chai_flag2(this, "doLength"), flagMsg = chai_flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = chai_flag2(this, "ssfi"), objType = node_modules_chai_type(obj).toLowerCase(), nType = node_modules_chai_type(n).toLowerCase(), errorMessage, shouldThrow = true;
|
|
11401
|
+
if (doLength && "map" !== objType && "set" !== objType) new node_modules_chai_Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
11402
|
+
if (doLength || "date" !== objType || "date" === nType) if (!chai_isNumeric(n) && (doLength || chai_isNumeric(obj))) errorMessage = msgPrefix + "the argument to most must be a number";
|
|
11403
|
+
else if (doLength || "date" === objType || chai_isNumeric(obj)) shouldThrow = false;
|
|
11404
|
+
else {
|
|
11405
|
+
let printObj = "string" === objType ? "'" + obj + "'" : obj;
|
|
11406
|
+
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
11407
|
+
}
|
|
11408
|
+
else errorMessage = msgPrefix + "the argument to most must be a date";
|
|
11409
|
+
if (shouldThrow) throw new chai_6_2_2_node_modules_chai_AssertionError(errorMessage, void 0, ssfi);
|
|
11410
|
+
if (doLength) {
|
|
11411
|
+
let descriptor = "length", itemsCount;
|
|
11412
|
+
if ("map" === objType || "set" === objType) {
|
|
11413
|
+
descriptor = "size";
|
|
11414
|
+
itemsCount = obj.size;
|
|
11415
|
+
} else itemsCount = obj.length;
|
|
11416
|
+
this.assert(itemsCount <= n, "expected #{this} to have a " + descriptor + " at most #{exp} but got #{act}", "expected #{this} to have a " + descriptor + " above #{exp}", n, itemsCount);
|
|
11417
|
+
} else this.assert(obj <= n, "expected #{this} to be at most #{exp}", "expected #{this} to be above #{exp}", n);
|
|
11418
|
+
}
|
|
11419
|
+
chai_name(chai_assertMost, "assertMost");
|
|
11420
|
+
node_modules_chai_Assertion.addMethod("most", chai_assertMost);
|
|
11421
|
+
node_modules_chai_Assertion.addMethod("lte", chai_assertMost);
|
|
11422
|
+
node_modules_chai_Assertion.addMethod("lessThanOrEqual", chai_assertMost);
|
|
11423
|
+
node_modules_chai_Assertion.addMethod("within", function(start, finish, msg) {
|
|
11424
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11425
|
+
let obj = chai_flag2(this, "object"), doLength = chai_flag2(this, "doLength"), flagMsg = chai_flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = chai_flag2(this, "ssfi"), objType = node_modules_chai_type(obj).toLowerCase(), startType = node_modules_chai_type(start).toLowerCase(), finishType = node_modules_chai_type(finish).toLowerCase(), errorMessage, shouldThrow = true, range = "date" === startType && "date" === finishType ? start.toISOString() + ".." + finish.toISOString() : start + ".." + finish;
|
|
11426
|
+
if (doLength && "map" !== objType && "set" !== objType) new node_modules_chai_Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
11427
|
+
if (doLength || "date" !== objType || "date" === startType && "date" === finishType) if ((!chai_isNumeric(start) || !chai_isNumeric(finish)) && (doLength || chai_isNumeric(obj))) errorMessage = msgPrefix + "the arguments to within must be numbers";
|
|
11428
|
+
else if (doLength || "date" === objType || chai_isNumeric(obj)) shouldThrow = false;
|
|
11429
|
+
else {
|
|
11430
|
+
let printObj = "string" === objType ? "'" + obj + "'" : obj;
|
|
11431
|
+
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
11432
|
+
}
|
|
11433
|
+
else errorMessage = msgPrefix + "the arguments to within must be dates";
|
|
11434
|
+
if (shouldThrow) throw new chai_6_2_2_node_modules_chai_AssertionError(errorMessage, void 0, ssfi);
|
|
11435
|
+
if (doLength) {
|
|
11436
|
+
let descriptor = "length", itemsCount;
|
|
11437
|
+
if ("map" === objType || "set" === objType) {
|
|
11438
|
+
descriptor = "size";
|
|
11439
|
+
itemsCount = obj.size;
|
|
11440
|
+
} else itemsCount = obj.length;
|
|
11441
|
+
this.assert(itemsCount >= start && itemsCount <= finish, "expected #{this} to have a " + descriptor + " within " + range, "expected #{this} to not have a " + descriptor + " within " + range);
|
|
11442
|
+
} else this.assert(obj >= start && obj <= finish, "expected #{this} to be within " + range, "expected #{this} to not be within " + range);
|
|
11443
|
+
});
|
|
11444
|
+
function chai_assertInstanceOf(constructor, msg) {
|
|
11445
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11446
|
+
let target = chai_flag2(this, "object");
|
|
11447
|
+
let ssfi = chai_flag2(this, "ssfi");
|
|
11448
|
+
let flagMsg = chai_flag2(this, "message");
|
|
11449
|
+
let isInstanceOf;
|
|
11450
|
+
try {
|
|
11451
|
+
isInstanceOf = target instanceof constructor;
|
|
11452
|
+
} catch (err) {
|
|
11453
|
+
if (err instanceof TypeError) {
|
|
11454
|
+
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
11455
|
+
throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + "The instanceof assertion needs a constructor but " + node_modules_chai_type(constructor) + " was given.", void 0, ssfi);
|
|
11456
|
+
}
|
|
11457
|
+
throw err;
|
|
11458
|
+
}
|
|
11459
|
+
let name = chai_getName(constructor);
|
|
11460
|
+
if (null == name) name = "an unnamed constructor";
|
|
11461
|
+
this.assert(isInstanceOf, "expected #{this} to be an instance of " + name, "expected #{this} to not be an instance of " + name);
|
|
11462
|
+
}
|
|
11463
|
+
chai_name(chai_assertInstanceOf, "assertInstanceOf");
|
|
11464
|
+
node_modules_chai_Assertion.addMethod("instanceof", chai_assertInstanceOf);
|
|
11465
|
+
node_modules_chai_Assertion.addMethod("instanceOf", chai_assertInstanceOf);
|
|
11466
|
+
function chai_assertProperty(name, val, msg) {
|
|
11467
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11468
|
+
let isNested = chai_flag2(this, "nested"), isOwn = chai_flag2(this, "own"), flagMsg = chai_flag2(this, "message"), obj = chai_flag2(this, "object"), ssfi = chai_flag2(this, "ssfi"), nameType = typeof name;
|
|
11469
|
+
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
11470
|
+
if (isNested) {
|
|
11471
|
+
if ("string" !== nameType) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + "the argument to property must be a string when using nested syntax", void 0, ssfi);
|
|
11472
|
+
} else if ("string" !== nameType && "number" !== nameType && "symbol" !== nameType) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + "the argument to property must be a string, number, or symbol", void 0, ssfi);
|
|
11473
|
+
if (isNested && isOwn) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + 'The "nested" and "own" flags cannot be combined.', void 0, ssfi);
|
|
11474
|
+
if (null == obj) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + "Target cannot be null or undefined.", void 0, ssfi);
|
|
11475
|
+
let isDeep = chai_flag2(this, "deep"), negate = chai_flag2(this, "negate"), pathInfo = isNested ? chai_getPathInfo(obj, name) : null, value = isNested ? pathInfo.value : obj[name], isEql = isDeep ? chai_flag2(this, "eql") : (val1, val2)=>val1 === val2;
|
|
11476
|
+
let descriptor = "";
|
|
11477
|
+
if (isDeep) descriptor += "deep ";
|
|
11478
|
+
if (isOwn) descriptor += "own ";
|
|
11479
|
+
if (isNested) descriptor += "nested ";
|
|
11480
|
+
descriptor += "property ";
|
|
11481
|
+
let hasProperty2;
|
|
11482
|
+
hasProperty2 = isOwn ? Object.prototype.hasOwnProperty.call(obj, name) : isNested ? pathInfo.exists : chai_hasProperty(obj, name);
|
|
11483
|
+
if (!negate || 1 === arguments.length) this.assert(hasProperty2, "expected #{this} to have " + descriptor + chai_inspect2(name), "expected #{this} to not have " + descriptor + chai_inspect2(name));
|
|
11484
|
+
if (arguments.length > 1) this.assert(hasProperty2 && isEql(val, value), "expected #{this} to have " + descriptor + chai_inspect2(name) + " of #{exp}, but got #{act}", "expected #{this} to not have " + descriptor + chai_inspect2(name) + " of #{act}", val, value);
|
|
11485
|
+
chai_flag2(this, "object", value);
|
|
11486
|
+
}
|
|
11487
|
+
chai_name(chai_assertProperty, "assertProperty");
|
|
11488
|
+
node_modules_chai_Assertion.addMethod("property", chai_assertProperty);
|
|
11489
|
+
function chai_assertOwnProperty(_name, _value, _msg) {
|
|
11490
|
+
chai_flag2(this, "own", true);
|
|
11491
|
+
chai_assertProperty.apply(this, arguments);
|
|
11492
|
+
}
|
|
11493
|
+
chai_name(chai_assertOwnProperty, "assertOwnProperty");
|
|
11494
|
+
node_modules_chai_Assertion.addMethod("ownProperty", chai_assertOwnProperty);
|
|
11495
|
+
node_modules_chai_Assertion.addMethod("haveOwnProperty", chai_assertOwnProperty);
|
|
11496
|
+
function chai_assertOwnPropertyDescriptor(name, descriptor, msg) {
|
|
11497
|
+
if ("string" == typeof descriptor) {
|
|
11498
|
+
msg = descriptor;
|
|
11499
|
+
descriptor = null;
|
|
11500
|
+
}
|
|
11501
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11502
|
+
let obj = chai_flag2(this, "object");
|
|
11503
|
+
let actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name);
|
|
11504
|
+
let eql = chai_flag2(this, "eql");
|
|
11505
|
+
if (actualDescriptor && descriptor) this.assert(eql(descriptor, actualDescriptor), "expected the own property descriptor for " + chai_inspect2(name) + " on #{this} to match " + chai_inspect2(descriptor) + ", got " + chai_inspect2(actualDescriptor), "expected the own property descriptor for " + chai_inspect2(name) + " on #{this} to not match " + chai_inspect2(descriptor), descriptor, actualDescriptor, true);
|
|
11506
|
+
else this.assert(actualDescriptor, "expected #{this} to have an own property descriptor for " + chai_inspect2(name), "expected #{this} to not have an own property descriptor for " + chai_inspect2(name));
|
|
11507
|
+
chai_flag2(this, "object", actualDescriptor);
|
|
11508
|
+
}
|
|
11509
|
+
chai_name(chai_assertOwnPropertyDescriptor, "assertOwnPropertyDescriptor");
|
|
11510
|
+
node_modules_chai_Assertion.addMethod("ownPropertyDescriptor", chai_assertOwnPropertyDescriptor);
|
|
11511
|
+
node_modules_chai_Assertion.addMethod("haveOwnPropertyDescriptor", chai_assertOwnPropertyDescriptor);
|
|
11512
|
+
function chai_assertLengthChain() {
|
|
11513
|
+
chai_flag2(this, "doLength", true);
|
|
11514
|
+
}
|
|
11515
|
+
chai_name(chai_assertLengthChain, "assertLengthChain");
|
|
11516
|
+
function chai_assertLength(n, msg) {
|
|
11517
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11518
|
+
let obj = chai_flag2(this, "object"), objType = node_modules_chai_type(obj).toLowerCase(), flagMsg = chai_flag2(this, "message"), ssfi = chai_flag2(this, "ssfi"), descriptor = "length", itemsCount;
|
|
11519
|
+
switch(objType){
|
|
11520
|
+
case "map":
|
|
11521
|
+
case "set":
|
|
11522
|
+
descriptor = "size";
|
|
11523
|
+
itemsCount = obj.size;
|
|
11524
|
+
break;
|
|
11525
|
+
default:
|
|
11526
|
+
new node_modules_chai_Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
11527
|
+
itemsCount = obj.length;
|
|
11528
|
+
}
|
|
11529
|
+
this.assert(itemsCount == n, "expected #{this} to have a " + descriptor + " of #{exp} but got #{act}", "expected #{this} to not have a " + descriptor + " of #{act}", n, itemsCount);
|
|
11530
|
+
}
|
|
11531
|
+
chai_name(chai_assertLength, "assertLength");
|
|
11532
|
+
node_modules_chai_Assertion.addChainableMethod("length", chai_assertLength, chai_assertLengthChain);
|
|
11533
|
+
node_modules_chai_Assertion.addChainableMethod("lengthOf", chai_assertLength, chai_assertLengthChain);
|
|
11534
|
+
function chai_assertMatch(re, msg) {
|
|
11535
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11536
|
+
let obj = chai_flag2(this, "object");
|
|
11537
|
+
this.assert(re.exec(obj), "expected #{this} to match " + re, "expected #{this} not to match " + re);
|
|
11538
|
+
}
|
|
11539
|
+
chai_name(chai_assertMatch, "assertMatch");
|
|
11540
|
+
node_modules_chai_Assertion.addMethod("match", chai_assertMatch);
|
|
11541
|
+
node_modules_chai_Assertion.addMethod("matches", chai_assertMatch);
|
|
11542
|
+
node_modules_chai_Assertion.addMethod("string", function(str, msg) {
|
|
11543
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11544
|
+
let obj = chai_flag2(this, "object"), flagMsg = chai_flag2(this, "message"), ssfi = chai_flag2(this, "ssfi");
|
|
11545
|
+
new node_modules_chai_Assertion(obj, flagMsg, ssfi, true).is.a("string");
|
|
11546
|
+
this.assert(~obj.indexOf(str), "expected #{this} to contain " + chai_inspect2(str), "expected #{this} to not contain " + chai_inspect2(str));
|
|
11547
|
+
});
|
|
11548
|
+
function chai_assertKeys(keys) {
|
|
11549
|
+
let obj = chai_flag2(this, "object"), objType = node_modules_chai_type(obj), keysType = node_modules_chai_type(keys), ssfi = chai_flag2(this, "ssfi"), isDeep = chai_flag2(this, "deep"), str, deepStr = "", actual, ok = true, flagMsg = chai_flag2(this, "message");
|
|
11550
|
+
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
11551
|
+
let mixedArgsMsg = flagMsg + "when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";
|
|
11552
|
+
if ("Map" === objType || "Set" === objType) {
|
|
11553
|
+
deepStr = isDeep ? "deeply " : "";
|
|
11554
|
+
actual = [];
|
|
11555
|
+
obj.forEach(function(val, key) {
|
|
11556
|
+
actual.push(key);
|
|
11557
|
+
});
|
|
11558
|
+
if ("Array" !== keysType) keys = Array.prototype.slice.call(arguments);
|
|
11559
|
+
} else {
|
|
11560
|
+
actual = chai_getOwnEnumerableProperties(obj);
|
|
11561
|
+
switch(keysType){
|
|
11562
|
+
case "Array":
|
|
11563
|
+
if (arguments.length > 1) throw new chai_6_2_2_node_modules_chai_AssertionError(mixedArgsMsg, void 0, ssfi);
|
|
11564
|
+
break;
|
|
11565
|
+
case "Object":
|
|
11566
|
+
if (arguments.length > 1) throw new chai_6_2_2_node_modules_chai_AssertionError(mixedArgsMsg, void 0, ssfi);
|
|
11567
|
+
keys = Object.keys(keys);
|
|
11568
|
+
break;
|
|
11569
|
+
default:
|
|
11570
|
+
keys = Array.prototype.slice.call(arguments);
|
|
11571
|
+
}
|
|
11572
|
+
keys = keys.map(function(val) {
|
|
11573
|
+
return "symbol" == typeof val ? val : String(val);
|
|
11574
|
+
});
|
|
11575
|
+
}
|
|
11576
|
+
if (!keys.length) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg + "keys required", void 0, ssfi);
|
|
11577
|
+
let len = keys.length, any = chai_flag2(this, "any"), all = chai_flag2(this, "all"), expected = keys, isEql = isDeep ? chai_flag2(this, "eql") : (val1, val2)=>val1 === val2;
|
|
11578
|
+
if (!any && !all) all = true;
|
|
11579
|
+
if (any) ok = expected.some(function(expectedKey) {
|
|
11580
|
+
return actual.some(function(actualKey) {
|
|
11581
|
+
return isEql(expectedKey, actualKey);
|
|
11582
|
+
});
|
|
11583
|
+
});
|
|
11584
|
+
if (all) {
|
|
11585
|
+
ok = expected.every(function(expectedKey) {
|
|
11586
|
+
return actual.some(function(actualKey) {
|
|
11587
|
+
return isEql(expectedKey, actualKey);
|
|
11588
|
+
});
|
|
11589
|
+
});
|
|
11590
|
+
if (!chai_flag2(this, "contains")) ok = ok && keys.length == actual.length;
|
|
11591
|
+
}
|
|
11592
|
+
if (len > 1) {
|
|
11593
|
+
keys = keys.map(function(key) {
|
|
11594
|
+
return chai_inspect2(key);
|
|
11595
|
+
});
|
|
11596
|
+
let last = keys.pop();
|
|
11597
|
+
if (all) str = keys.join(", ") + ", and " + last;
|
|
11598
|
+
if (any) str = keys.join(", ") + ", or " + last;
|
|
11599
|
+
} else str = chai_inspect2(keys[0]);
|
|
11600
|
+
str = (len > 1 ? "keys " : "key ") + str;
|
|
11601
|
+
str = (chai_flag2(this, "contains") ? "contain " : "have ") + str;
|
|
11602
|
+
this.assert(ok, "expected #{this} to " + deepStr + str, "expected #{this} to not " + deepStr + str, expected.slice(0).sort(chai_compareByInspect), actual.sort(chai_compareByInspect), true);
|
|
11603
|
+
}
|
|
11604
|
+
chai_name(chai_assertKeys, "assertKeys");
|
|
11605
|
+
node_modules_chai_Assertion.addMethod("keys", chai_assertKeys);
|
|
11606
|
+
node_modules_chai_Assertion.addMethod("key", chai_assertKeys);
|
|
11607
|
+
function chai_assertThrows(errorLike, errMsgMatcher, msg) {
|
|
11608
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11609
|
+
let obj = chai_flag2(this, "object"), ssfi = chai_flag2(this, "ssfi"), flagMsg = chai_flag2(this, "message"), negate = chai_flag2(this, "negate") || false;
|
|
11610
|
+
new node_modules_chai_Assertion(obj, flagMsg, ssfi, true).is.a("function");
|
|
11611
|
+
if (chai_isRegExp2(errorLike) || "string" == typeof errorLike) {
|
|
11612
|
+
errMsgMatcher = errorLike;
|
|
11613
|
+
errorLike = null;
|
|
11614
|
+
}
|
|
11615
|
+
let caughtErr;
|
|
11616
|
+
let errorWasThrown = false;
|
|
11617
|
+
try {
|
|
11618
|
+
obj();
|
|
11619
|
+
} catch (err) {
|
|
11620
|
+
errorWasThrown = true;
|
|
11621
|
+
caughtErr = err;
|
|
11622
|
+
}
|
|
11623
|
+
let everyArgIsUndefined = void 0 === errorLike && void 0 === errMsgMatcher;
|
|
11624
|
+
let everyArgIsDefined = Boolean(errorLike && errMsgMatcher);
|
|
11625
|
+
let errorLikeFail = false;
|
|
11626
|
+
let errMsgMatcherFail = false;
|
|
11627
|
+
if (everyArgIsUndefined || !everyArgIsUndefined && !negate) {
|
|
11628
|
+
let errorLikeString = "an error";
|
|
11629
|
+
if (errorLike instanceof Error) errorLikeString = "#{exp}";
|
|
11630
|
+
else if (errorLike) errorLikeString = chai_check_error_exports.getConstructorName(errorLike);
|
|
11631
|
+
let actual = caughtErr;
|
|
11632
|
+
if (caughtErr instanceof Error) actual = caughtErr.toString();
|
|
11633
|
+
else if ("string" == typeof caughtErr) actual = caughtErr;
|
|
11634
|
+
else if (caughtErr && ("object" == typeof caughtErr || "function" == typeof caughtErr)) try {
|
|
11635
|
+
actual = chai_check_error_exports.getConstructorName(caughtErr);
|
|
11636
|
+
} catch (_err) {}
|
|
11637
|
+
this.assert(errorWasThrown, "expected #{this} to throw " + errorLikeString, "expected #{this} to not throw an error but #{act} was thrown", errorLike && errorLike.toString(), actual);
|
|
11638
|
+
}
|
|
11639
|
+
if (errorLike && caughtErr) {
|
|
11640
|
+
if (errorLike instanceof Error) {
|
|
11641
|
+
let isCompatibleInstance = chai_check_error_exports.compatibleInstance(caughtErr, errorLike);
|
|
11642
|
+
if (isCompatibleInstance === negate) if (everyArgIsDefined && negate) errorLikeFail = true;
|
|
11643
|
+
else this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr && !negate ? " but #{act} was thrown" : ""), errorLike.toString(), caughtErr.toString());
|
|
11644
|
+
}
|
|
11645
|
+
let isCompatibleConstructor = chai_check_error_exports.compatibleConstructor(caughtErr, errorLike);
|
|
11646
|
+
if (isCompatibleConstructor === negate) if (everyArgIsDefined && negate) errorLikeFail = true;
|
|
11647
|
+
else this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), errorLike instanceof Error ? errorLike.toString() : errorLike && chai_check_error_exports.getConstructorName(errorLike), caughtErr instanceof Error ? caughtErr.toString() : caughtErr && chai_check_error_exports.getConstructorName(caughtErr));
|
|
11648
|
+
}
|
|
11649
|
+
if (caughtErr && null != errMsgMatcher) {
|
|
11650
|
+
let placeholder = "including";
|
|
11651
|
+
if (chai_isRegExp2(errMsgMatcher)) placeholder = "matching";
|
|
11652
|
+
let isCompatibleMessage = chai_check_error_exports.compatibleMessage(caughtErr, errMsgMatcher);
|
|
11653
|
+
if (isCompatibleMessage === negate) if (everyArgIsDefined && negate) errMsgMatcherFail = true;
|
|
11654
|
+
else this.assert(negate, "expected #{this} to throw error " + placeholder + " #{exp} but got #{act}", "expected #{this} to throw error not " + placeholder + " #{exp}", errMsgMatcher, chai_check_error_exports.getMessage(caughtErr));
|
|
11655
|
+
}
|
|
11656
|
+
if (errorLikeFail && errMsgMatcherFail) this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), errorLike instanceof Error ? errorLike.toString() : errorLike && chai_check_error_exports.getConstructorName(errorLike), caughtErr instanceof Error ? caughtErr.toString() : caughtErr && chai_check_error_exports.getConstructorName(caughtErr));
|
|
11657
|
+
chai_flag2(this, "object", caughtErr);
|
|
11658
|
+
}
|
|
11659
|
+
chai_name(chai_assertThrows, "assertThrows");
|
|
11660
|
+
node_modules_chai_Assertion.addMethod("throw", chai_assertThrows);
|
|
11661
|
+
node_modules_chai_Assertion.addMethod("throws", chai_assertThrows);
|
|
11662
|
+
node_modules_chai_Assertion.addMethod("Throw", chai_assertThrows);
|
|
11663
|
+
function chai_respondTo(method, msg) {
|
|
11664
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11665
|
+
let obj = chai_flag2(this, "object"), itself = chai_flag2(this, "itself"), context = "function" != typeof obj || itself ? obj[method] : obj.prototype[method];
|
|
11666
|
+
this.assert("function" == typeof context, "expected #{this} to respond to " + chai_inspect2(method), "expected #{this} to not respond to " + chai_inspect2(method));
|
|
11667
|
+
}
|
|
11668
|
+
chai_name(chai_respondTo, "respondTo");
|
|
11669
|
+
node_modules_chai_Assertion.addMethod("respondTo", chai_respondTo);
|
|
11670
|
+
node_modules_chai_Assertion.addMethod("respondsTo", chai_respondTo);
|
|
11671
|
+
node_modules_chai_Assertion.addProperty("itself", function() {
|
|
11672
|
+
chai_flag2(this, "itself", true);
|
|
11673
|
+
});
|
|
11674
|
+
function chai_satisfy(matcher, msg) {
|
|
11675
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11676
|
+
let obj = chai_flag2(this, "object");
|
|
11677
|
+
let result = matcher(obj);
|
|
11678
|
+
this.assert(result, "expected #{this} to satisfy " + node_modules_chai_objDisplay(matcher), "expected #{this} to not satisfy" + node_modules_chai_objDisplay(matcher), !chai_flag2(this, "negate"), result);
|
|
11679
|
+
}
|
|
11680
|
+
chai_name(chai_satisfy, "satisfy");
|
|
11681
|
+
node_modules_chai_Assertion.addMethod("satisfy", chai_satisfy);
|
|
11682
|
+
node_modules_chai_Assertion.addMethod("satisfies", chai_satisfy);
|
|
11683
|
+
function chai_closeTo(expected, delta, msg) {
|
|
11684
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11685
|
+
let obj = chai_flag2(this, "object"), flagMsg = chai_flag2(this, "message"), ssfi = chai_flag2(this, "ssfi");
|
|
11686
|
+
new node_modules_chai_Assertion(obj, flagMsg, ssfi, true).is.numeric;
|
|
11687
|
+
let message = "A `delta` value is required for `closeTo`";
|
|
11688
|
+
if (void 0 == delta) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg ? `${flagMsg}: ${message}` : message, void 0, ssfi);
|
|
11689
|
+
new node_modules_chai_Assertion(delta, flagMsg, ssfi, true).is.numeric;
|
|
11690
|
+
message = "A `expected` value is required for `closeTo`";
|
|
11691
|
+
if (void 0 == expected) throw new chai_6_2_2_node_modules_chai_AssertionError(flagMsg ? `${flagMsg}: ${message}` : message, void 0, ssfi);
|
|
11692
|
+
new node_modules_chai_Assertion(expected, flagMsg, ssfi, true).is.numeric;
|
|
11693
|
+
const abs = /* @__PURE__ */ chai_name((x)=>x < 0 ? -x : x, "abs");
|
|
11694
|
+
const strip = /* @__PURE__ */ chai_name((number)=>parseFloat(parseFloat(number).toPrecision(12)), "strip");
|
|
11695
|
+
this.assert(strip(abs(obj - expected)) <= delta, "expected #{this} to be close to " + expected + " +/- " + delta, "expected #{this} not to be close to " + expected + " +/- " + delta);
|
|
11696
|
+
}
|
|
11697
|
+
chai_name(chai_closeTo, "closeTo");
|
|
11698
|
+
node_modules_chai_Assertion.addMethod("closeTo", chai_closeTo);
|
|
11699
|
+
node_modules_chai_Assertion.addMethod("approximately", chai_closeTo);
|
|
11700
|
+
function chai_isSubsetOf(_subset, _superset, cmp, contains, ordered) {
|
|
11701
|
+
let superset = Array.from(_superset);
|
|
11702
|
+
let subset = Array.from(_subset);
|
|
11703
|
+
if (!contains) {
|
|
11704
|
+
if (subset.length !== superset.length) return false;
|
|
11705
|
+
superset = superset.slice();
|
|
11706
|
+
}
|
|
11707
|
+
return subset.every(function(elem, idx) {
|
|
11708
|
+
if (ordered) return cmp ? cmp(elem, superset[idx]) : elem === superset[idx];
|
|
11709
|
+
if (!cmp) {
|
|
11710
|
+
let matchIdx = superset.indexOf(elem);
|
|
11711
|
+
if (-1 === matchIdx) return false;
|
|
11712
|
+
if (!contains) superset.splice(matchIdx, 1);
|
|
11713
|
+
return true;
|
|
11714
|
+
}
|
|
11715
|
+
return superset.some(function(elem2, matchIdx) {
|
|
11716
|
+
if (!cmp(elem, elem2)) return false;
|
|
11717
|
+
if (!contains) superset.splice(matchIdx, 1);
|
|
11718
|
+
return true;
|
|
11719
|
+
});
|
|
11720
|
+
});
|
|
11721
|
+
}
|
|
11722
|
+
chai_name(chai_isSubsetOf, "isSubsetOf");
|
|
11723
|
+
node_modules_chai_Assertion.addMethod("members", function(subset, msg) {
|
|
11724
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11725
|
+
let obj = chai_flag2(this, "object"), flagMsg = chai_flag2(this, "message"), ssfi = chai_flag2(this, "ssfi");
|
|
11726
|
+
new node_modules_chai_Assertion(obj, flagMsg, ssfi, true).to.be.iterable;
|
|
11727
|
+
new node_modules_chai_Assertion(subset, flagMsg, ssfi, true).to.be.iterable;
|
|
11728
|
+
let contains = chai_flag2(this, "contains");
|
|
11729
|
+
let ordered = chai_flag2(this, "ordered");
|
|
11730
|
+
let subject, failMsg, failNegateMsg;
|
|
11731
|
+
if (contains) {
|
|
11732
|
+
subject = ordered ? "an ordered superset" : "a superset";
|
|
11733
|
+
failMsg = "expected #{this} to be " + subject + " of #{exp}";
|
|
11734
|
+
failNegateMsg = "expected #{this} to not be " + subject + " of #{exp}";
|
|
11735
|
+
} else {
|
|
11736
|
+
subject = ordered ? "ordered members" : "members";
|
|
11737
|
+
failMsg = "expected #{this} to have the same " + subject + " as #{exp}";
|
|
11738
|
+
failNegateMsg = "expected #{this} to not have the same " + subject + " as #{exp}";
|
|
11739
|
+
}
|
|
11740
|
+
let cmp = chai_flag2(this, "deep") ? chai_flag2(this, "eql") : void 0;
|
|
11741
|
+
this.assert(chai_isSubsetOf(subset, obj, cmp, contains, ordered), failMsg, failNegateMsg, subset, obj, true);
|
|
11742
|
+
});
|
|
11743
|
+
node_modules_chai_Assertion.addProperty("iterable", function(msg) {
|
|
11744
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11745
|
+
let obj = chai_flag2(this, "object");
|
|
11746
|
+
this.assert(void 0 != obj && obj[Symbol.iterator], "expected #{this} to be an iterable", "expected #{this} to not be an iterable", obj);
|
|
11747
|
+
});
|
|
11748
|
+
function chai_oneOf(list, msg) {
|
|
11749
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11750
|
+
let expected = chai_flag2(this, "object"), flagMsg = chai_flag2(this, "message"), ssfi = chai_flag2(this, "ssfi"), contains = chai_flag2(this, "contains"), isDeep = chai_flag2(this, "deep"), eql = chai_flag2(this, "eql");
|
|
11751
|
+
new node_modules_chai_Assertion(list, flagMsg, ssfi, true).to.be.an("array");
|
|
11752
|
+
if (contains) this.assert(list.some(function(possibility) {
|
|
11753
|
+
return expected.indexOf(possibility) > -1;
|
|
11754
|
+
}), "expected #{this} to contain one of #{exp}", "expected #{this} to not contain one of #{exp}", list, expected);
|
|
11755
|
+
else if (isDeep) this.assert(list.some(function(possibility) {
|
|
11756
|
+
return eql(expected, possibility);
|
|
11757
|
+
}), "expected #{this} to deeply equal one of #{exp}", "expected #{this} to deeply equal one of #{exp}", list, expected);
|
|
11758
|
+
else this.assert(list.indexOf(expected) > -1, "expected #{this} to be one of #{exp}", "expected #{this} to not be one of #{exp}", list, expected);
|
|
11759
|
+
}
|
|
11760
|
+
chai_name(chai_oneOf, "oneOf");
|
|
11761
|
+
node_modules_chai_Assertion.addMethod("oneOf", chai_oneOf);
|
|
11762
|
+
function chai_assertChanges(subject, prop, msg) {
|
|
11763
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11764
|
+
let fn = chai_flag2(this, "object"), flagMsg = chai_flag2(this, "message"), ssfi = chai_flag2(this, "ssfi");
|
|
11765
|
+
new node_modules_chai_Assertion(fn, flagMsg, ssfi, true).is.a("function");
|
|
11766
|
+
let initial;
|
|
11767
|
+
if (prop) {
|
|
11768
|
+
new node_modules_chai_Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
|
|
11769
|
+
initial = subject[prop];
|
|
11770
|
+
} else {
|
|
11771
|
+
new node_modules_chai_Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
11772
|
+
initial = subject();
|
|
11773
|
+
}
|
|
11774
|
+
fn();
|
|
11775
|
+
let final = null == prop ? subject() : subject[prop];
|
|
11776
|
+
let msgObj = null == prop ? initial : "." + prop;
|
|
11777
|
+
chai_flag2(this, "deltaMsgObj", msgObj);
|
|
11778
|
+
chai_flag2(this, "initialDeltaValue", initial);
|
|
11779
|
+
chai_flag2(this, "finalDeltaValue", final);
|
|
11780
|
+
chai_flag2(this, "deltaBehavior", "change");
|
|
11781
|
+
chai_flag2(this, "realDelta", final !== initial);
|
|
11782
|
+
this.assert(initial !== final, "expected " + msgObj + " to change", "expected " + msgObj + " to not change");
|
|
11783
|
+
}
|
|
11784
|
+
chai_name(chai_assertChanges, "assertChanges");
|
|
11785
|
+
node_modules_chai_Assertion.addMethod("change", chai_assertChanges);
|
|
11786
|
+
node_modules_chai_Assertion.addMethod("changes", chai_assertChanges);
|
|
11787
|
+
function chai_assertIncreases(subject, prop, msg) {
|
|
11788
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11789
|
+
let fn = chai_flag2(this, "object"), flagMsg = chai_flag2(this, "message"), ssfi = chai_flag2(this, "ssfi");
|
|
11790
|
+
new node_modules_chai_Assertion(fn, flagMsg, ssfi, true).is.a("function");
|
|
11791
|
+
let initial;
|
|
11792
|
+
if (prop) {
|
|
11793
|
+
new node_modules_chai_Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
|
|
11794
|
+
initial = subject[prop];
|
|
11795
|
+
} else {
|
|
11796
|
+
new node_modules_chai_Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
11797
|
+
initial = subject();
|
|
11798
|
+
}
|
|
11799
|
+
new node_modules_chai_Assertion(initial, flagMsg, ssfi, true).is.a("number");
|
|
11800
|
+
fn();
|
|
11801
|
+
let final = null == prop ? subject() : subject[prop];
|
|
11802
|
+
let msgObj = null == prop ? initial : "." + prop;
|
|
11803
|
+
chai_flag2(this, "deltaMsgObj", msgObj);
|
|
11804
|
+
chai_flag2(this, "initialDeltaValue", initial);
|
|
11805
|
+
chai_flag2(this, "finalDeltaValue", final);
|
|
11806
|
+
chai_flag2(this, "deltaBehavior", "increase");
|
|
11807
|
+
chai_flag2(this, "realDelta", final - initial);
|
|
11808
|
+
this.assert(final - initial > 0, "expected " + msgObj + " to increase", "expected " + msgObj + " to not increase");
|
|
11809
|
+
}
|
|
11810
|
+
chai_name(chai_assertIncreases, "assertIncreases");
|
|
11811
|
+
node_modules_chai_Assertion.addMethod("increase", chai_assertIncreases);
|
|
11812
|
+
node_modules_chai_Assertion.addMethod("increases", chai_assertIncreases);
|
|
11813
|
+
function chai_assertDecreases(subject, prop, msg) {
|
|
11814
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11815
|
+
let fn = chai_flag2(this, "object"), flagMsg = chai_flag2(this, "message"), ssfi = chai_flag2(this, "ssfi");
|
|
11816
|
+
new node_modules_chai_Assertion(fn, flagMsg, ssfi, true).is.a("function");
|
|
11817
|
+
let initial;
|
|
11818
|
+
if (prop) {
|
|
11819
|
+
new node_modules_chai_Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
|
|
11820
|
+
initial = subject[prop];
|
|
11821
|
+
} else {
|
|
11822
|
+
new node_modules_chai_Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
11823
|
+
initial = subject();
|
|
11824
|
+
}
|
|
11825
|
+
new node_modules_chai_Assertion(initial, flagMsg, ssfi, true).is.a("number");
|
|
11826
|
+
fn();
|
|
11827
|
+
let final = null == prop ? subject() : subject[prop];
|
|
11828
|
+
let msgObj = null == prop ? initial : "." + prop;
|
|
11829
|
+
chai_flag2(this, "deltaMsgObj", msgObj);
|
|
11830
|
+
chai_flag2(this, "initialDeltaValue", initial);
|
|
11831
|
+
chai_flag2(this, "finalDeltaValue", final);
|
|
11832
|
+
chai_flag2(this, "deltaBehavior", "decrease");
|
|
11833
|
+
chai_flag2(this, "realDelta", initial - final);
|
|
11834
|
+
this.assert(final - initial < 0, "expected " + msgObj + " to decrease", "expected " + msgObj + " to not decrease");
|
|
11835
|
+
}
|
|
11836
|
+
chai_name(chai_assertDecreases, "assertDecreases");
|
|
11837
|
+
node_modules_chai_Assertion.addMethod("decrease", chai_assertDecreases);
|
|
11838
|
+
node_modules_chai_Assertion.addMethod("decreases", chai_assertDecreases);
|
|
11839
|
+
function chai_assertDelta(delta, msg) {
|
|
11840
|
+
if (msg) chai_flag2(this, "message", msg);
|
|
11841
|
+
let msgObj = chai_flag2(this, "deltaMsgObj");
|
|
11842
|
+
let initial = chai_flag2(this, "initialDeltaValue");
|
|
11843
|
+
let final = chai_flag2(this, "finalDeltaValue");
|
|
11844
|
+
let behavior = chai_flag2(this, "deltaBehavior");
|
|
11845
|
+
let realDelta = chai_flag2(this, "realDelta");
|
|
11846
|
+
let expression;
|
|
11847
|
+
expression = "change" === behavior ? Math.abs(final - initial) === Math.abs(delta) : realDelta === Math.abs(delta);
|
|
11848
|
+
this.assert(expression, "expected " + msgObj + " to " + behavior + " by " + delta, "expected " + msgObj + " to not " + behavior + " by " + delta);
|
|
11849
|
+
}
|
|
11850
|
+
chai_name(chai_assertDelta, "assertDelta");
|
|
11851
|
+
node_modules_chai_Assertion.addMethod("by", chai_assertDelta);
|
|
11852
|
+
node_modules_chai_Assertion.addProperty("extensible", function() {
|
|
11853
|
+
let obj = chai_flag2(this, "object");
|
|
11854
|
+
let isExtensible = obj === Object(obj) && Object.isExtensible(obj);
|
|
11855
|
+
this.assert(isExtensible, "expected #{this} to be extensible", "expected #{this} to not be extensible");
|
|
11856
|
+
});
|
|
11857
|
+
node_modules_chai_Assertion.addProperty("sealed", function() {
|
|
11858
|
+
let obj = chai_flag2(this, "object");
|
|
11859
|
+
let isSealed = obj === Object(obj) ? Object.isSealed(obj) : true;
|
|
11860
|
+
this.assert(isSealed, "expected #{this} to be sealed", "expected #{this} to not be sealed");
|
|
11861
|
+
});
|
|
11862
|
+
node_modules_chai_Assertion.addProperty("frozen", function() {
|
|
11863
|
+
let obj = chai_flag2(this, "object");
|
|
11864
|
+
let isFrozen = obj === Object(obj) ? Object.isFrozen(obj) : true;
|
|
11865
|
+
this.assert(isFrozen, "expected #{this} to be frozen", "expected #{this} to not be frozen");
|
|
11866
|
+
});
|
|
11867
|
+
node_modules_chai_Assertion.addProperty("finite", function(_msg) {
|
|
11868
|
+
let obj = chai_flag2(this, "object");
|
|
11869
|
+
this.assert("number" == typeof obj && isFinite(obj), "expected #{this} to be a finite number", "expected #{this} to not be a finite number");
|
|
11870
|
+
});
|
|
11871
|
+
function chai_compareSubset(expected, actual) {
|
|
11872
|
+
if (expected === actual) return true;
|
|
11873
|
+
if (typeof actual !== typeof expected) return false;
|
|
11874
|
+
if ("object" != typeof expected || null === expected) return expected === actual;
|
|
11875
|
+
if (!actual) return false;
|
|
11876
|
+
if (Array.isArray(expected)) {
|
|
11877
|
+
if (!Array.isArray(actual)) return false;
|
|
11878
|
+
return expected.every(function(exp) {
|
|
11879
|
+
return actual.some(function(act) {
|
|
11880
|
+
return chai_compareSubset(exp, act);
|
|
11881
|
+
});
|
|
11882
|
+
});
|
|
11883
|
+
}
|
|
11884
|
+
if (expected instanceof Date) if (actual instanceof Date) return expected.getTime() === actual.getTime();
|
|
11885
|
+
else return false;
|
|
11886
|
+
return Object.keys(expected).every(function(key) {
|
|
11887
|
+
let expectedValue = expected[key];
|
|
11888
|
+
let actualValue = actual[key];
|
|
11889
|
+
if ("object" == typeof expectedValue && null !== expectedValue && null !== actualValue) return chai_compareSubset(expectedValue, actualValue);
|
|
11890
|
+
if ("function" == typeof expectedValue) return expectedValue(actualValue);
|
|
11891
|
+
return actualValue === expectedValue;
|
|
11892
|
+
});
|
|
11893
|
+
}
|
|
11894
|
+
chai_name(chai_compareSubset, "compareSubset");
|
|
11895
|
+
node_modules_chai_Assertion.addMethod("containSubset", function(expected) {
|
|
11896
|
+
const actual = chai_flag(this, "object");
|
|
11897
|
+
const showDiff = node_modules_chai_config.showDiff;
|
|
11898
|
+
this.assert(chai_compareSubset(expected, actual), "expected #{act} to contain subset #{exp}", "expected #{act} to not contain subset #{exp}", expected, actual, showDiff);
|
|
11899
|
+
});
|
|
11900
|
+
function node_modules_chai_expect(val, message) {
|
|
11901
|
+
return new node_modules_chai_Assertion(val, message);
|
|
11902
|
+
}
|
|
11903
|
+
chai_name(node_modules_chai_expect, "expect");
|
|
11904
|
+
node_modules_chai_expect.fail = function(actual, expected, message, operator) {
|
|
11905
|
+
if (arguments.length < 2) {
|
|
11906
|
+
message = actual;
|
|
11907
|
+
actual = void 0;
|
|
11908
|
+
}
|
|
11909
|
+
message = message || "expect.fail()";
|
|
11910
|
+
throw new chai_6_2_2_node_modules_chai_AssertionError(message, {
|
|
11911
|
+
actual,
|
|
11912
|
+
expected,
|
|
11913
|
+
operator
|
|
11914
|
+
}, node_modules_chai_expect.fail);
|
|
11915
|
+
};
|
|
11916
|
+
var chai_should_exports = {};
|
|
11917
|
+
chai_export(chai_should_exports, {
|
|
11918
|
+
Should: ()=>chai_Should,
|
|
11919
|
+
should: ()=>chai_should
|
|
11920
|
+
});
|
|
11921
|
+
function chai_loadShould() {
|
|
11922
|
+
function shouldGetter() {
|
|
11923
|
+
if (this instanceof String || this instanceof Number || this instanceof Boolean || "function" == typeof Symbol && this instanceof Symbol || "function" == typeof BigInt && this instanceof BigInt) return new node_modules_chai_Assertion(this.valueOf(), null, shouldGetter);
|
|
11924
|
+
return new node_modules_chai_Assertion(this, null, shouldGetter);
|
|
11925
|
+
}
|
|
11926
|
+
chai_name(shouldGetter, "shouldGetter");
|
|
11927
|
+
function shouldSetter(value) {
|
|
11928
|
+
Object.defineProperty(this, "should", {
|
|
11929
|
+
value,
|
|
11930
|
+
enumerable: true,
|
|
11931
|
+
configurable: true,
|
|
11932
|
+
writable: true
|
|
11933
|
+
});
|
|
11934
|
+
}
|
|
11935
|
+
chai_name(shouldSetter, "shouldSetter");
|
|
11936
|
+
Object.defineProperty(Object.prototype, "should", {
|
|
11937
|
+
set: shouldSetter,
|
|
11938
|
+
get: shouldGetter,
|
|
11939
|
+
configurable: true
|
|
11940
|
+
});
|
|
11941
|
+
let should2 = {};
|
|
11942
|
+
should2.fail = function(actual, expected, message, operator) {
|
|
11943
|
+
if (arguments.length < 2) {
|
|
11944
|
+
message = actual;
|
|
11945
|
+
actual = void 0;
|
|
11946
|
+
}
|
|
11947
|
+
message = message || "should.fail()";
|
|
11948
|
+
throw new chai_6_2_2_node_modules_chai_AssertionError(message, {
|
|
11949
|
+
actual,
|
|
11950
|
+
expected,
|
|
11951
|
+
operator
|
|
11952
|
+
}, should2.fail);
|
|
11953
|
+
};
|
|
11954
|
+
should2.equal = function(actual, expected, message) {
|
|
11955
|
+
new node_modules_chai_Assertion(actual, message).to.equal(expected);
|
|
11956
|
+
};
|
|
11957
|
+
should2.Throw = function(fn, errt, errs, msg) {
|
|
11958
|
+
new node_modules_chai_Assertion(fn, msg).to.Throw(errt, errs);
|
|
11959
|
+
};
|
|
11960
|
+
should2.exist = function(val, msg) {
|
|
11961
|
+
new node_modules_chai_Assertion(val, msg).to.exist;
|
|
11962
|
+
};
|
|
11963
|
+
should2.not = {};
|
|
11964
|
+
should2.not.equal = function(actual, expected, msg) {
|
|
11965
|
+
new node_modules_chai_Assertion(actual, msg).to.not.equal(expected);
|
|
11966
|
+
};
|
|
11967
|
+
should2.not.Throw = function(fn, errt, errs, msg) {
|
|
11968
|
+
new node_modules_chai_Assertion(fn, msg).to.not.Throw(errt, errs);
|
|
11969
|
+
};
|
|
11970
|
+
should2.not.exist = function(val, msg) {
|
|
11971
|
+
new node_modules_chai_Assertion(val, msg).to.not.exist;
|
|
11972
|
+
};
|
|
11973
|
+
should2["throw"] = should2["Throw"];
|
|
11974
|
+
should2.not["throw"] = should2.not["Throw"];
|
|
11975
|
+
return should2;
|
|
11976
|
+
}
|
|
11977
|
+
chai_name(chai_loadShould, "loadShould");
|
|
11978
|
+
var chai_should = chai_loadShould;
|
|
11979
|
+
var chai_Should = chai_loadShould;
|
|
11980
|
+
function node_modules_chai_assert(express, errmsg) {
|
|
11981
|
+
let test2 = new node_modules_chai_Assertion(null, null, node_modules_chai_assert, true);
|
|
11982
|
+
test2.assert(express, errmsg, "[ negation message unavailable ]");
|
|
11983
|
+
}
|
|
11984
|
+
chai_name(node_modules_chai_assert, "assert");
|
|
11985
|
+
node_modules_chai_assert.fail = function(actual, expected, message, operator) {
|
|
11986
|
+
if (arguments.length < 2) {
|
|
11987
|
+
message = actual;
|
|
11988
|
+
actual = void 0;
|
|
11989
|
+
}
|
|
11990
|
+
message = message || "assert.fail()";
|
|
11991
|
+
throw new chai_6_2_2_node_modules_chai_AssertionError(message, {
|
|
11992
|
+
actual,
|
|
11993
|
+
expected,
|
|
11994
|
+
operator
|
|
11995
|
+
}, node_modules_chai_assert.fail);
|
|
11996
|
+
};
|
|
11997
|
+
node_modules_chai_assert.isOk = function(val, msg) {
|
|
11998
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isOk, true).is.ok;
|
|
11999
|
+
};
|
|
12000
|
+
node_modules_chai_assert.isNotOk = function(val, msg) {
|
|
12001
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotOk, true).is.not.ok;
|
|
12002
|
+
};
|
|
12003
|
+
node_modules_chai_assert.equal = function(act, exp, msg) {
|
|
12004
|
+
let test2 = new node_modules_chai_Assertion(act, msg, node_modules_chai_assert.equal, true);
|
|
12005
|
+
test2.assert(exp == chai_flag(test2, "object"), "expected #{this} to equal #{exp}", "expected #{this} to not equal #{act}", exp, act, true);
|
|
12006
|
+
};
|
|
12007
|
+
node_modules_chai_assert.notEqual = function(act, exp, msg) {
|
|
12008
|
+
let test2 = new node_modules_chai_Assertion(act, msg, node_modules_chai_assert.notEqual, true);
|
|
12009
|
+
test2.assert(exp != chai_flag(test2, "object"), "expected #{this} to not equal #{exp}", "expected #{this} to equal #{act}", exp, act, true);
|
|
12010
|
+
};
|
|
12011
|
+
node_modules_chai_assert.strictEqual = function(act, exp, msg) {
|
|
12012
|
+
new node_modules_chai_Assertion(act, msg, node_modules_chai_assert.strictEqual, true).to.equal(exp);
|
|
12013
|
+
};
|
|
12014
|
+
node_modules_chai_assert.notStrictEqual = function(act, exp, msg) {
|
|
12015
|
+
new node_modules_chai_Assertion(act, msg, node_modules_chai_assert.notStrictEqual, true).to.not.equal(exp);
|
|
12016
|
+
};
|
|
12017
|
+
node_modules_chai_assert.deepEqual = node_modules_chai_assert.deepStrictEqual = function(act, exp, msg) {
|
|
12018
|
+
new node_modules_chai_Assertion(act, msg, node_modules_chai_assert.deepEqual, true).to.eql(exp);
|
|
12019
|
+
};
|
|
12020
|
+
node_modules_chai_assert.notDeepEqual = function(act, exp, msg) {
|
|
12021
|
+
new node_modules_chai_Assertion(act, msg, node_modules_chai_assert.notDeepEqual, true).to.not.eql(exp);
|
|
12022
|
+
};
|
|
12023
|
+
node_modules_chai_assert.isAbove = function(val, abv, msg) {
|
|
12024
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isAbove, true).to.be.above(abv);
|
|
12025
|
+
};
|
|
12026
|
+
node_modules_chai_assert.isAtLeast = function(val, atlst, msg) {
|
|
12027
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isAtLeast, true).to.be.least(atlst);
|
|
12028
|
+
};
|
|
12029
|
+
node_modules_chai_assert.isBelow = function(val, blw, msg) {
|
|
12030
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isBelow, true).to.be.below(blw);
|
|
12031
|
+
};
|
|
12032
|
+
node_modules_chai_assert.isAtMost = function(val, atmst, msg) {
|
|
12033
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isAtMost, true).to.be.most(atmst);
|
|
12034
|
+
};
|
|
12035
|
+
node_modules_chai_assert.isTrue = function(val, msg) {
|
|
12036
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isTrue, true).is["true"];
|
|
12037
|
+
};
|
|
12038
|
+
node_modules_chai_assert.isNotTrue = function(val, msg) {
|
|
12039
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotTrue, true).to.not.equal(true);
|
|
12040
|
+
};
|
|
12041
|
+
node_modules_chai_assert.isFalse = function(val, msg) {
|
|
12042
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isFalse, true).is["false"];
|
|
12043
|
+
};
|
|
12044
|
+
node_modules_chai_assert.isNotFalse = function(val, msg) {
|
|
12045
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotFalse, true).to.not.equal(false);
|
|
12046
|
+
};
|
|
12047
|
+
node_modules_chai_assert.isNull = function(val, msg) {
|
|
12048
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNull, true).to.equal(null);
|
|
12049
|
+
};
|
|
12050
|
+
node_modules_chai_assert.isNotNull = function(val, msg) {
|
|
12051
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotNull, true).to.not.equal(null);
|
|
12052
|
+
};
|
|
12053
|
+
node_modules_chai_assert.isNaN = function(val, msg) {
|
|
12054
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNaN, true).to.be.NaN;
|
|
12055
|
+
};
|
|
12056
|
+
node_modules_chai_assert.isNotNaN = function(value, message) {
|
|
12057
|
+
new node_modules_chai_Assertion(value, message, node_modules_chai_assert.isNotNaN, true).not.to.be.NaN;
|
|
12058
|
+
};
|
|
12059
|
+
node_modules_chai_assert.exists = function(val, msg) {
|
|
12060
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.exists, true).to.exist;
|
|
12061
|
+
};
|
|
12062
|
+
node_modules_chai_assert.notExists = function(val, msg) {
|
|
12063
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.notExists, true).to.not.exist;
|
|
12064
|
+
};
|
|
12065
|
+
node_modules_chai_assert.isUndefined = function(val, msg) {
|
|
12066
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isUndefined, true).to.equal(void 0);
|
|
12067
|
+
};
|
|
12068
|
+
node_modules_chai_assert.isDefined = function(val, msg) {
|
|
12069
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isDefined, true).to.not.equal(void 0);
|
|
12070
|
+
};
|
|
12071
|
+
node_modules_chai_assert.isCallable = function(value, message) {
|
|
12072
|
+
new node_modules_chai_Assertion(value, message, node_modules_chai_assert.isCallable, true).is.callable;
|
|
12073
|
+
};
|
|
12074
|
+
node_modules_chai_assert.isNotCallable = function(value, message) {
|
|
12075
|
+
new node_modules_chai_Assertion(value, message, node_modules_chai_assert.isNotCallable, true).is.not.callable;
|
|
12076
|
+
};
|
|
12077
|
+
node_modules_chai_assert.isObject = function(val, msg) {
|
|
12078
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isObject, true).to.be.a("object");
|
|
12079
|
+
};
|
|
12080
|
+
node_modules_chai_assert.isNotObject = function(val, msg) {
|
|
12081
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotObject, true).to.not.be.a("object");
|
|
12082
|
+
};
|
|
12083
|
+
node_modules_chai_assert.isArray = function(val, msg) {
|
|
12084
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isArray, true).to.be.an("array");
|
|
12085
|
+
};
|
|
12086
|
+
node_modules_chai_assert.isNotArray = function(val, msg) {
|
|
12087
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotArray, true).to.not.be.an("array");
|
|
12088
|
+
};
|
|
12089
|
+
node_modules_chai_assert.isString = function(val, msg) {
|
|
12090
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isString, true).to.be.a("string");
|
|
12091
|
+
};
|
|
12092
|
+
node_modules_chai_assert.isNotString = function(val, msg) {
|
|
12093
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotString, true).to.not.be.a("string");
|
|
12094
|
+
};
|
|
12095
|
+
node_modules_chai_assert.isNumber = function(val, msg) {
|
|
12096
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNumber, true).to.be.a("number");
|
|
12097
|
+
};
|
|
12098
|
+
node_modules_chai_assert.isNotNumber = function(val, msg) {
|
|
12099
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotNumber, true).to.not.be.a("number");
|
|
12100
|
+
};
|
|
12101
|
+
node_modules_chai_assert.isNumeric = function(val, msg) {
|
|
12102
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNumeric, true).is.numeric;
|
|
12103
|
+
};
|
|
12104
|
+
node_modules_chai_assert.isNotNumeric = function(val, msg) {
|
|
12105
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotNumeric, true).is.not.numeric;
|
|
12106
|
+
};
|
|
12107
|
+
node_modules_chai_assert.isFinite = function(val, msg) {
|
|
12108
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isFinite, true).to.be.finite;
|
|
12109
|
+
};
|
|
12110
|
+
node_modules_chai_assert.isBoolean = function(val, msg) {
|
|
12111
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isBoolean, true).to.be.a("boolean");
|
|
12112
|
+
};
|
|
12113
|
+
node_modules_chai_assert.isNotBoolean = function(val, msg) {
|
|
12114
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotBoolean, true).to.not.be.a("boolean");
|
|
12115
|
+
};
|
|
12116
|
+
node_modules_chai_assert.typeOf = function(val, type3, msg) {
|
|
12117
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.typeOf, true).to.be.a(type3);
|
|
12118
|
+
};
|
|
12119
|
+
node_modules_chai_assert.notTypeOf = function(value, type3, message) {
|
|
12120
|
+
new node_modules_chai_Assertion(value, message, node_modules_chai_assert.notTypeOf, true).to.not.be.a(type3);
|
|
12121
|
+
};
|
|
12122
|
+
node_modules_chai_assert.instanceOf = function(val, type3, msg) {
|
|
12123
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.instanceOf, true).to.be.instanceOf(type3);
|
|
12124
|
+
};
|
|
12125
|
+
node_modules_chai_assert.notInstanceOf = function(val, type3, msg) {
|
|
12126
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.notInstanceOf, true).to.not.be.instanceOf(type3);
|
|
12127
|
+
};
|
|
12128
|
+
node_modules_chai_assert.include = function(exp, inc, msg) {
|
|
12129
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.include, true).include(inc);
|
|
12130
|
+
};
|
|
12131
|
+
node_modules_chai_assert.notInclude = function(exp, inc, msg) {
|
|
12132
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.notInclude, true).not.include(inc);
|
|
12133
|
+
};
|
|
12134
|
+
node_modules_chai_assert.deepInclude = function(exp, inc, msg) {
|
|
12135
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.deepInclude, true).deep.include(inc);
|
|
12136
|
+
};
|
|
12137
|
+
node_modules_chai_assert.notDeepInclude = function(exp, inc, msg) {
|
|
12138
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.notDeepInclude, true).not.deep.include(inc);
|
|
12139
|
+
};
|
|
12140
|
+
node_modules_chai_assert.nestedInclude = function(exp, inc, msg) {
|
|
12141
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.nestedInclude, true).nested.include(inc);
|
|
12142
|
+
};
|
|
12143
|
+
node_modules_chai_assert.notNestedInclude = function(exp, inc, msg) {
|
|
12144
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.notNestedInclude, true).not.nested.include(inc);
|
|
12145
|
+
};
|
|
12146
|
+
node_modules_chai_assert.deepNestedInclude = function(exp, inc, msg) {
|
|
12147
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.deepNestedInclude, true).deep.nested.include(inc);
|
|
12148
|
+
};
|
|
12149
|
+
node_modules_chai_assert.notDeepNestedInclude = function(exp, inc, msg) {
|
|
12150
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.notDeepNestedInclude, true).not.deep.nested.include(inc);
|
|
12151
|
+
};
|
|
12152
|
+
node_modules_chai_assert.ownInclude = function(exp, inc, msg) {
|
|
12153
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.ownInclude, true).own.include(inc);
|
|
12154
|
+
};
|
|
12155
|
+
node_modules_chai_assert.notOwnInclude = function(exp, inc, msg) {
|
|
12156
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.notOwnInclude, true).not.own.include(inc);
|
|
12157
|
+
};
|
|
12158
|
+
node_modules_chai_assert.deepOwnInclude = function(exp, inc, msg) {
|
|
12159
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.deepOwnInclude, true).deep.own.include(inc);
|
|
12160
|
+
};
|
|
12161
|
+
node_modules_chai_assert.notDeepOwnInclude = function(exp, inc, msg) {
|
|
12162
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.notDeepOwnInclude, true).not.deep.own.include(inc);
|
|
12163
|
+
};
|
|
12164
|
+
node_modules_chai_assert.match = function(exp, re, msg) {
|
|
12165
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.match, true).to.match(re);
|
|
12166
|
+
};
|
|
12167
|
+
node_modules_chai_assert.notMatch = function(exp, re, msg) {
|
|
12168
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.notMatch, true).to.not.match(re);
|
|
12169
|
+
};
|
|
12170
|
+
node_modules_chai_assert.property = function(obj, prop, msg) {
|
|
12171
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.property, true).to.have.property(prop);
|
|
12172
|
+
};
|
|
12173
|
+
node_modules_chai_assert.notProperty = function(obj, prop, msg) {
|
|
12174
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.notProperty, true).to.not.have.property(prop);
|
|
12175
|
+
};
|
|
12176
|
+
node_modules_chai_assert.propertyVal = function(obj, prop, val, msg) {
|
|
12177
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.propertyVal, true).to.have.property(prop, val);
|
|
12178
|
+
};
|
|
12179
|
+
node_modules_chai_assert.notPropertyVal = function(obj, prop, val, msg) {
|
|
12180
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.notPropertyVal, true).to.not.have.property(prop, val);
|
|
12181
|
+
};
|
|
12182
|
+
node_modules_chai_assert.deepPropertyVal = function(obj, prop, val, msg) {
|
|
12183
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.deepPropertyVal, true).to.have.deep.property(prop, val);
|
|
12184
|
+
};
|
|
12185
|
+
node_modules_chai_assert.notDeepPropertyVal = function(obj, prop, val, msg) {
|
|
12186
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.notDeepPropertyVal, true).to.not.have.deep.property(prop, val);
|
|
12187
|
+
};
|
|
12188
|
+
node_modules_chai_assert.ownProperty = function(obj, prop, msg) {
|
|
12189
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.ownProperty, true).to.have.own.property(prop);
|
|
12190
|
+
};
|
|
12191
|
+
node_modules_chai_assert.notOwnProperty = function(obj, prop, msg) {
|
|
12192
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.notOwnProperty, true).to.not.have.own.property(prop);
|
|
12193
|
+
};
|
|
12194
|
+
node_modules_chai_assert.ownPropertyVal = function(obj, prop, value, msg) {
|
|
12195
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.ownPropertyVal, true).to.have.own.property(prop, value);
|
|
12196
|
+
};
|
|
12197
|
+
node_modules_chai_assert.notOwnPropertyVal = function(obj, prop, value, msg) {
|
|
12198
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.notOwnPropertyVal, true).to.not.have.own.property(prop, value);
|
|
12199
|
+
};
|
|
12200
|
+
node_modules_chai_assert.deepOwnPropertyVal = function(obj, prop, value, msg) {
|
|
12201
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.deepOwnPropertyVal, true).to.have.deep.own.property(prop, value);
|
|
12202
|
+
};
|
|
12203
|
+
node_modules_chai_assert.notDeepOwnPropertyVal = function(obj, prop, value, msg) {
|
|
12204
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.notDeepOwnPropertyVal, true).to.not.have.deep.own.property(prop, value);
|
|
12205
|
+
};
|
|
12206
|
+
node_modules_chai_assert.nestedProperty = function(obj, prop, msg) {
|
|
12207
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.nestedProperty, true).to.have.nested.property(prop);
|
|
12208
|
+
};
|
|
12209
|
+
node_modules_chai_assert.notNestedProperty = function(obj, prop, msg) {
|
|
12210
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.notNestedProperty, true).to.not.have.nested.property(prop);
|
|
12211
|
+
};
|
|
12212
|
+
node_modules_chai_assert.nestedPropertyVal = function(obj, prop, val, msg) {
|
|
12213
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.nestedPropertyVal, true).to.have.nested.property(prop, val);
|
|
12214
|
+
};
|
|
12215
|
+
node_modules_chai_assert.notNestedPropertyVal = function(obj, prop, val, msg) {
|
|
12216
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.notNestedPropertyVal, true).to.not.have.nested.property(prop, val);
|
|
12217
|
+
};
|
|
12218
|
+
node_modules_chai_assert.deepNestedPropertyVal = function(obj, prop, val, msg) {
|
|
12219
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.deepNestedPropertyVal, true).to.have.deep.nested.property(prop, val);
|
|
12220
|
+
};
|
|
12221
|
+
node_modules_chai_assert.notDeepNestedPropertyVal = function(obj, prop, val, msg) {
|
|
12222
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.notDeepNestedPropertyVal, true).to.not.have.deep.nested.property(prop, val);
|
|
12223
|
+
};
|
|
12224
|
+
node_modules_chai_assert.lengthOf = function(exp, len, msg) {
|
|
12225
|
+
new node_modules_chai_Assertion(exp, msg, node_modules_chai_assert.lengthOf, true).to.have.lengthOf(len);
|
|
12226
|
+
};
|
|
12227
|
+
node_modules_chai_assert.hasAnyKeys = function(obj, keys, msg) {
|
|
12228
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.hasAnyKeys, true).to.have.any.keys(keys);
|
|
12229
|
+
};
|
|
12230
|
+
node_modules_chai_assert.hasAllKeys = function(obj, keys, msg) {
|
|
12231
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.hasAllKeys, true).to.have.all.keys(keys);
|
|
12232
|
+
};
|
|
12233
|
+
node_modules_chai_assert.containsAllKeys = function(obj, keys, msg) {
|
|
12234
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.containsAllKeys, true).to.contain.all.keys(keys);
|
|
12235
|
+
};
|
|
12236
|
+
node_modules_chai_assert.doesNotHaveAnyKeys = function(obj, keys, msg) {
|
|
12237
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.doesNotHaveAnyKeys, true).to.not.have.any.keys(keys);
|
|
12238
|
+
};
|
|
12239
|
+
node_modules_chai_assert.doesNotHaveAllKeys = function(obj, keys, msg) {
|
|
12240
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.doesNotHaveAllKeys, true).to.not.have.all.keys(keys);
|
|
12241
|
+
};
|
|
12242
|
+
node_modules_chai_assert.hasAnyDeepKeys = function(obj, keys, msg) {
|
|
12243
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.hasAnyDeepKeys, true).to.have.any.deep.keys(keys);
|
|
12244
|
+
};
|
|
12245
|
+
node_modules_chai_assert.hasAllDeepKeys = function(obj, keys, msg) {
|
|
12246
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.hasAllDeepKeys, true).to.have.all.deep.keys(keys);
|
|
12247
|
+
};
|
|
12248
|
+
node_modules_chai_assert.containsAllDeepKeys = function(obj, keys, msg) {
|
|
12249
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.containsAllDeepKeys, true).to.contain.all.deep.keys(keys);
|
|
12250
|
+
};
|
|
12251
|
+
node_modules_chai_assert.doesNotHaveAnyDeepKeys = function(obj, keys, msg) {
|
|
12252
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.doesNotHaveAnyDeepKeys, true).to.not.have.any.deep.keys(keys);
|
|
12253
|
+
};
|
|
12254
|
+
node_modules_chai_assert.doesNotHaveAllDeepKeys = function(obj, keys, msg) {
|
|
12255
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.doesNotHaveAllDeepKeys, true).to.not.have.all.deep.keys(keys);
|
|
12256
|
+
};
|
|
12257
|
+
node_modules_chai_assert.throws = function(fn, errorLike, errMsgMatcher, msg) {
|
|
12258
|
+
if ("string" == typeof errorLike || errorLike instanceof RegExp) {
|
|
12259
|
+
errMsgMatcher = errorLike;
|
|
12260
|
+
errorLike = null;
|
|
12261
|
+
}
|
|
12262
|
+
let assertErr = new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.throws, true).to.throw(errorLike, errMsgMatcher);
|
|
12263
|
+
return chai_flag(assertErr, "object");
|
|
12264
|
+
};
|
|
12265
|
+
node_modules_chai_assert.doesNotThrow = function(fn, errorLike, errMsgMatcher, message) {
|
|
12266
|
+
if ("string" == typeof errorLike || errorLike instanceof RegExp) {
|
|
12267
|
+
errMsgMatcher = errorLike;
|
|
12268
|
+
errorLike = null;
|
|
12269
|
+
}
|
|
12270
|
+
new node_modules_chai_Assertion(fn, message, node_modules_chai_assert.doesNotThrow, true).to.not.throw(errorLike, errMsgMatcher);
|
|
12271
|
+
};
|
|
12272
|
+
node_modules_chai_assert.operator = function(val, operator, val2, msg) {
|
|
12273
|
+
let ok;
|
|
12274
|
+
switch(operator){
|
|
12275
|
+
case "==":
|
|
12276
|
+
ok = val == val2;
|
|
12277
|
+
break;
|
|
12278
|
+
case "===":
|
|
12279
|
+
ok = val === val2;
|
|
12280
|
+
break;
|
|
12281
|
+
case ">":
|
|
12282
|
+
ok = val > val2;
|
|
12283
|
+
break;
|
|
12284
|
+
case ">=":
|
|
12285
|
+
ok = val >= val2;
|
|
12286
|
+
break;
|
|
12287
|
+
case "<":
|
|
12288
|
+
ok = val < val2;
|
|
12289
|
+
break;
|
|
12290
|
+
case "<=":
|
|
12291
|
+
ok = val <= val2;
|
|
12292
|
+
break;
|
|
12293
|
+
case "!=":
|
|
12294
|
+
ok = val != val2;
|
|
12295
|
+
break;
|
|
12296
|
+
case "!==":
|
|
12297
|
+
ok = val !== val2;
|
|
12298
|
+
break;
|
|
12299
|
+
default:
|
|
12300
|
+
msg = msg ? msg + ": " : msg;
|
|
12301
|
+
throw new chai_6_2_2_node_modules_chai_AssertionError(msg + 'Invalid operator "' + operator + '"', void 0, node_modules_chai_assert.operator);
|
|
12302
|
+
}
|
|
12303
|
+
let test2 = new node_modules_chai_Assertion(ok, msg, node_modules_chai_assert.operator, true);
|
|
12304
|
+
test2.assert(true === chai_flag(test2, "object"), "expected " + chai_inspect2(val) + " to be " + operator + " " + chai_inspect2(val2), "expected " + chai_inspect2(val) + " to not be " + operator + " " + chai_inspect2(val2));
|
|
12305
|
+
};
|
|
12306
|
+
node_modules_chai_assert.closeTo = function(act, exp, delta, msg) {
|
|
12307
|
+
new node_modules_chai_Assertion(act, msg, node_modules_chai_assert.closeTo, true).to.be.closeTo(exp, delta);
|
|
12308
|
+
};
|
|
12309
|
+
node_modules_chai_assert.approximately = function(act, exp, delta, msg) {
|
|
12310
|
+
new node_modules_chai_Assertion(act, msg, node_modules_chai_assert.approximately, true).to.be.approximately(exp, delta);
|
|
12311
|
+
};
|
|
12312
|
+
node_modules_chai_assert.sameMembers = function(set1, set2, msg) {
|
|
12313
|
+
new node_modules_chai_Assertion(set1, msg, node_modules_chai_assert.sameMembers, true).to.have.same.members(set2);
|
|
12314
|
+
};
|
|
12315
|
+
node_modules_chai_assert.notSameMembers = function(set1, set2, msg) {
|
|
12316
|
+
new node_modules_chai_Assertion(set1, msg, node_modules_chai_assert.notSameMembers, true).to.not.have.same.members(set2);
|
|
12317
|
+
};
|
|
12318
|
+
node_modules_chai_assert.sameDeepMembers = function(set1, set2, msg) {
|
|
12319
|
+
new node_modules_chai_Assertion(set1, msg, node_modules_chai_assert.sameDeepMembers, true).to.have.same.deep.members(set2);
|
|
12320
|
+
};
|
|
12321
|
+
node_modules_chai_assert.notSameDeepMembers = function(set1, set2, msg) {
|
|
12322
|
+
new node_modules_chai_Assertion(set1, msg, node_modules_chai_assert.notSameDeepMembers, true).to.not.have.same.deep.members(set2);
|
|
12323
|
+
};
|
|
12324
|
+
node_modules_chai_assert.sameOrderedMembers = function(set1, set2, msg) {
|
|
12325
|
+
new node_modules_chai_Assertion(set1, msg, node_modules_chai_assert.sameOrderedMembers, true).to.have.same.ordered.members(set2);
|
|
12326
|
+
};
|
|
12327
|
+
node_modules_chai_assert.notSameOrderedMembers = function(set1, set2, msg) {
|
|
12328
|
+
new node_modules_chai_Assertion(set1, msg, node_modules_chai_assert.notSameOrderedMembers, true).to.not.have.same.ordered.members(set2);
|
|
12329
|
+
};
|
|
12330
|
+
node_modules_chai_assert.sameDeepOrderedMembers = function(set1, set2, msg) {
|
|
12331
|
+
new node_modules_chai_Assertion(set1, msg, node_modules_chai_assert.sameDeepOrderedMembers, true).to.have.same.deep.ordered.members(set2);
|
|
12332
|
+
};
|
|
12333
|
+
node_modules_chai_assert.notSameDeepOrderedMembers = function(set1, set2, msg) {
|
|
12334
|
+
new node_modules_chai_Assertion(set1, msg, node_modules_chai_assert.notSameDeepOrderedMembers, true).to.not.have.same.deep.ordered.members(set2);
|
|
12335
|
+
};
|
|
12336
|
+
node_modules_chai_assert.includeMembers = function(superset, subset, msg) {
|
|
12337
|
+
new node_modules_chai_Assertion(superset, msg, node_modules_chai_assert.includeMembers, true).to.include.members(subset);
|
|
12338
|
+
};
|
|
12339
|
+
node_modules_chai_assert.notIncludeMembers = function(superset, subset, msg) {
|
|
12340
|
+
new node_modules_chai_Assertion(superset, msg, node_modules_chai_assert.notIncludeMembers, true).to.not.include.members(subset);
|
|
12341
|
+
};
|
|
12342
|
+
node_modules_chai_assert.includeDeepMembers = function(superset, subset, msg) {
|
|
12343
|
+
new node_modules_chai_Assertion(superset, msg, node_modules_chai_assert.includeDeepMembers, true).to.include.deep.members(subset);
|
|
12344
|
+
};
|
|
12345
|
+
node_modules_chai_assert.notIncludeDeepMembers = function(superset, subset, msg) {
|
|
12346
|
+
new node_modules_chai_Assertion(superset, msg, node_modules_chai_assert.notIncludeDeepMembers, true).to.not.include.deep.members(subset);
|
|
12347
|
+
};
|
|
12348
|
+
node_modules_chai_assert.includeOrderedMembers = function(superset, subset, msg) {
|
|
12349
|
+
new node_modules_chai_Assertion(superset, msg, node_modules_chai_assert.includeOrderedMembers, true).to.include.ordered.members(subset);
|
|
12350
|
+
};
|
|
12351
|
+
node_modules_chai_assert.notIncludeOrderedMembers = function(superset, subset, msg) {
|
|
12352
|
+
new node_modules_chai_Assertion(superset, msg, node_modules_chai_assert.notIncludeOrderedMembers, true).to.not.include.ordered.members(subset);
|
|
12353
|
+
};
|
|
12354
|
+
node_modules_chai_assert.includeDeepOrderedMembers = function(superset, subset, msg) {
|
|
12355
|
+
new node_modules_chai_Assertion(superset, msg, node_modules_chai_assert.includeDeepOrderedMembers, true).to.include.deep.ordered.members(subset);
|
|
12356
|
+
};
|
|
12357
|
+
node_modules_chai_assert.notIncludeDeepOrderedMembers = function(superset, subset, msg) {
|
|
12358
|
+
new node_modules_chai_Assertion(superset, msg, node_modules_chai_assert.notIncludeDeepOrderedMembers, true).to.not.include.deep.ordered.members(subset);
|
|
12359
|
+
};
|
|
12360
|
+
node_modules_chai_assert.oneOf = function(inList, list, msg) {
|
|
12361
|
+
new node_modules_chai_Assertion(inList, msg, node_modules_chai_assert.oneOf, true).to.be.oneOf(list);
|
|
12362
|
+
};
|
|
12363
|
+
node_modules_chai_assert.isIterable = function(obj, msg) {
|
|
12364
|
+
if (void 0 == obj || !obj[Symbol.iterator]) {
|
|
12365
|
+
msg = msg ? `${msg} expected ${chai_inspect2(obj)} to be an iterable` : `expected ${chai_inspect2(obj)} to be an iterable`;
|
|
12366
|
+
throw new chai_6_2_2_node_modules_chai_AssertionError(msg, void 0, node_modules_chai_assert.isIterable);
|
|
12367
|
+
}
|
|
12368
|
+
};
|
|
12369
|
+
node_modules_chai_assert.changes = function(fn, obj, prop, msg) {
|
|
12370
|
+
if (3 === arguments.length && "function" == typeof obj) {
|
|
12371
|
+
msg = prop;
|
|
12372
|
+
prop = null;
|
|
12373
|
+
}
|
|
12374
|
+
new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.changes, true).to.change(obj, prop);
|
|
12375
|
+
};
|
|
12376
|
+
node_modules_chai_assert.changesBy = function(fn, obj, prop, delta, msg) {
|
|
12377
|
+
if (4 === arguments.length && "function" == typeof obj) {
|
|
12378
|
+
let tmpMsg = delta;
|
|
12379
|
+
delta = prop;
|
|
12380
|
+
msg = tmpMsg;
|
|
12381
|
+
} else if (3 === arguments.length) {
|
|
12382
|
+
delta = prop;
|
|
12383
|
+
prop = null;
|
|
12384
|
+
}
|
|
12385
|
+
new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.changesBy, true).to.change(obj, prop).by(delta);
|
|
12386
|
+
};
|
|
12387
|
+
node_modules_chai_assert.doesNotChange = function(fn, obj, prop, msg) {
|
|
12388
|
+
if (3 === arguments.length && "function" == typeof obj) {
|
|
12389
|
+
msg = prop;
|
|
12390
|
+
prop = null;
|
|
12391
|
+
}
|
|
12392
|
+
return new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.doesNotChange, true).to.not.change(obj, prop);
|
|
12393
|
+
};
|
|
12394
|
+
node_modules_chai_assert.changesButNotBy = function(fn, obj, prop, delta, msg) {
|
|
12395
|
+
if (4 === arguments.length && "function" == typeof obj) {
|
|
12396
|
+
let tmpMsg = delta;
|
|
12397
|
+
delta = prop;
|
|
12398
|
+
msg = tmpMsg;
|
|
12399
|
+
} else if (3 === arguments.length) {
|
|
12400
|
+
delta = prop;
|
|
12401
|
+
prop = null;
|
|
12402
|
+
}
|
|
12403
|
+
new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.changesButNotBy, true).to.change(obj, prop).but.not.by(delta);
|
|
12404
|
+
};
|
|
12405
|
+
node_modules_chai_assert.increases = function(fn, obj, prop, msg) {
|
|
12406
|
+
if (3 === arguments.length && "function" == typeof obj) {
|
|
12407
|
+
msg = prop;
|
|
12408
|
+
prop = null;
|
|
12409
|
+
}
|
|
12410
|
+
return new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.increases, true).to.increase(obj, prop);
|
|
12411
|
+
};
|
|
12412
|
+
node_modules_chai_assert.increasesBy = function(fn, obj, prop, delta, msg) {
|
|
12413
|
+
if (4 === arguments.length && "function" == typeof obj) {
|
|
12414
|
+
let tmpMsg = delta;
|
|
12415
|
+
delta = prop;
|
|
12416
|
+
msg = tmpMsg;
|
|
12417
|
+
} else if (3 === arguments.length) {
|
|
12418
|
+
delta = prop;
|
|
12419
|
+
prop = null;
|
|
12420
|
+
}
|
|
12421
|
+
new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.increasesBy, true).to.increase(obj, prop).by(delta);
|
|
12422
|
+
};
|
|
12423
|
+
node_modules_chai_assert.doesNotIncrease = function(fn, obj, prop, msg) {
|
|
12424
|
+
if (3 === arguments.length && "function" == typeof obj) {
|
|
12425
|
+
msg = prop;
|
|
12426
|
+
prop = null;
|
|
12427
|
+
}
|
|
12428
|
+
return new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.doesNotIncrease, true).to.not.increase(obj, prop);
|
|
12429
|
+
};
|
|
12430
|
+
node_modules_chai_assert.increasesButNotBy = function(fn, obj, prop, delta, msg) {
|
|
12431
|
+
if (4 === arguments.length && "function" == typeof obj) {
|
|
12432
|
+
let tmpMsg = delta;
|
|
12433
|
+
delta = prop;
|
|
12434
|
+
msg = tmpMsg;
|
|
12435
|
+
} else if (3 === arguments.length) {
|
|
12436
|
+
delta = prop;
|
|
12437
|
+
prop = null;
|
|
12438
|
+
}
|
|
12439
|
+
new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.increasesButNotBy, true).to.increase(obj, prop).but.not.by(delta);
|
|
12440
|
+
};
|
|
12441
|
+
node_modules_chai_assert.decreases = function(fn, obj, prop, msg) {
|
|
12442
|
+
if (3 === arguments.length && "function" == typeof obj) {
|
|
12443
|
+
msg = prop;
|
|
12444
|
+
prop = null;
|
|
12445
|
+
}
|
|
12446
|
+
return new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.decreases, true).to.decrease(obj, prop);
|
|
12447
|
+
};
|
|
12448
|
+
node_modules_chai_assert.decreasesBy = function(fn, obj, prop, delta, msg) {
|
|
12449
|
+
if (4 === arguments.length && "function" == typeof obj) {
|
|
12450
|
+
let tmpMsg = delta;
|
|
12451
|
+
delta = prop;
|
|
12452
|
+
msg = tmpMsg;
|
|
12453
|
+
} else if (3 === arguments.length) {
|
|
12454
|
+
delta = prop;
|
|
12455
|
+
prop = null;
|
|
12456
|
+
}
|
|
12457
|
+
new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.decreasesBy, true).to.decrease(obj, prop).by(delta);
|
|
12458
|
+
};
|
|
12459
|
+
node_modules_chai_assert.doesNotDecrease = function(fn, obj, prop, msg) {
|
|
12460
|
+
if (3 === arguments.length && "function" == typeof obj) {
|
|
12461
|
+
msg = prop;
|
|
12462
|
+
prop = null;
|
|
12463
|
+
}
|
|
12464
|
+
return new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.doesNotDecrease, true).to.not.decrease(obj, prop);
|
|
12465
|
+
};
|
|
12466
|
+
node_modules_chai_assert.doesNotDecreaseBy = function(fn, obj, prop, delta, msg) {
|
|
12467
|
+
if (4 === arguments.length && "function" == typeof obj) {
|
|
12468
|
+
let tmpMsg = delta;
|
|
12469
|
+
delta = prop;
|
|
12470
|
+
msg = tmpMsg;
|
|
12471
|
+
} else if (3 === arguments.length) {
|
|
12472
|
+
delta = prop;
|
|
12473
|
+
prop = null;
|
|
12474
|
+
}
|
|
12475
|
+
return new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.doesNotDecreaseBy, true).to.not.decrease(obj, prop).by(delta);
|
|
12476
|
+
};
|
|
12477
|
+
node_modules_chai_assert.decreasesButNotBy = function(fn, obj, prop, delta, msg) {
|
|
12478
|
+
if (4 === arguments.length && "function" == typeof obj) {
|
|
12479
|
+
let tmpMsg = delta;
|
|
12480
|
+
delta = prop;
|
|
12481
|
+
msg = tmpMsg;
|
|
12482
|
+
} else if (3 === arguments.length) {
|
|
12483
|
+
delta = prop;
|
|
12484
|
+
prop = null;
|
|
12485
|
+
}
|
|
12486
|
+
new node_modules_chai_Assertion(fn, msg, node_modules_chai_assert.decreasesButNotBy, true).to.decrease(obj, prop).but.not.by(delta);
|
|
12487
|
+
};
|
|
12488
|
+
node_modules_chai_assert.ifError = function(val) {
|
|
12489
|
+
if (val) throw val;
|
|
12490
|
+
};
|
|
12491
|
+
node_modules_chai_assert.isExtensible = function(obj, msg) {
|
|
12492
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.isExtensible, true).to.be.extensible;
|
|
12493
|
+
};
|
|
12494
|
+
node_modules_chai_assert.isNotExtensible = function(obj, msg) {
|
|
12495
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.isNotExtensible, true).to.not.be.extensible;
|
|
12496
|
+
};
|
|
12497
|
+
node_modules_chai_assert.isSealed = function(obj, msg) {
|
|
12498
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.isSealed, true).to.be.sealed;
|
|
12499
|
+
};
|
|
12500
|
+
node_modules_chai_assert.isNotSealed = function(obj, msg) {
|
|
12501
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.isNotSealed, true).to.not.be.sealed;
|
|
12502
|
+
};
|
|
12503
|
+
node_modules_chai_assert.isFrozen = function(obj, msg) {
|
|
12504
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.isFrozen, true).to.be.frozen;
|
|
12505
|
+
};
|
|
12506
|
+
node_modules_chai_assert.isNotFrozen = function(obj, msg) {
|
|
12507
|
+
new node_modules_chai_Assertion(obj, msg, node_modules_chai_assert.isNotFrozen, true).to.not.be.frozen;
|
|
12508
|
+
};
|
|
12509
|
+
node_modules_chai_assert.isEmpty = function(val, msg) {
|
|
12510
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isEmpty, true).to.be.empty;
|
|
12511
|
+
};
|
|
12512
|
+
node_modules_chai_assert.isNotEmpty = function(val, msg) {
|
|
12513
|
+
new node_modules_chai_Assertion(val, msg, node_modules_chai_assert.isNotEmpty, true).to.not.be.empty;
|
|
12514
|
+
};
|
|
12515
|
+
node_modules_chai_assert.containsSubset = function(val, exp, msg) {
|
|
12516
|
+
new node_modules_chai_Assertion(val, msg).to.containSubset(exp);
|
|
12517
|
+
};
|
|
12518
|
+
node_modules_chai_assert.doesNotContainSubset = function(val, exp, msg) {
|
|
12519
|
+
new node_modules_chai_Assertion(val, msg).to.not.containSubset(exp);
|
|
12520
|
+
};
|
|
12521
|
+
var chai_aliases = [
|
|
12522
|
+
[
|
|
12523
|
+
"isOk",
|
|
12524
|
+
"ok"
|
|
12525
|
+
],
|
|
12526
|
+
[
|
|
12527
|
+
"isNotOk",
|
|
12528
|
+
"notOk"
|
|
12529
|
+
],
|
|
12530
|
+
[
|
|
12531
|
+
"throws",
|
|
12532
|
+
"throw"
|
|
12533
|
+
],
|
|
12534
|
+
[
|
|
12535
|
+
"throws",
|
|
12536
|
+
"Throw"
|
|
12537
|
+
],
|
|
12538
|
+
[
|
|
12539
|
+
"isExtensible",
|
|
12540
|
+
"extensible"
|
|
12541
|
+
],
|
|
12542
|
+
[
|
|
12543
|
+
"isNotExtensible",
|
|
12544
|
+
"notExtensible"
|
|
12545
|
+
],
|
|
12546
|
+
[
|
|
12547
|
+
"isSealed",
|
|
12548
|
+
"sealed"
|
|
12549
|
+
],
|
|
12550
|
+
[
|
|
12551
|
+
"isNotSealed",
|
|
12552
|
+
"notSealed"
|
|
12553
|
+
],
|
|
12554
|
+
[
|
|
12555
|
+
"isFrozen",
|
|
12556
|
+
"frozen"
|
|
12557
|
+
],
|
|
12558
|
+
[
|
|
12559
|
+
"isNotFrozen",
|
|
12560
|
+
"notFrozen"
|
|
12561
|
+
],
|
|
12562
|
+
[
|
|
12563
|
+
"isEmpty",
|
|
12564
|
+
"empty"
|
|
12565
|
+
],
|
|
12566
|
+
[
|
|
12567
|
+
"isNotEmpty",
|
|
12568
|
+
"notEmpty"
|
|
12569
|
+
],
|
|
12570
|
+
[
|
|
12571
|
+
"isCallable",
|
|
12572
|
+
"isFunction"
|
|
12573
|
+
],
|
|
12574
|
+
[
|
|
12575
|
+
"isNotCallable",
|
|
12576
|
+
"isNotFunction"
|
|
12577
|
+
],
|
|
12578
|
+
[
|
|
12579
|
+
"containsSubset",
|
|
12580
|
+
"containSubset"
|
|
12581
|
+
]
|
|
12582
|
+
];
|
|
12583
|
+
for (const [name, as] of chai_aliases)node_modules_chai_assert[as] = node_modules_chai_assert[name];
|
|
12584
|
+
var chai_used = [];
|
|
12585
|
+
function chai_use(fn) {
|
|
12586
|
+
const exports = {
|
|
12587
|
+
use: chai_use,
|
|
12588
|
+
AssertionError: chai_6_2_2_node_modules_chai_AssertionError,
|
|
12589
|
+
util: chai_utils_exports,
|
|
12590
|
+
config: node_modules_chai_config,
|
|
12591
|
+
expect: node_modules_chai_expect,
|
|
12592
|
+
assert: node_modules_chai_assert,
|
|
12593
|
+
Assertion: node_modules_chai_Assertion,
|
|
12594
|
+
...chai_should_exports
|
|
12595
|
+
};
|
|
12596
|
+
if (!~chai_used.indexOf(fn)) {
|
|
12597
|
+
fn(exports, chai_utils_exports);
|
|
12598
|
+
chai_used.push(fn);
|
|
12599
|
+
}
|
|
12600
|
+
return exports;
|
|
12601
|
+
}
|
|
12602
|
+
chai_name(chai_use, "use");
|
|
9612
12603
|
const unsupported = [
|
|
9613
12604
|
'matchSnapshot',
|
|
9614
12605
|
'toMatchSnapshot',
|
|
@@ -9628,12 +12619,12 @@ function createExpectPoll(expect) {
|
|
|
9628
12619
|
poll: true
|
|
9629
12620
|
});
|
|
9630
12621
|
fn = fn.bind(assertion);
|
|
9631
|
-
const test =
|
|
12622
|
+
const test = chai_utils_exports.flag(assertion, 'vitest-test');
|
|
9632
12623
|
if (!test) throw new Error('expect.poll() must be called inside a test');
|
|
9633
12624
|
const proxy = new Proxy(assertion, {
|
|
9634
12625
|
get (target, key, receiver) {
|
|
9635
12626
|
const assertionFunction = Reflect.get(target, key, receiver);
|
|
9636
|
-
if ('function' != typeof assertionFunction) return assertionFunction instanceof
|
|
12627
|
+
if ('function' != typeof assertionFunction) return assertionFunction instanceof node_modules_chai_Assertion ? proxy : assertionFunction;
|
|
9637
12628
|
if ('assert' === key) return assertionFunction;
|
|
9638
12629
|
if ('string' == typeof key && unsupported.includes(key)) throw new SyntaxError(`expect.poll() is not supported in combination with .${key}(). Use rstest.waitFor() if your assertion condition is unstable.`);
|
|
9639
12630
|
return function(...args) {
|
|
@@ -9644,20 +12635,20 @@ function createExpectPoll(expect) {
|
|
|
9644
12635
|
let lastError;
|
|
9645
12636
|
const check = async ()=>{
|
|
9646
12637
|
try {
|
|
9647
|
-
|
|
12638
|
+
chai_utils_exports.flag(assertion, '_name', key);
|
|
9648
12639
|
const obj = await fn();
|
|
9649
|
-
|
|
12640
|
+
chai_utils_exports.flag(assertion, 'object', obj);
|
|
9650
12641
|
resolve(await assertionFunction.call(assertion, ...args));
|
|
9651
12642
|
clearTimeout(intervalId);
|
|
9652
12643
|
clearTimeout(timeoutId);
|
|
9653
12644
|
} catch (err) {
|
|
9654
12645
|
lastError = err;
|
|
9655
|
-
if (!
|
|
12646
|
+
if (!chai_utils_exports.flag(assertion, '_isLastPollAttempt')) intervalId = getRealTimers().setTimeout(check, interval);
|
|
9656
12647
|
}
|
|
9657
12648
|
};
|
|
9658
12649
|
timeoutId = getRealTimers().setTimeout(()=>{
|
|
9659
12650
|
clearTimeout(intervalId);
|
|
9660
|
-
|
|
12651
|
+
chai_utils_exports.flag(assertion, '_isLastPollAttempt', true);
|
|
9661
12652
|
const rejectWithCause = (cause)=>{
|
|
9662
12653
|
reject(copyStackTrace(new Error(`Matcher did not succeed in ${timeout}ms`, {
|
|
9663
12654
|
cause
|
|
@@ -9671,8 +12662,8 @@ function createExpectPoll(expect) {
|
|
|
9671
12662
|
test.onFinished ??= [];
|
|
9672
12663
|
test.onFinished.push(()=>{
|
|
9673
12664
|
if (!awaited) {
|
|
9674
|
-
const negated =
|
|
9675
|
-
const name =
|
|
12665
|
+
const negated = chai_utils_exports.flag(assertion, 'negate') ? 'not.' : '';
|
|
12666
|
+
const name = chai_utils_exports.flag(assertion, '_poll.element') ? 'element(locator)' : 'poll(assertion)';
|
|
9676
12667
|
const assertionString = `expect.${name}.${negated}${String(key)}()`;
|
|
9677
12668
|
const error = new Error(`${assertionString} was not awaited. This assertion is asynchronous and must be awaited; otherwise, it is not executed to avoid unhandled rejections:\n\nawait ${assertionString}\n`);
|
|
9678
12669
|
throw copyStackTrace(error, STACK_TRACE_ERROR);
|
|
@@ -11838,24 +14829,24 @@ const SnapshotPlugin = (workerState)=>{
|
|
|
11838
14829
|
};
|
|
11839
14830
|
};
|
|
11840
14831
|
function setupChaiConfig(config) {
|
|
11841
|
-
Object.assign(
|
|
14832
|
+
Object.assign(node_modules_chai_config, config);
|
|
11842
14833
|
}
|
|
11843
14834
|
function createExpect({ getCurrentTest, workerState }) {
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
14835
|
+
chai_use(JestExtend);
|
|
14836
|
+
chai_use(JestChaiExpect);
|
|
14837
|
+
chai_use(SnapshotPlugin(workerState));
|
|
14838
|
+
chai_use(JestAsymmetricMatchers);
|
|
11848
14839
|
const expect = (value, message)=>{
|
|
11849
14840
|
const { assertionCalls } = getState(expect);
|
|
11850
14841
|
setState({
|
|
11851
14842
|
assertionCalls: assertionCalls + 1
|
|
11852
14843
|
}, expect);
|
|
11853
|
-
const assert =
|
|
14844
|
+
const assert = node_modules_chai_expect(value, message);
|
|
11854
14845
|
const _test = getCurrentTest();
|
|
11855
14846
|
if (_test) return assert.withTest(_test);
|
|
11856
14847
|
return assert;
|
|
11857
14848
|
};
|
|
11858
|
-
Object.assign(expect,
|
|
14849
|
+
Object.assign(expect, node_modules_chai_expect);
|
|
11859
14850
|
Object.assign(expect, globalThis[ASYMMETRIC_MATCHERS_OBJECT]);
|
|
11860
14851
|
expect.getState = ()=>getState(expect);
|
|
11861
14852
|
expect.setState = (state)=>setState(state, expect);
|
|
@@ -11871,14 +14862,17 @@ function createExpect({ getCurrentTest, workerState }) {
|
|
|
11871
14862
|
return workerState.testPath;
|
|
11872
14863
|
}
|
|
11873
14864
|
}, expect);
|
|
11874
|
-
expect.extend = (matchers)=>
|
|
14865
|
+
expect.extend = (matchers)=>node_modules_chai_expect.extend(expect, matchers);
|
|
11875
14866
|
expect.addEqualityTesters = (customTesters)=>addCustomEqualityTesters(customTesters);
|
|
11876
14867
|
expect.soft = (...args)=>expect(...args).withContext({
|
|
11877
14868
|
soft: true
|
|
11878
14869
|
});
|
|
11879
14870
|
expect.poll = createExpectPoll(expect);
|
|
14871
|
+
expect.element = ()=>{
|
|
14872
|
+
throw new Error("expect.element() is only available in browser mode. Enable browser mode in config and import @rstest/browser to install the browser expect adapter.");
|
|
14873
|
+
};
|
|
11880
14874
|
expect.unreachable = (message)=>{
|
|
11881
|
-
|
|
14875
|
+
node_modules_chai_assert.fail(`expected ${message ? `"${message}" ` : ''}not to be reached`);
|
|
11882
14876
|
};
|
|
11883
14877
|
function assertions(expected) {
|
|
11884
14878
|
const errorGen = ()=>new Error(`expected number of assertions to be ${expected}, but got ${expect.getState().assertionCalls}`);
|
|
@@ -11896,8 +14890,8 @@ function createExpect({ getCurrentTest, workerState }) {
|
|
|
11896
14890
|
isExpectingAssertionsError: error
|
|
11897
14891
|
});
|
|
11898
14892
|
}
|
|
11899
|
-
|
|
11900
|
-
|
|
14893
|
+
chai_utils_exports.addMethod(expect, 'assertions', assertions);
|
|
14894
|
+
chai_utils_exports.addMethod(expect, 'hasAssertions', hasAssertions);
|
|
11901
14895
|
expect.extend(customMatchers);
|
|
11902
14896
|
return expect;
|
|
11903
14897
|
}
|
|
@@ -12025,7 +15019,7 @@ function getFixtureUsedProps(fn) {
|
|
|
12025
15019
|
const trimmedParams = match[1].trim();
|
|
12026
15020
|
if (!trimmedParams) return [];
|
|
12027
15021
|
const [firstParam] = splitByComma(trimmedParams);
|
|
12028
|
-
if (firstParam?.[0] !== '{' || '}'
|
|
15022
|
+
if (firstParam?.[0] !== '{' || !firstParam.endsWith('}')) {
|
|
12029
15023
|
if (firstParam?.startsWith('_')) return [];
|
|
12030
15024
|
throw new Error(`First argument must use the object destructuring pattern: ${firstParam}`);
|
|
12031
15025
|
}
|
|
@@ -12351,7 +15345,8 @@ class TestRunner {
|
|
|
12351
15345
|
project: test.project,
|
|
12352
15346
|
testId: test.testId,
|
|
12353
15347
|
type: 'suite',
|
|
12354
|
-
location: test.location
|
|
15348
|
+
location: test.location,
|
|
15349
|
+
runMode: test.runMode
|
|
12355
15350
|
});
|
|
12356
15351
|
if (0 === test.tests.length) {
|
|
12357
15352
|
if ([
|
|
@@ -12423,7 +15418,8 @@ class TestRunner {
|
|
|
12423
15418
|
parentNames: test.parentNames,
|
|
12424
15419
|
project: test.project,
|
|
12425
15420
|
type: 'case',
|
|
12426
|
-
location: test.location
|
|
15421
|
+
location: test.location,
|
|
15422
|
+
runMode: test.runMode
|
|
12427
15423
|
});
|
|
12428
15424
|
do {
|
|
12429
15425
|
const currentResult = await runTestsCase(test, parentHooks);
|
|
@@ -13057,18 +16053,7 @@ function createRunner({ workerState }) {
|
|
|
13057
16053
|
traverseUpdateTest(tests, testNamePattern);
|
|
13058
16054
|
hooks.onTestFileReady?.({
|
|
13059
16055
|
testPath,
|
|
13060
|
-
tests: tests.map(
|
|
13061
|
-
return {
|
|
13062
|
-
testId: test.testId,
|
|
13063
|
-
name: test.name,
|
|
13064
|
-
parentNames: test.parentNames,
|
|
13065
|
-
testPath: test.testPath,
|
|
13066
|
-
project: test.project,
|
|
13067
|
-
type: test.type,
|
|
13068
|
-
location: test.location,
|
|
13069
|
-
tests: 'suite' === test.type ? test.tests.map(toTestInfo) : []
|
|
13070
|
-
};
|
|
13071
|
-
})
|
|
16056
|
+
tests: tests.map(toTestInfo)
|
|
13072
16057
|
});
|
|
13073
16058
|
runtime.instance.updateStatus('running');
|
|
13074
16059
|
const results = await testRunner.runTests({
|
|
@@ -13084,12 +16069,25 @@ function createRunner({ workerState }) {
|
|
|
13084
16069
|
collectTests: async ()=>{
|
|
13085
16070
|
const tests = await runtime.instance.getTests();
|
|
13086
16071
|
traverseUpdateTest(tests, testNamePattern);
|
|
13087
|
-
return tests;
|
|
16072
|
+
return tests.map(toTestInfo);
|
|
13088
16073
|
},
|
|
13089
16074
|
getCurrentTest: ()=>testRunner.getCurrentTest()
|
|
13090
16075
|
}
|
|
13091
16076
|
};
|
|
13092
16077
|
}
|
|
16078
|
+
function toTestInfo(test) {
|
|
16079
|
+
return {
|
|
16080
|
+
testId: test.testId,
|
|
16081
|
+
name: test.name,
|
|
16082
|
+
parentNames: test.parentNames,
|
|
16083
|
+
testPath: test.testPath,
|
|
16084
|
+
project: test.project,
|
|
16085
|
+
type: test.type,
|
|
16086
|
+
location: test.location,
|
|
16087
|
+
tests: 'suite' === test.type ? test.tests.map(toTestInfo) : [],
|
|
16088
|
+
runMode: test.runMode
|
|
16089
|
+
};
|
|
16090
|
+
}
|
|
13093
16091
|
const fake_timers_src = __webpack_require__("../../node_modules/.pnpm/@sinonjs+fake-timers@15.1.0/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js");
|
|
13094
16092
|
const fakeTimers_RealDate = Date;
|
|
13095
16093
|
class FakeTimers {
|
|
@@ -13322,7 +16320,7 @@ function mockObject(options, object, mockExports = {}) {
|
|
|
13322
16320
|
configurable: descriptor.configurable,
|
|
13323
16321
|
enumerable: descriptor.enumerable,
|
|
13324
16322
|
get: ()=>void 0,
|
|
13325
|
-
set: descriptor.set ? ()=>
|
|
16323
|
+
set: descriptor.set ? ()=>void 0 : void 0
|
|
13326
16324
|
});
|
|
13327
16325
|
} catch {}
|
|
13328
16326
|
continue;
|
|
@@ -13532,11 +16530,34 @@ const initSpy = ()=>{
|
|
|
13532
16530
|
createMockInstance
|
|
13533
16531
|
};
|
|
13534
16532
|
};
|
|
16533
|
+
const DEFAULT_WAIT_TIMEOUT = 1000;
|
|
16534
|
+
const DEFAULT_WAIT_INTERVAL = 50;
|
|
16535
|
+
const getRealSetTimeout = ()=>getRealTimers().setTimeout ?? globalThis.setTimeout.bind(globalThis);
|
|
16536
|
+
const getRealClearTimeout = ()=>getRealTimers().clearTimeout ?? globalThis.clearTimeout.bind(globalThis);
|
|
16537
|
+
const sleep = (ms)=>new Promise((resolve)=>getRealSetTimeout()(resolve, ms));
|
|
16538
|
+
const createWaitForTimeoutError = (timeout, cause)=>new Error(`waitFor timed out in ${timeout}ms`, {
|
|
16539
|
+
cause
|
|
16540
|
+
});
|
|
16541
|
+
const createWaitUntilTimeoutError = (timeout)=>new Error(`waitUntil timed out in ${timeout}ms`);
|
|
16542
|
+
const normalizeWaitOptions = (options)=>({
|
|
16543
|
+
timeout: Math.max(0, 'number' == typeof options ? options : options?.timeout ?? DEFAULT_WAIT_TIMEOUT),
|
|
16544
|
+
interval: Math.max(0, 'number' == typeof options ? DEFAULT_WAIT_INTERVAL : options?.interval ?? DEFAULT_WAIT_INTERVAL)
|
|
16545
|
+
});
|
|
13535
16546
|
const createRstestUtilities = async (workerState)=>{
|
|
16547
|
+
const RSTEST_ENV_SYMBOL = Symbol.for('rstest.env');
|
|
13536
16548
|
const originalEnvValues = new Map();
|
|
13537
16549
|
const originalGlobalValues = new Map();
|
|
13538
16550
|
let _timers;
|
|
13539
16551
|
let originalConfig;
|
|
16552
|
+
const resolveRuntimeEnv = ()=>{
|
|
16553
|
+
const globalRef = globalThis;
|
|
16554
|
+
const runtimeEnv = globalRef[RSTEST_ENV_SYMBOL];
|
|
16555
|
+
if (runtimeEnv && 'object' == typeof runtimeEnv) return runtimeEnv;
|
|
16556
|
+
if ("u" > typeof process && process.env) return process.env;
|
|
16557
|
+
const createdEnv = {};
|
|
16558
|
+
globalRef[RSTEST_ENV_SYMBOL] = createdEnv;
|
|
16559
|
+
return createdEnv;
|
|
16560
|
+
};
|
|
13540
16561
|
const timers = ()=>{
|
|
13541
16562
|
if (!_timers) _timers = new FakeTimers({
|
|
13542
16563
|
global: globalThis
|
|
@@ -13574,15 +16595,15 @@ const createRstestUtilities = async (workerState)=>{
|
|
|
13574
16595
|
for (const mock of mocks)mock.mockRestore();
|
|
13575
16596
|
return rstest;
|
|
13576
16597
|
},
|
|
13577
|
-
mock: ()=>
|
|
13578
|
-
mockRequire: ()=>
|
|
13579
|
-
doMock: ()=>
|
|
13580
|
-
doMockRequire: ()=>
|
|
13581
|
-
unmock: ()=>
|
|
13582
|
-
doUnmock: ()=>
|
|
13583
|
-
importMock:
|
|
16598
|
+
mock: ()=>void 0,
|
|
16599
|
+
mockRequire: ()=>void 0,
|
|
16600
|
+
doMock: ()=>void 0,
|
|
16601
|
+
doMockRequire: ()=>void 0,
|
|
16602
|
+
unmock: ()=>void 0,
|
|
16603
|
+
doUnmock: ()=>void 0,
|
|
16604
|
+
importMock: ()=>Promise.resolve({}),
|
|
13584
16605
|
requireMock: ()=>({}),
|
|
13585
|
-
importActual:
|
|
16606
|
+
importActual: ()=>Promise.resolve({}),
|
|
13586
16607
|
requireActual: ()=>({}),
|
|
13587
16608
|
resetModules: ()=>({}),
|
|
13588
16609
|
hoisted: ()=>({}),
|
|
@@ -13608,14 +16629,16 @@ const createRstestUtilities = async (workerState)=>{
|
|
|
13608
16629
|
if (originalConfig) Object.assign(workerState.runtimeConfig, originalConfig);
|
|
13609
16630
|
},
|
|
13610
16631
|
stubEnv: (name, value)=>{
|
|
13611
|
-
|
|
13612
|
-
if (
|
|
13613
|
-
|
|
16632
|
+
const runtimeEnv = resolveRuntimeEnv();
|
|
16633
|
+
if (!originalEnvValues.has(name)) originalEnvValues.set(name, runtimeEnv[name]);
|
|
16634
|
+
if (void 0 === value) delete runtimeEnv[name];
|
|
16635
|
+
else runtimeEnv[name] = value;
|
|
13614
16636
|
return rstest;
|
|
13615
16637
|
},
|
|
13616
16638
|
unstubAllEnvs: ()=>{
|
|
13617
|
-
|
|
13618
|
-
|
|
16639
|
+
const runtimeEnv = resolveRuntimeEnv();
|
|
16640
|
+
for (const [name, value] of originalEnvValues)if (void 0 === value) delete runtimeEnv[name];
|
|
16641
|
+
else runtimeEnv[name] = value;
|
|
13619
16642
|
originalEnvValues.clear();
|
|
13620
16643
|
return rstest;
|
|
13621
16644
|
},
|
|
@@ -13695,6 +16718,51 @@ const createRstestUtilities = async (workerState)=>{
|
|
|
13695
16718
|
clearAllTimers: ()=>{
|
|
13696
16719
|
timers().clearAllTimers();
|
|
13697
16720
|
return rstest;
|
|
16721
|
+
},
|
|
16722
|
+
waitFor: async (callback, options)=>{
|
|
16723
|
+
const { timeout, interval } = normalizeWaitOptions(options);
|
|
16724
|
+
const clearTimeoutFn = getRealClearTimeout();
|
|
16725
|
+
let timedOut = false;
|
|
16726
|
+
let lastError;
|
|
16727
|
+
const timeoutId = getRealSetTimeout()(()=>{
|
|
16728
|
+
timedOut = true;
|
|
16729
|
+
}, timeout);
|
|
16730
|
+
try {
|
|
16731
|
+
while(true){
|
|
16732
|
+
if (timedOut) throw lastError ?? createWaitForTimeoutError(timeout);
|
|
16733
|
+
try {
|
|
16734
|
+
const value = await callback();
|
|
16735
|
+
if (timedOut) throw lastError ?? createWaitForTimeoutError(timeout);
|
|
16736
|
+
return value;
|
|
16737
|
+
} catch (error) {
|
|
16738
|
+
lastError = error;
|
|
16739
|
+
}
|
|
16740
|
+
if (timedOut) throw lastError ?? createWaitForTimeoutError(timeout);
|
|
16741
|
+
await sleep(interval);
|
|
16742
|
+
}
|
|
16743
|
+
} finally{
|
|
16744
|
+
clearTimeoutFn(timeoutId);
|
|
16745
|
+
}
|
|
16746
|
+
},
|
|
16747
|
+
waitUntil: async (callback, options)=>{
|
|
16748
|
+
const { timeout, interval } = normalizeWaitOptions(options);
|
|
16749
|
+
const clearTimeoutFn = getRealClearTimeout();
|
|
16750
|
+
let timedOut = false;
|
|
16751
|
+
const timeoutId = getRealSetTimeout()(()=>{
|
|
16752
|
+
timedOut = true;
|
|
16753
|
+
}, timeout);
|
|
16754
|
+
try {
|
|
16755
|
+
while(true){
|
|
16756
|
+
if (timedOut) throw createWaitUntilTimeoutError(timeout);
|
|
16757
|
+
const value = await callback();
|
|
16758
|
+
if (timedOut) throw createWaitUntilTimeoutError(timeout);
|
|
16759
|
+
if (value) return value;
|
|
16760
|
+
if (timedOut) throw createWaitUntilTimeoutError(timeout);
|
|
16761
|
+
await sleep(interval);
|
|
16762
|
+
}
|
|
16763
|
+
} finally{
|
|
16764
|
+
clearTimeoutFn(timeoutId);
|
|
16765
|
+
}
|
|
13698
16766
|
}
|
|
13699
16767
|
};
|
|
13700
16768
|
return rstest;
|
|
@@ -13719,7 +16787,7 @@ const createRstestRuntime = async (workerState)=>{
|
|
|
13719
16787
|
api: {
|
|
13720
16788
|
...runnerAPI,
|
|
13721
16789
|
expect,
|
|
13722
|
-
assert:
|
|
16790
|
+
assert: node_modules_chai_assert,
|
|
13723
16791
|
rstest,
|
|
13724
16792
|
rs: rstest
|
|
13725
16793
|
}
|