Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-02-25 09:18:25 +0300
committerItalo A. Casas <me@italoacasas.com>2017-02-28 05:18:44 +0300
commitf193c6f996bce6979c017bdb94886dee9f3bc6f4 (patch)
treed904cbea8e34c5e186150684a6a6d58ca411c205 /test
parent128f812157effe0260818052541038e3876236cf (diff)
test: favor assertions over console logging
Communicate about leaked globals via `AssertionError` rather than `console.log()`. PR-URL: https://github.com/nodejs/node/pull/11547 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/common.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/common.js b/test/common.js
index b451b455ea1..270115263e6 100644
--- a/test/common.js
+++ b/test/common.js
@@ -399,8 +399,7 @@ process.on('exit', function() {
if (!exports.globalCheck) return;
const leaked = leakedGlobals();
if (leaked.length > 0) {
- console.error('Unknown globals: %s', leaked);
- fail('Unknown global found');
+ fail(`Unexpected global(s) found: ${leaked.join(', ')}`);
}
});