@jest/expect-utils 29.4.3 → 29.6.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/build/utils.js +17 -1
- package/package.json +5 -5
package/build/utils.js
CHANGED
@@ -20,6 +20,13 @@ var _jestGetType = require('jest-get-type');
|
|
20
20
|
var _immutableUtils = require('./immutableUtils');
|
21
21
|
var _jasmineUtils = require('./jasmineUtils');
|
22
22
|
var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol;
|
23
|
+
/**
|
24
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
25
|
+
*
|
26
|
+
* This source code is licensed under the MIT license found in the
|
27
|
+
* LICENSE file in the root directory of this source tree.
|
28
|
+
*
|
29
|
+
*/
|
23
30
|
/**
|
24
31
|
* Checks if `hasOwnProperty(object, key)` up the prototype chain, stopping at `Object.prototype`.
|
25
32
|
*/
|
@@ -348,7 +355,16 @@ const subsetEquality = (object, subset, customTesters = []) => {
|
|
348
355
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
349
356
|
exports.subsetEquality = subsetEquality;
|
350
357
|
const typeEquality = (a, b) => {
|
351
|
-
if (
|
358
|
+
if (
|
359
|
+
a == null ||
|
360
|
+
b == null ||
|
361
|
+
a.constructor === b.constructor ||
|
362
|
+
// Since Jest globals are different from Node globals,
|
363
|
+
// constructors are different even between arrays when comparing properties of mock objects.
|
364
|
+
// Both of them should be able to compare correctly when they are array-to-array.
|
365
|
+
// https://github.com/facebook/jest/issues/2549
|
366
|
+
(Array.isArray(a) && Array.isArray(b))
|
367
|
+
) {
|
352
368
|
return undefined;
|
353
369
|
}
|
354
370
|
return false;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jest/expect-utils",
|
3
|
-
"version": "29.
|
3
|
+
"version": "29.6.0",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
@@ -20,10 +20,10 @@
|
|
20
20
|
"jest-get-type": "^29.4.3"
|
21
21
|
},
|
22
22
|
"devDependencies": {
|
23
|
-
"@tsd/typescript": "^
|
23
|
+
"@tsd/typescript": "^5.0.4",
|
24
24
|
"immutable": "^4.0.0",
|
25
|
-
"jest-matcher-utils": "^29.
|
26
|
-
"tsd-lite": "^0.
|
25
|
+
"jest-matcher-utils": "^29.6.0",
|
26
|
+
"tsd-lite": "^0.7.0"
|
27
27
|
},
|
28
28
|
"engines": {
|
29
29
|
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
@@ -31,5 +31,5 @@
|
|
31
31
|
"publishConfig": {
|
32
32
|
"access": "public"
|
33
33
|
},
|
34
|
-
"gitHead": "
|
34
|
+
"gitHead": "c1e5b8a38ef54bb138409f89831942ebf6a7a67e"
|
35
35
|
}
|