From efe9b97d4028006c2ff1fc63df96945bac5131d3 Mon Sep 17 00:00:00 2001 From: himself65 Date: Wed, 31 Jul 2019 01:36:19 +0800 Subject: [PATCH] test: refactor test-beforeexit-event-exit using mustNotCall PR-URL: https://github.com/nodejs/node/pull/28901 Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott Reviewed-By: Yongsheng Zhang Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- test/parallel/test-beforeexit-event-exit.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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();