summaryrefslogtreecommitdiff
path: root/test/parallel/test-signal-handler.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-08-23 23:18:23 -0700
committerRich Trott <rtrott@gmail.com>2016-08-26 09:34:12 -0700
commita6d53c67795bf957b8b57d96814520f98069e80e (patch)
treeed91b974805bf926ad629de4f00aa257bb9f35ad /test/parallel/test-signal-handler.js
parent0482d6d59239a1d9cd594509aeda528688489c5a (diff)
downloadandroid-node-v8-a6d53c67795bf957b8b57d96814520f98069e80e.tar.gz
android-node-v8-a6d53c67795bf957b8b57d96814520f98069e80e.tar.bz2
android-node-v8-a6d53c67795bf957b8b57d96814520f98069e80e.zip
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 <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel/test-signal-handler.js')
-rw-r--r--test/parallel/test-signal-handler.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-signal-handler.js b/test/parallel/test-signal-handler.js
index a058c7ef31..079c72a9e5 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');