Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit ed1859b

Browse files
committed
makeCompareValues now compares objects
1 parent 113a006 commit ed1859b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/utils/testUtils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ exports.assertError = assertError;
3434
const makeCompareValues = floatSafe => (val1, val2) => {
3535
if (floatSafe && typeof val1 === 'number' && typeof val2 === 'number') {
3636
return Math.abs(val1 - val2) < 0.001;
37-
}
37+
} else if (typeof val1 === 'object' && typeof val2 === 'object') {
38+
return JSON.stringify(val1) === JSON.stringify(val2);
39+
}
40+
3841
return val1 === val2;
3942
};
4043

0 commit comments

Comments
 (0)