From 8ba62c7195266bd76de4692751e063ad4cc3d573 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 --- 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();