summaryrefslogtreecommitdiff
path: root/test/message
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/message
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/message')
-rw-r--r--test/message/assert_throws_stack.out12
-rw-r--r--test/message/core_line_numbers.out2
-rw-r--r--test/message/error_exit.out7
3 files changed, 10 insertions, 11 deletions
diff --git a/test/message/assert_throws_stack.out b/test/message/assert_throws_stack.out
index 3d5f4de4cf..3013dbc028 100644
--- a/test/message/assert_throws_stack.out
+++ b/test/message/assert_throws_stack.out
@@ -2,13 +2,13 @@ assert.js:*
throw err;
^
-AssertionError [ERR_ASSERTION]: Input A expected to strictly deep-equal input B:
-+ expected - actual
+AssertionError [ERR_ASSERTION]: Expected inputs to be strictly deep-equal:
++ actual - expected
-- Comparison {}
-+ Comparison {
-+ bar: true
-+ }
++ Comparison {}
+- Comparison {
+- bar: true
+- }
at Object.<anonymous> (*assert_throws_stack.js:*:*)
at *
at *
diff --git a/test/message/core_line_numbers.out b/test/message/core_line_numbers.out
index b50e1678f4..fc647e41b9 100644
--- a/test/message/core_line_numbers.out
+++ b/test/message/core_line_numbers.out
@@ -3,7 +3,7 @@ punycode.js:42
^
RangeError: Invalid input
- at error (punycode.js:42:*)
+ at error (punycode.js:42:8)
at Object.decode (punycode.js:*:*)
at Object.<anonymous> (*test*message*core_line_numbers.js:*:*)
at Module._compile (internal/modules/cjs/loader.js:*:*)
diff --git a/test/message/error_exit.out b/test/message/error_exit.out
index 1935c18979..cc1edf46cb 100644
--- a/test/message/error_exit.out
+++ b/test/message/error_exit.out
@@ -3,11 +3,10 @@ assert.js:*
throw new AssertionError(obj);
^
-AssertionError [ERR_ASSERTION]: Input A expected to strictly equal input B:
-+ expected - actual
+AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
+
+1 !== 2
-- 1
-+ 2
at Object.<anonymous> (*test*message*error_exit.js:*:*)
at Module._compile (internal/modules/cjs/loader.js:*:*)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:*:*)