Skip to content

Commit a6d53c6

Browse files
committed
test: add check in test-signal-handler
* Check that the removed listener is not called. * Opportunistic `==` -> `===` change. PR-URL: #8248 Reviewed-By: Colin Ihrig <[email protected]>
1 parent 0482d6d commit a6d53c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-signal-handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ var i = 0;
2222
setInterval(function() {
2323
console.log('running process...' + ++i);
2424

25-
if (i == 5) {
25+
if (i === 5) {
2626
process.kill(process.pid, 'SIGUSR1');
2727
}
2828
}, 1);
2929

3030
// Test on condition where a watcher for SIGNAL
3131
// has been previously registered, and `process.listeners(SIGNAL).length === 1`
32-
process.on('SIGHUP', function() {});
32+
process.on('SIGHUP', function() { common.fail('should not run'); });
3333
process.removeAllListeners('SIGHUP');
3434
process.on('SIGHUP', common.mustCall(function() {}));
3535
process.kill(process.pid, 'SIGHUP');

0 commit comments

Comments
 (0)