From a6d53c67795bf957b8b57d96814520f98069e80e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 23 Aug 2016 23:18:23 -0700 Subject: [PATCH] test: add check in test-signal-handler * Check that the removed listener is not called. * Opportunistic `==` -> `===` change. PR-URL: https://github.com/nodejs/node/pull/8248 Reviewed-By: Colin Ihrig --- test/parallel/test-signal-handler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-signal-handler.js b/test/parallel/test-signal-handler.js index a058c7ef31007c..079c72a9e56a8a 100644 --- a/test/parallel/test-signal-handler.js +++ b/test/parallel/test-signal-handler.js @@ -22,14 +22,14 @@ var i = 0; setInterval(function() { console.log('running process...' + ++i); - if (i == 5) { + if (i === 5) { process.kill(process.pid, 'SIGUSR1'); } }, 1); // Test on condition where a watcher for SIGNAL // has been previously registered, and `process.listeners(SIGNAL).length === 1` -process.on('SIGHUP', function() {}); +process.on('SIGHUP', function() { common.fail('should not run'); }); process.removeAllListeners('SIGHUP'); process.on('SIGHUP', common.mustCall(function() {})); process.kill(process.pid, 'SIGHUP');