Skip to content

Commit

Permalink
test: improve console table error output
Browse files Browse the repository at this point in the history
The former error output was not readable in case of an error. This
improves it by splitting the lines and therefore creating a nice and
readable diff.

PR-URL: #20960
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
BridgeAR authored and targos committed Jul 14, 2018
1 parent 8b0c6d8 commit cee8677
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/parallel/test-console-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ function test(data, only, expected) {
only = undefined;
}
console.table(data, only);
assert.strictEqual(queue.shift(), expected.trimLeft());
assert.deepStrictEqual(
queue.shift().split('\n'),
expected.trimLeft().split('\n')
);
}

common.expectsError(() => console.table([], false), {
Expand Down

0 comments on commit cee8677

Please sign in to comment.