mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
test: assert diff no color
PR-URL: https://github.com/nodejs/node/pull/24181 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
7cd08eb100
commit
a2c2c78e09
2 changed files with 19 additions and 0 deletions
19
test/pseudo-tty/test-assert-no-color.js
Normal file
19
test/pseudo-tty/test-assert-no-color.js
Normal file
|
@ -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);
|
||||||
|
}
|
0
test/pseudo-tty/test-assert-no-color.out
Normal file
0
test/pseudo-tty/test-assert-no-color.out
Normal file
Loading…
Add table
Add a link
Reference in a new issue