Skip to content

Commit

Permalink
test: assert diff no color
Browse files Browse the repository at this point in the history
PR-URL: nodejs#24181
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
fbilbie authored and Trott committed Nov 13, 2018
1 parent 7cd08eb commit a2c2c78
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/pseudo-tty/test-assert-no-color.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';
require('../common');
const assert = require('assert').strict;

process.env.NODE_DISABLE_COLORS = true;

try {
assert.deepStrictEqual({}, { foo: 'bar' });
} catch (error) {
const expected =
'Expected values to be strictly deep-equal:\n' +
'+ actual - expected\n' +
'\n' +
'+ {}\n' +
'- {\n' +
'- foo: \'bar\'\n' +
'- }';
assert.strictEqual(error.message, expected);
}
Empty file.

0 comments on commit a2c2c78

Please sign in to comment.