1'use strict';
2const common = require('../common');
3common.skipIfWorker();
4
5// Test that 'exit' is emitted if 'beforeExit' throws.
6
7process.on('exit', common.mustCall(() => {
8  process.exitCode = 0;
9}));
10process.on('beforeExit', common.mustCall(() => {
11  throw new Error();
12}));
13