c8 icon indicating copy to clipboard operation
c8 copied to clipboard

When using koa, it has no effect

Open godkun opened this issue 3 years ago • 2 comments

image

After starting the Koa service, the browser accesses port 3000, and then checks the c8 report and finds that it has no effect

godkun avatar Mar 10 '22 03:03 godkun

I had the same issue, however the issue is not coming from c8, it's from how Nodejs handle the flag NODE_V8_COVERAGE Here what i'm doing on my project (express):

function closeServer() {
  server.close(() => {
    process.exit(0);
  })
}

process.on('SIGINT', closeServer)
process.on('SIGQUIT', closeServer)
process.on('SIGTERM', closeServer)

Closing the server properly before exiting the process. ref: https://github.com/nodejs/node/issues/29896

@bcoe I believe we can close this 😁

olivierodo avatar Dec 16 '22 15:12 olivierodo

@olivierodo an you confirm that this works with never releases of Node.js that contain the fix @olivierodo points to?

bcoe avatar Feb 14 '23 18:02 bcoe