We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c96d7f commit fa8315cCopy full SHA for fa8315c
test/parallel/test-process-kill-null.js
@@ -1,27 +1,21 @@
1
'use strict';
2
-require('../common');
+const { mustCall } = require('../common');
3
const assert = require('assert');
4
-const spawn = require('child_process').spawn;
+const { spawn } = require('child_process');
5
6
const cat = spawn('cat');
7
-let called;
8
9
assert.ok(process.kill(cat.pid, 0));
10
11
-cat.on('exit', function() {
+cat.on('exit', mustCall(function() {
12
assert.throws(function() {
13
process.kill(cat.pid, 0);
14
}, Error);
15
-});
+}));
16
17
-cat.stdout.on('data', function() {
18
- called = true;
+cat.stdout.on('data', mustCall(function() {
19
process.kill(cat.pid, 'SIGKILL');
20
21
22
// EPIPE when null sig fails
23
cat.stdin.write('test');
24
-
25
-process.on('exit', function() {
26
- assert.ok(called);
27
0 commit comments