From aa800b097ac16672eb8d2cbd47bb3367a961b9a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florin-Daniel=20B=C3=8ELB=C3=8EE?= Date: Tue, 6 Nov 2018 16:06:18 +0000 Subject: [PATCH] test: assert diff no color PR-URL: https://github.com/nodejs/node/pull/24181 Reviewed-By: Ruben Bridgewater Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- test/pseudo-tty/test-assert-no-color.js | 19 +++++++++++++++++++ test/pseudo-tty/test-assert-no-color.out | 0 2 files changed, 19 insertions(+) create mode 100644 test/pseudo-tty/test-assert-no-color.js create mode 100644 test/pseudo-tty/test-assert-no-color.out diff --git a/test/pseudo-tty/test-assert-no-color.js b/test/pseudo-tty/test-assert-no-color.js new file mode 100644 index 00000000000000..9412cdcc953ad7 --- /dev/null +++ b/test/pseudo-tty/test-assert-no-color.js @@ -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); +} diff --git a/test/pseudo-tty/test-assert-no-color.out b/test/pseudo-tty/test-assert-no-color.out new file mode 100644 index 00000000000000..e69de29bb2d1d6