diff --git a/playground/node/index.ts b/playground/node/index.ts index 45f2a20..f1aff6f 100644 --- a/playground/node/index.ts +++ b/playground/node/index.ts @@ -6,6 +6,7 @@ const server = createServer((req, res) => { res.writeHead(200) res.end(`detect accpect-language: ${languages}`) + process.exit() }) server.listen(8123) diff --git a/playground/node/node.test.mjs b/playground/node/node.test.mjs index 307e810..0413e4b 100644 --- a/playground/node/node.test.mjs +++ b/playground/node/node.test.mjs @@ -17,6 +17,15 @@ test('node integration test', async () => { const res = await fetch(req) await sleep(1000) + console.log(child.pid) + + const cleanup = () => { + process.kill(child.pid) + } + + process.on('SIGINT', cleanup) + process.on('SIGTERM', cleanup) + process.on('SIGQUIT', cleanup) + assert.deepEqual('detect accpect-language: en-US,en,ja', await res.text()) - child.kill('SIGINT') })