Skip to content

Commit a48469f

Browse files
TrottMylesBorins
authored andcommitted
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 8dfab3a commit a48469f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-signal-handler.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ var i = 0;
3232
setInterval(function() {
3333
console.log('running process...' + ++i);
3434

35-
if (i == 5) {
35+
if (i === 5) {
3636
process.kill(process.pid, 'SIGUSR1');
3737
}
3838
}, 1);
3939

4040
// Test on condition where a watcher for SIGNAL
4141
// has been previously registered, and `process.listeners(SIGNAL).length === 1`
42-
process.on('SIGHUP', function() {});
42+
process.on('SIGHUP', function() { common.fail('should not run'); });
4343
process.removeAllListeners('SIGHUP');
4444
process.on('SIGHUP', function() { sighup = true; });
4545
process.kill(process.pid, 'SIGHUP');

0 commit comments

Comments
 (0)