From fc37133db97bc402ffb367c1c5f0d172dd962af2 Mon Sep 17 00:00:00 2001 From: MURAKAMI Masahiko Date: Wed, 10 Aug 2022 08:57:00 +0900 Subject: [PATCH] test: usemustSucceed instead of mustCall with assert.ifError --- test/sequential/test-inspector-open.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/test/sequential/test-inspector-open.js b/test/sequential/test-inspector-open.js index 847f0ab6926f67..93a2c74a0e4156 100644 --- a/test/sequential/test-inspector-open.js +++ b/test/sequential/test-inspector-open.js @@ -32,13 +32,12 @@ let firstPort; function firstOpen(msg) { assert.strictEqual(msg.cmd, 'url'); const port = url.parse(msg.url).port; - ping(port, (err) => { - assert.ifError(err); + ping(port, common.mustSucceed(() => { // Inspector is already open, and won't be reopened, so args don't matter. child.send({ cmd: 'open', args: [kOpenWhileOpen] }); child.once('message', common.mustCall(tryToOpenWhenOpen)); firstPort = port; - }); + })); } function tryToOpenWhenOpen(msg) { @@ -46,11 +45,10 @@ function tryToOpenWhenOpen(msg) { const port = url.parse(msg.url).port; // Reopen didn't do anything, the port was already open, and has not changed. assert.strictEqual(port, firstPort); - ping(port, (err) => { - assert.ifError(err); + ping(port, common.mustSucceed(() => { child.send({ cmd: 'close' }); child.once('message', common.mustCall(closeWhenOpen)); - }); + })); } function closeWhenOpen(msg) { @@ -73,10 +71,9 @@ function tryToCloseWhenClosed(msg) { function reopenAfterClose(msg) { assert.strictEqual(msg.cmd, 'url'); const port = url.parse(msg.url).port; - ping(port, (err) => { - assert.ifError(err); + ping(port, common.mustSucceed(() => { process.exit(); - }); + })); } function ping(port, callback) {