summaryrefslogtreecommitdiff
path: root/test/parallel/test-process-beforeexit-throw-exit.js
blob: 6e9d764be90baa9d9ba2e0b3af50c28418c294cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
'use strict';
const common = require('../common');
common.skipIfWorker();

// Test that 'exit' is emitted if 'beforeExit' throws.

process.on('exit', common.mustCall(() => {
  process.exitCode = 0;
}));
process.on('beforeExit', common.mustCall(() => {
  throw new Error();
}));