test: refactor test-beforeexit-event-exit using mustNotCall

PR-URL: https://github.com/nodejs/node/pull/28901
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
himself65 2019-07-31 01:36:19 +08:00 committed by Rich Trott
parent b32526c488
commit 980df1c85f

View File

@ -20,11 +20,8 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../common');
const assert = require('assert');
const { mustNotCall } = require('../common');
process.on('beforeExit', function() {
assert.fail('exit should not allow this to occur');
});
process.on('beforeExit', mustNotCall('exit should not allow this to occur'));
process.exit();