Skip to content

Commit 52c485e

Browse files
committed
logs(test-sdk): add child process exit/close/error logs for app-prompt test and explicitly kill after assertion
1 parent c850d62 commit 52c485e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test-sdk/main.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ ava.serial('app-prompt.js', async (t) => {
5858
}
5959
});
6060

61+
mockApp.on('exit', (code, signal) => {
62+
console.log('[app-diag] child exit', { code, signal })
63+
})
64+
mockApp.on('close', (code, signal) => {
65+
console.log('[app-diag] child close', { code, signal })
66+
})
67+
mockApp.on('error', (err) => {
68+
console.log('[app-diag] child error', { message: err?.message })
69+
})
70+
6171
mockApp.on('spawn', () => {
6272
mockApp.send(
6373
{
@@ -71,6 +81,8 @@ ava.serial('app-prompt.js', async (t) => {
7181

7282
t.log({ result, command });
7383
t.is(result.value.command, command);
84+
// Be explicit: close the child if still running
85+
try { mockApp.kill() } catch {}
7486
});
7587

7688
ava.serial('kit setup', async (t) => {

0 commit comments

Comments
 (0)