Skip to content

Commit beaf5f5

Browse files
fossamagnaruyadorno
authored andcommitted
test: use mustSucceed instead of mustCall with assert.ifError
PR-URL: #44196 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 0e20072 commit beaf5f5

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

test/sequential/test-inspector-open.js

+6-9
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,23 @@ let firstPort;
3232
function firstOpen(msg) {
3333
assert.strictEqual(msg.cmd, 'url');
3434
const port = url.parse(msg.url).port;
35-
ping(port, (err) => {
36-
assert.ifError(err);
35+
ping(port, common.mustSucceed(() => {
3736
// Inspector is already open, and won't be reopened, so args don't matter.
3837
child.send({ cmd: 'open', args: [kOpenWhileOpen] });
3938
child.once('message', common.mustCall(tryToOpenWhenOpen));
4039
firstPort = port;
41-
});
40+
}));
4241
}
4342

4443
function tryToOpenWhenOpen(msg) {
4544
assert.strictEqual(msg.cmd, 'url');
4645
const port = url.parse(msg.url).port;
4746
// Reopen didn't do anything, the port was already open, and has not changed.
4847
assert.strictEqual(port, firstPort);
49-
ping(port, (err) => {
50-
assert.ifError(err);
48+
ping(port, common.mustSucceed(() => {
5149
child.send({ cmd: 'close' });
5250
child.once('message', common.mustCall(closeWhenOpen));
53-
});
51+
}));
5452
}
5553

5654
function closeWhenOpen(msg) {
@@ -73,10 +71,9 @@ function tryToCloseWhenClosed(msg) {
7371
function reopenAfterClose(msg) {
7472
assert.strictEqual(msg.cmd, 'url');
7573
const port = url.parse(msg.url).port;
76-
ping(port, (err) => {
77-
assert.ifError(err);
74+
ping(port, common.mustSucceed(() => {
7875
process.exit();
79-
});
76+
}));
8077
}
8178

8279
function ping(port, callback) {

0 commit comments

Comments
 (0)