Skip to content

Commit

Permalink
test: add check in test-signal-handler
Browse files Browse the repository at this point in the history
* Check that the removed listener is not called.
* Opportunistic `==` -> `===` change.

PR-URL: #8248
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
Trott authored and Myles Borins committed Oct 10, 2016
1 parent 3345aab commit 4010cd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-signal-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,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', function() { sighup = true; });
process.kill(process.pid, 'SIGHUP');
Expand Down

0 comments on commit 4010cd6

Please sign in to comment.