Skip to content

Commit

Permalink
test(helpers): import equals() method from jasmine_utils to support n…
Browse files Browse the repository at this point in the history
…ested asymmetric matchers
  • Loading branch information
evocateur committed Dec 19, 2018
1 parent d0f0dbc commit b1c2a10
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions helpers/figgy-pudding-matchers/index.js
Expand Up @@ -10,6 +10,7 @@ const {
printReceived,
printWithType,
} = require("jest-matcher-utils");
const { equals } = require("expect/build/jasmine_utils");

/**
* Jest matchers for figgy-pudding instances
Expand Down Expand Up @@ -133,9 +134,7 @@ function isObjectWithKeys(obj) {
}

function hasEveryMatchingProperty(received, expected) {
return Object.keys(expected).every(
property => property in received && received[property] === expected[property]
);
return Object.keys(expected).every(property => equals(received[property], expected[property]));
}

function isFiggyInstance(received) {
Expand Down
1 change: 1 addition & 0 deletions helpers/figgy-pudding-matchers/package.json
Expand Up @@ -6,6 +6,7 @@
"private": true,
"license": "MIT",
"dependencies": {
"expect": "*",
"jest-diff": "*",
"jest-matcher-utils": "*"
}
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b1c2a10

Please sign in to comment.