Skip to content

Commit

Permalink
WIP: Bugfix, added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
knuthelv committed Apr 7, 2023
1 parent d8473f7 commit cb394e7
Show file tree
Hide file tree
Showing 7 changed files with 7,984 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/compareJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function isValueEqual(expected, actual, compareExact = false) {
return typeof actual === 'string'
}

if (expected.includes(OR) && expected.split(OR).find(e => e === actual)) {
if (typeof expected === 'string' && expected.includes(OR) && expected.split(OR).find(e => e === actual)) {
return true
}
}
Expand Down Expand Up @@ -114,10 +114,7 @@ function isCompatibleObjects(expected, actual, config, currPath) {

for (const key of Object.keys(expected)) {

if (config.ignoreJsonKeys.includes(key)) {
continue
}
else if (config.ignoreJsonPaths.includes(expandPath(currPath, key))) {
if (config.ignoreJsonKeys.includes(key) || config.ignoreJsonPaths.includes(expandPath(currPath, key))) {
continue
}

Expand Down
Loading

0 comments on commit cb394e7

Please sign in to comment.