0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/pseudo-tty/test-assert-colors.js
Ruben Bridgewater 8a0fb137d8
assert: make skipping indicator blue
If lines gets skipped, they are marked with three dots. This makes
sure they are better visualized to distinguish them from everything
else.

PR-URL: https://github.com/nodejs/node/pull/20315
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-04-29 17:05:51 +02:00

22 lines
655 B
JavaScript

'use strict';
require('../common');
const assert = require('assert').strict;
try {
// Activate colors even if the tty does not support colors.
process.env.COLORTERM = '1';
assert.deepStrictEqual([1, 2, 2, 2], [2, 2, 2, 2]);
} catch (err) {
const expected = 'Input A expected to strictly deep-equal input B:\n' +
'\u001b[32m+ expected\u001b[39m \u001b[31m- actual\u001b[39m' +
' \u001b[34m...\u001b[39m Lines skipped\n\n' +
' [\n' +
'\u001b[31m-\u001b[39m 1,\n' +
'\u001b[32m+\u001b[39m 2,\n' +
' 2,\n' +
'\u001b[34m...\u001b[39m\n' +
' 2\n' +
' ]';
assert.strictEqual(err.message, expected);
}