@jest/expect-utils 28.0.1 → 28.1.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/build/jasmineUtils.js +16 -1
- package/build/utils.js +9 -4
- package/package.json +6 -5
package/build/jasmineUtils.js
CHANGED
@@ -5,6 +5,8 @@ Object.defineProperty(exports, '__esModule', {
|
|
5
5
|
});
|
6
6
|
exports.equals = void 0;
|
7
7
|
exports.isA = isA;
|
8
|
+
exports.isImmutableList = isImmutableList;
|
9
|
+
exports.isImmutableOrderedKeyed = isImmutableOrderedKeyed;
|
8
10
|
exports.isImmutableUnorderedKeyed = isImmutableUnorderedKeyed;
|
9
11
|
exports.isImmutableUnorderedSet = isImmutableUnorderedSet;
|
10
12
|
|
@@ -235,10 +237,11 @@ function isDomNode(obj) {
|
|
235
237
|
typeof obj.nodeName === 'string' &&
|
236
238
|
typeof obj.isEqualNode === 'function'
|
237
239
|
);
|
238
|
-
} // SENTINEL constants are from https://github.com/
|
240
|
+
} // SENTINEL constants are from https://github.com/immutable-js/immutable-js/tree/main/src/predicates
|
239
241
|
|
240
242
|
const IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
|
241
243
|
const IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
|
244
|
+
const IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
|
242
245
|
const IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
|
243
246
|
|
244
247
|
function isImmutableUnorderedKeyed(maybeKeyed) {
|
@@ -256,3 +259,15 @@ function isImmutableUnorderedSet(maybeSet) {
|
|
256
259
|
!maybeSet[IS_ORDERED_SENTINEL]
|
257
260
|
);
|
258
261
|
}
|
262
|
+
|
263
|
+
function isImmutableList(maybeList) {
|
264
|
+
return !!(maybeList && maybeList[IS_LIST_SENTINEL]);
|
265
|
+
}
|
266
|
+
|
267
|
+
function isImmutableOrderedKeyed(maybeKeyed) {
|
268
|
+
return !!(
|
269
|
+
maybeKeyed &&
|
270
|
+
maybeKeyed[IS_KEYED_SENTINEL] &&
|
271
|
+
maybeKeyed[IS_ORDERED_SENTINEL]
|
272
|
+
);
|
273
|
+
}
|
package/build/utils.js
CHANGED
@@ -278,11 +278,16 @@ const iterableEquality = (
|
|
278
278
|
return false;
|
279
279
|
}
|
280
280
|
|
281
|
-
|
282
|
-
|
281
|
+
if (
|
282
|
+
!(0, _jasmineUtils.isImmutableList)(a) &&
|
283
|
+
!(0, _jasmineUtils.isImmutableOrderedKeyed)(a)
|
284
|
+
) {
|
285
|
+
const aEntries = Object.entries(a);
|
286
|
+
const bEntries = Object.entries(b);
|
283
287
|
|
284
|
-
|
285
|
-
|
288
|
+
if (!(0, _jasmineUtils.equals)(aEntries, bEntries)) {
|
289
|
+
return false;
|
290
|
+
}
|
286
291
|
} // Remove the first value from the stack of traversed values.
|
287
292
|
|
288
293
|
aStack.pop();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jest/expect-utils",
|
3
|
-
"version": "28.
|
3
|
+
"version": "28.1.1",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
@@ -17,16 +17,17 @@
|
|
17
17
|
"./package.json": "./package.json"
|
18
18
|
},
|
19
19
|
"dependencies": {
|
20
|
-
"jest-get-type": "^28.0.
|
20
|
+
"jest-get-type": "^28.0.2"
|
21
21
|
},
|
22
22
|
"devDependencies": {
|
23
|
-
"
|
23
|
+
"immutable": "^4.0.0",
|
24
|
+
"jest-matcher-utils": "^28.1.1"
|
24
25
|
},
|
25
26
|
"engines": {
|
26
|
-
"node": "^12.13.0 || ^14.15.0 || ^16.
|
27
|
+
"node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0"
|
27
28
|
},
|
28
29
|
"publishConfig": {
|
29
30
|
"access": "public"
|
30
31
|
},
|
31
|
-
"gitHead": "
|
32
|
+
"gitHead": "eb954f8874960920ac50a8f976bb333fbb06ada9"
|
32
33
|
}
|