Skip to content

Commit

Permalink
Upgrade signal-exit to v4 (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky authored Aug 6, 2023
1 parent 65992b4 commit 468fbe1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/kill.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os from 'node:os';
import onExit from 'signal-exit';
import {onExit} from 'signal-exit';

const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"merge-stream": "^2.0.0",
"npm-run-path": "^5.1.0",
"onetime": "^6.0.0",
"signal-exit": "^3.0.7",
"signal-exit": "^4.1.0",
"strip-final-newline": "^3.0.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions test/kill.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,17 @@ test('spawnAndKill cleanup detached SIGKILL', spawnAndKill, ['SIGKILL', true, tr
// See #128
test('removes exit handler on exit', async t => {
// @todo this relies on `signal-exit` internals
const emitter = process.__signal_exit_emitter__;
const emitter = globalThis[Symbol.for('signal-exit emitter')];

const subprocess = execa('noop.js');
const listener = emitter.listeners('exit').pop();
const listener = emitter.listeners.exit.at(-1);

await new Promise((resolve, reject) => {
subprocess.on('error', reject);
subprocess.on('exit', resolve);
});

const included = emitter.listeners('exit').includes(listener);
const included = emitter.listeners.exit.includes(listener);
t.false(included);
});

Expand Down

0 comments on commit 468fbe1

Please sign in to comment.