summaryrefslogtreecommitdiff
path: root/test/parallel/test-assert-checktag.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-07-03 02:06:57 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2018-08-04 10:04:32 +0200
commit0518b9edf33bfffac53ac5f706694a205ff754a2 (patch)
tree23b152f429dfadeb65b7ec97ab78b3214547c7ec /test/parallel/test-assert-checktag.js
parenta2ec80851ceff8ba6745d6909c8a2434ddfdf568 (diff)
downloadandroid-node-v8-0518b9edf33bfffac53ac5f706694a205ff754a2.tar.gz
android-node-v8-0518b9edf33bfffac53ac5f706694a205ff754a2.tar.bz2
android-node-v8-0518b9edf33bfffac53ac5f706694a205ff754a2.zip
assert: multiple improvements
1) Switched + / - and red / green in diffs. It seems like that style is more natural to most people. 2) Short primitives do not use the diff anymore. Especially short numbers can be read well like 1 !== 2. Cases that can not be displayed like that (e.g., -0 and +0) use the regular diff output. 3) Improved error descriptions. It was not always clear what the messages stood for. That should now be resolved. 4) Added a position indicator for single lines in case a tty is used and the line is shorter than the visual columns. 5) Color detection is now done by checking stderr instead of stdout. PR-URL: https://github.com/nodejs/node/pull/21628 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Diffstat (limited to 'test/parallel/test-assert-checktag.js')
-rw-r--r--test/parallel/test-assert-checktag.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-assert-checktag.js b/test/parallel/test-assert-checktag.js
index 70a67e15d3..754e564914 100644
--- a/test/parallel/test-assert-checktag.js
+++ b/test/parallel/test-assert-checktag.js
@@ -26,15 +26,15 @@ if (process.stdout.isTTY)
assert.throws(
() => assert.deepStrictEqual(date, fake),
{
- message: 'Input A expected to strictly deep-equal input B:\n' +
- '+ expected - actual\n\n- 2016-01-01T00:00:00.000Z\n+ Date {}'
+ message: 'Expected inputs to be strictly deep-equal:\n' +
+ '+ actual - expected\n\n+ 2016-01-01T00:00:00.000Z\n- Date {}'
}
);
assert.throws(
() => assert.deepStrictEqual(fake, date),
{
- message: 'Input A expected to strictly deep-equal input B:\n' +
- '+ expected - actual\n\n- Date {}\n+ 2016-01-01T00:00:00.000Z'
+ message: 'Expected inputs to be strictly deep-equal:\n' +
+ '+ actual - expected\n\n+ Date {}\n- 2016-01-01T00:00:00.000Z'
}
);
}