Skip to content

Commit 8798154

Browse files
committed
Test
1 parent bd91063 commit 8798154

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

test/return/result.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import {spawn} from 'node:child_process';
2+
import {setTimeout} from 'node:timers/promises';
23
import test from 'ava';
3-
import {setFixtureDirectory} from '../helpers/fixtures-directory.js';
4-
5-
setFixtureDirectory();
64

75
test('test this', async t => {
86
t.pass();
9-
const subprocess = spawn('node', ['--version']);
10-
subprocess.kill(0);
11-
await new Promise(resolve => {
12-
subprocess.on('exit', (exitCode, signalCode) => {
13-
console.log('exit', {exitCode, signalCode});
14-
resolve();
15-
});
7+
const subprocess = spawn('node', ['-e', 'console.log("a"); setTimeout(() => {console.log("b")}, 2e3)']);
8+
subprocess.stdout.on('data', chunk => {
9+
console.log(chunk);
10+
});
11+
subprocess.on('exit', (exitCode, signalCode) => {
12+
console.log({exitCode, signalCode});
1613
});
14+
await setTimeout(1e3);
15+
subprocess.kill('SIGHUP');
1716
});

0 commit comments

Comments
 (0)