test: improve console table error output

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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Ruben Bridgewater 2018-05-25 12:12:40 +02:00 committed by Michaël Zasso
parent 8b0c6d8322
commit cee8677ac4
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600

View File

@ -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), {