diff --git a/test/parallel/test-beforeexit-event-exit.js b/test/parallel/test-beforeexit-event-exit.js index 8c07da9ca962b2..4210ad04b6807d 100644 --- a/test/parallel/test-beforeexit-event-exit.js +++ b/test/parallel/test-beforeexit-event-exit.js @@ -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();