I think @chrisdickonson came up with a good idea for how to approach this, if we capture an event on process.exit, we'll use spawnSync to output coverage in a subprocess.
const client = await CRI({port: port})
const {Profiler} = client
process.on('exit', () => {
process.spawnSync('ws-write-coverage.js', ())
client.close()
})
CC: @schuay, @bmeck