diff --git a/test/parallel/test-signal-handler-remove-on-exit.js b/test/parallel/test-signal-handler-remove-on-exit.js new file mode 100644 index 00000000000000..1c87497172e66a --- /dev/null +++ b/test/parallel/test-signal-handler-remove-on-exit.js @@ -0,0 +1,9 @@ +'use strict'; +require('../common'); + +// Regression test for https://github.com/nodejs/node/issues/30581 +// This script should not crash. + +function dummy() {} +process.on('SIGINT', dummy); +process.on('exit', () => process.removeListener('SIGINT', dummy));