From 12de99d982c85f3e0b5076b85d9af58cf46c0097 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 24 Feb 2017 22:18:25 -0800 Subject: [PATCH] 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 Reviewed-By: Gibson Fahnestock Reviewed-By: Timothy Gu Reviewed-By: Yuta Hiroto Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/common.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/common.js b/test/common.js index 69d930ec245522..88fed0708b75a9 100644 --- a/test/common.js +++ b/test/common.js @@ -402,8 +402,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(', ')}`); } });