test: improve logged errors

To indicate which lines are test lines and which from Node.js core,
it's good to rely on `util.inspect()` while inspecting errors.

The stack was accessed directly instead in multiple cases and logging
that does not provide as much information as using `util.inspect()`.

PR-URL: https://github.com/nodejs/node/pull/31425
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yihong Wang <yh.wang@ibm.com>
This commit is contained in:
Ruben Bridgewater 2020-01-20 19:00:52 +01:00
parent 357230f4b7
commit 1450ea7bf6
No known key found for this signature in database
GPG key ID: F07496B3EB3C1762
14 changed files with 35 additions and 30 deletions

View file

@ -69,7 +69,7 @@ server.listen(common.PIPE, common.mustCall(function() {
}));
req.on('error', function(e) {
assert.fail(e.stack);
assert.fail(e);
});
req.end();