Skip to content

Commit 3380530

Browse files
committed
log undefined and NaN values
1 parent 49d52c5 commit 3380530

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ const run = async ({ name, cb, caller }) => {
7474
} catch (error) {}
7575
if (stringable) {
7676
output = `${COLORS.PURPLE}expected:${COLORS.OFF} ${JSON.stringify(savedExpected)}\n${COLORS.YELLOW}received:${COLORS.OFF} ${JSON.stringify(savedActual)}\n`;
77+
} else if (`${savedActual}`.indexOf("[object") === -1 && `${savedExpected}`.indexOf("[object") === -1) {
78+
output = `${COLORS.PURPLE}expected:${COLORS.OFF} ${savedExpected}\n${COLORS.YELLOW}received:${COLORS.OFF} ${savedActual}\n`;
7779
} else if (output.includes(PLUS) || output.includes(MINUS)) {
7880
output += `\nkey: ${COLORS.YELLOW}received +${COLORS.OFF} ${COLORS.PURPLE}expected: -${COLORS.OFF}\n`;
7981
}

0 commit comments

Comments
 (0)