expect...toEqual check for Symbols

This commit is contained in:
leoni laetitia
2021-01-31 22:32:58 +01:00
parent 1320b0614f
commit 3234d475cd
6 changed files with 108 additions and 19 deletions

View File

@@ -544,17 +544,16 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
};
function keys(obj, isArray) {
var allKeys = Object.keys
? Object.keys(obj)
: (function(o) {
var keys = [];
for (var key in o) {
if (j$.util.has(o, key)) {
keys.push(key);
}
}
return keys;
})(obj);
var allKeys = (function(o) {
var keys = [];
for (var key in o) {
if (j$.util.has(o, key)) {
keys.push(key);
}
}
// eslint-disable-next-line compat/compat
return keys.concat(Object.getOwnPropertySymbols(o));
})(obj);
if (!isArray) {
return allKeys;