Skip to content

Commit cb394e7

Browse files
committed
WIP: Bugfix, added tests
1 parent d8473f7 commit cb394e7

File tree

7 files changed

+7984
-5
lines changed

7 files changed

+7984
-5
lines changed

src/compareJson.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function isValueEqual(expected, actual, compareExact = false) {
5959
return typeof actual === 'string'
6060
}
6161

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

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

117-
if (config.ignoreJsonKeys.includes(key)) {
118-
continue
119-
}
120-
else if (config.ignoreJsonPaths.includes(expandPath(currPath, key))) {
117+
if (config.ignoreJsonKeys.includes(key) || config.ignoreJsonPaths.includes(expandPath(currPath, key))) {
121118
continue
122119
}
123120

0 commit comments

Comments
 (0)