Skip to content

Commit

Permalink
fix: process showdown
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Oct 20, 2023
1 parent 7dbd5bb commit 3aeb0a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions playground/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const server = createServer((req, res) => {

res.writeHead(200)
res.end(`detect accpect-language: ${languages}`)
process.exit()
})

server.listen(8123)
Expand Down
11 changes: 10 additions & 1 deletion playground/node/node.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})

0 comments on commit 3aeb0a4

Please sign in to comment.