Skip to content

Commit 3dc48f9

Browse files
authored
chore: output both received value and diff for string expected results (#1287)
1 parent c881248 commit 3dc48f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

utils/testrunner/Matchers.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ function stringFormatter(received, expected) {
8383
}).join('');
8484
const output = [
8585
`Expected: ${expected}`,
86-
`Received: ${highlighted}`,
86+
`Received: ${received}`,
87+
` Diff: ${highlighted}`,
8788
];
8889
for (let i = 0; i < Math.min(expected.length, received.length); ++i) {
8990
if (expected[i] !== received[i]) {
90-
const padding = ' '.repeat('Expected: '.length);
91+
const padding = ' '.repeat(' Diff: '.length);
9192
const firstDiffCharacter = '~'.repeat(i) + '^';
9293
output.push(colors.red(padding + firstDiffCharacter));
9394
break;

0 commit comments

Comments
 (0)