apify-test-tools 0.10.1-beta.7 → 0.10.2-beta.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/lib/extend-expect.ts
CHANGED
|
@@ -53,7 +53,7 @@ export const extendExpect = (expect: ExpectStatic): ExpectStatic => {
|
|
|
53
53
|
};
|
|
54
54
|
},
|
|
55
55
|
toBeNonEmptyObject: (actual) => {
|
|
56
|
-
const isObject = typeof actual === 'object' && !Array.isArray(actual);
|
|
56
|
+
const isObject = typeof actual === 'object' && !Array.isArray(actual) && actual !== null;
|
|
57
57
|
const isNonEmpty = Object.entries(actual).length > 0;
|
|
58
58
|
const pass = isObject && isNonEmpty;
|
|
59
59
|
return {
|
|
@@ -62,7 +62,7 @@ export const extendExpect = (expect: ExpectStatic): ExpectStatic => {
|
|
|
62
62
|
};
|
|
63
63
|
},
|
|
64
64
|
toBeObject: (actual) => {
|
|
65
|
-
const pass = typeof actual === 'object' && !Array.isArray(actual);
|
|
65
|
+
const pass = typeof actual === 'object' && !Array.isArray(actual) && actual !== null;
|
|
66
66
|
return {
|
|
67
67
|
pass,
|
|
68
68
|
message: () => `Expected "${actual}" to be an object`,
|