@jest/expect-utils 29.4.2 → 29.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/build/immutableUtils.js +1 -1
- package/build/index.d.ts +1 -1
- package/build/utils.js +11 -4
- package/package.json +4 -4
package/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/build/immutableUtils.js
CHANGED
@@ -10,7 +10,7 @@ exports.isImmutableRecord = isImmutableRecord;
|
|
10
10
|
exports.isImmutableUnorderedKeyed = isImmutableUnorderedKeyed;
|
11
11
|
exports.isImmutableUnorderedSet = isImmutableUnorderedSet;
|
12
12
|
/**
|
13
|
-
* Copyright (c)
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
14
14
|
*
|
15
15
|
* This source code is licensed under the MIT license found in the
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
package/build/index.d.ts
CHANGED
package/build/utils.js
CHANGED
@@ -39,8 +39,6 @@ const hasPropertyInObject = (object, key) => {
|
|
39
39
|
// the prototype chain for string keys but not for symbols. (Otherwise, it
|
40
40
|
// could find values such as a Set or Map's Symbol.toStringTag, with unexpected
|
41
41
|
// results.)
|
42
|
-
//
|
43
|
-
// Compare with subsetEquality's use of Reflect.ownKeys.
|
44
42
|
const getObjectKeys = object => [
|
45
43
|
...Object.keys(object),
|
46
44
|
...Object.getOwnPropertySymbols(object)
|
@@ -317,7 +315,7 @@ const subsetEquality = (object, subset, customTesters = []) => {
|
|
317
315
|
if (!isObjectWithKeys(subset)) {
|
318
316
|
return undefined;
|
319
317
|
}
|
320
|
-
return
|
318
|
+
return getObjectKeys(subset).every(key => {
|
321
319
|
if (isObjectWithKeys(subset[key])) {
|
322
320
|
if (seenReferences.has(subset[key])) {
|
323
321
|
return (0, _jasmineUtils.equals)(
|
@@ -350,7 +348,16 @@ const subsetEquality = (object, subset, customTesters = []) => {
|
|
350
348
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
351
349
|
exports.subsetEquality = subsetEquality;
|
352
350
|
const typeEquality = (a, b) => {
|
353
|
-
if (
|
351
|
+
if (
|
352
|
+
a == null ||
|
353
|
+
b == null ||
|
354
|
+
a.constructor === b.constructor ||
|
355
|
+
// Since Jest globals are different from Node globals,
|
356
|
+
// constructors are different even between arrays when comparing properties of mock objects.
|
357
|
+
// Both of them should be able to compare correctly when they are array-to-array.
|
358
|
+
// https://github.com/facebook/jest/issues/2549
|
359
|
+
(Array.isArray(a) && Array.isArray(b))
|
360
|
+
) {
|
354
361
|
return undefined;
|
355
362
|
}
|
356
363
|
return false;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jest/expect-utils",
|
3
|
-
"version": "29.
|
3
|
+
"version": "29.5.0",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
@@ -17,12 +17,12 @@
|
|
17
17
|
"./package.json": "./package.json"
|
18
18
|
},
|
19
19
|
"dependencies": {
|
20
|
-
"jest-get-type": "^29.4.
|
20
|
+
"jest-get-type": "^29.4.3"
|
21
21
|
},
|
22
22
|
"devDependencies": {
|
23
23
|
"@tsd/typescript": "^4.9.0",
|
24
24
|
"immutable": "^4.0.0",
|
25
|
-
"jest-matcher-utils": "^29.
|
25
|
+
"jest-matcher-utils": "^29.5.0",
|
26
26
|
"tsd-lite": "^0.6.0"
|
27
27
|
},
|
28
28
|
"engines": {
|
@@ -31,5 +31,5 @@
|
|
31
31
|
"publishConfig": {
|
32
32
|
"access": "public"
|
33
33
|
},
|
34
|
-
"gitHead": "
|
34
|
+
"gitHead": "39f3beda6b396665bebffab94e8d7c45be30454c"
|
35
35
|
}
|