@jest/expect-utils 28.0.0-alpha.3 → 28.0.0-alpha.6
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/index.d.ts +1 -0
- package/build/utils.js +11 -18
- package/package.json +3 -3
package/build/index.d.ts
CHANGED
package/build/utils.js
CHANGED
@@ -21,21 +21,7 @@ var _jestGetType = require('jest-get-type');
|
|
21
21
|
|
22
22
|
var _jasmineUtils = require('./jasmineUtils');
|
23
23
|
|
24
|
-
var
|
25
|
-
if (typeof globalThis !== 'undefined') {
|
26
|
-
return globalThis;
|
27
|
-
} else if (typeof global !== 'undefined') {
|
28
|
-
return global;
|
29
|
-
} else if (typeof self !== 'undefined') {
|
30
|
-
return self;
|
31
|
-
} else if (typeof window !== 'undefined') {
|
32
|
-
return window;
|
33
|
-
} else {
|
34
|
-
return Function('return this')();
|
35
|
-
}
|
36
|
-
})();
|
37
|
-
|
38
|
-
var Symbol = global['jest-symbol-do-not-touch'] || global.Symbol;
|
24
|
+
var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol;
|
39
25
|
|
40
26
|
/**
|
41
27
|
* Checks if `hasOwnProperty(object, key)` up the prototype chain, stopping at `Object.prototype`.
|
@@ -87,9 +73,9 @@ const getPath = (object, propertyPath) => {
|
|
87
73
|
// Does object have the property with an undefined value?
|
88
74
|
// Although primitive values support bracket notation (above)
|
89
75
|
// they would throw TypeError for in operator (below).
|
90
|
-
result.
|
91
|
-
|
92
|
-
|
76
|
+
result.endPropIsDefined =
|
77
|
+
!(0, _jestGetType.isPrimitive)(object) && prop in object;
|
78
|
+
result.hasEndProp = newObject !== undefined || result.endPropIsDefined;
|
93
79
|
|
94
80
|
if (!result.hasEndProp) {
|
95
81
|
result.traversedPath.shift();
|
@@ -290,6 +276,13 @@ const iterableEquality = (
|
|
290
276
|
|
291
277
|
if (!bIterator.next().done) {
|
292
278
|
return false;
|
279
|
+
}
|
280
|
+
|
281
|
+
const aEntries = Object.entries(a);
|
282
|
+
const bEntries = Object.entries(b);
|
283
|
+
|
284
|
+
if (!(0, _jasmineUtils.equals)(aEntries, bEntries)) {
|
285
|
+
return false;
|
293
286
|
} // Remove the first value from the stack of traversed values.
|
294
287
|
|
295
288
|
aStack.pop();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jest/expect-utils",
|
3
|
-
"version": "28.0.0-alpha.
|
3
|
+
"version": "28.0.0-alpha.6",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
@@ -20,7 +20,7 @@
|
|
20
20
|
"jest-get-type": "^28.0.0-alpha.3"
|
21
21
|
},
|
22
22
|
"devDependencies": {
|
23
|
-
"jest-matcher-utils": "^28.0.0-alpha.
|
23
|
+
"jest-matcher-utils": "^28.0.0-alpha.6"
|
24
24
|
},
|
25
25
|
"engines": {
|
26
26
|
"node": "^12.13.0 || ^14.15.0 || ^16.13.0 || >=17.0.0"
|
@@ -28,5 +28,5 @@
|
|
28
28
|
"publishConfig": {
|
29
29
|
"access": "public"
|
30
30
|
},
|
31
|
-
"gitHead": "
|
31
|
+
"gitHead": "6284ada4adb7008f5f8673b1a7b1c789d2e508fb"
|
32
32
|
}
|