Skip to content

Commit

Permalink
test,child_process: add tests for signalCode value
Browse files Browse the repository at this point in the history
Prior to this change, none of the child_process tests checked the
signalCode property for a value other than null. Add a check to an
existing test.

PR-URL: nodejs#35327
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
  • Loading branch information
Trott authored and joesepi committed Oct 22, 2020
1 parent 5b497d2 commit b23b43f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/parallel/test-child-process-kill.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ cat.stderr.on('end', common.mustCall());
cat.on('exit', common.mustCall((code, signal) => {
assert.strictEqual(code, null);
assert.strictEqual(signal, 'SIGTERM');
assert.strictEqual(cat.signalCode, 'SIGTERM');
}));

assert.strictEqual(cat.signalCode, null);
assert.strictEqual(cat.killed, false);
cat.kill();
assert.strictEqual(cat.killed, true);

0 comments on commit b23b43f

Please sign in to comment.