diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2019-01-27 04:02:46 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-03-03 23:33:46 +0100 |
commit | 6c38fcff1d074e058d427e817a0a61c0f03e0aba (patch) | |
tree | 735a256ddafa78d69abafe2f331f3b6bef3e9931 /test/parallel/test-path-join.js | |
parent | f871c80a6d4a78438d6e19ec9ef812d53fc75c92 (diff) | |
download | android-node-v8-6c38fcff1d074e058d427e817a0a61c0f03e0aba.tar.gz android-node-v8-6c38fcff1d074e058d427e817a0a61c0f03e0aba.tar.bz2 android-node-v8-6c38fcff1d074e058d427e817a0a61c0f03e0aba.zip |
test: only inspect on failure
The inspection was done in all cases so far and that's not necessary.
Therefore this changed this behavior to only inspect the input on
failure cases.
PR-URL: https://github.com/nodejs/node/pull/26360
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/parallel/test-path-join.js')
-rw-r--r-- | test/parallel/test-path-join.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/parallel/test-path-join.js b/test/parallel/test-path-join.js index 945cf0e9b5..a9fb5b1e92 100644 --- a/test/parallel/test-path-join.js +++ b/test/parallel/test-path-join.js @@ -131,11 +131,12 @@ joinTests.forEach((test) => { } else { os = 'posix'; } - const message = - `path.${os}.join(${test[0].map(JSON.stringify).join(',')})\n expect=${ + if (actual !== expected && actualAlt !== expected) { + const delimiter = test[0].map(JSON.stringify).join(','); + const message = `path.${os}.join(${delimiter})\n expect=${ JSON.stringify(expected)}\n actual=${JSON.stringify(actual)}`; - if (actual !== expected && actualAlt !== expected) failures.push(`\n${message}`); + } }); }); }); |