The Wayback Machine - https://web.archive.org/web/20250407172938/https://github.com/nodejs/node/commit/9e4ce6fc8e
Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Commit 9e4ce6f

Browse filesBrowse files
Trottaddaleax
authored andcommitted
test: refactor test-async-wrap-*
* `assert.equal()` -> `assert.strictEqual()` * add duration to `setTimeout()` PR-URL: #9663 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
1 parent 3130414 commit 9e4ce6f
Copy full SHA for 9e4ce6f

4 files changed

+18
-18
lines changed

‎test/parallel/test-async-wrap-check-providers.js

Copy file name to clipboardexpand all lines: test/parallel/test-async-wrap-check-providers.js
+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async_wrap.setupHooks({ init });
4141
async_wrap.enable();
4242

4343

44-
setTimeout(function() { });
44+
setTimeout(function() { }, 1);
4545

4646
fs.stat(__filename, noop);
4747

‎test/parallel/test-async-wrap-disabled-propagate-parent.js

Copy file name to clipboardexpand all lines: test/parallel/test-async-wrap-disabled-propagate-parent.js
+7-7
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ function init(uid, type, parentUid, parentHandle) {
1818
cntr++;
1919
// Cannot assert in init callback or will abort.
2020
process.nextTick(() => {
21-
assert.equal(providers[type], 'TCPWRAP');
22-
assert.equal(parentUid, server._handle[uidSymbol],
23-
'server uid doesn\'t match parent uid');
24-
assert.equal(parentHandle, server._handle,
25-
'server handle doesn\'t match parent handle');
26-
assert.equal(this, client._handle, 'client doesn\'t match context');
21+
assert.strictEqual(providers[type], 'TCPWRAP');
22+
assert.strictEqual(parentUid, server._handle[uidSymbol],
23+
'server uid doesn\'t match parent uid');
24+
assert.strictEqual(parentHandle, server._handle,
25+
'server handle doesn\'t match parent handle');
26+
assert.strictEqual(this, client._handle, 'client doesn\'t match context');
2727
});
2828
}
2929
}
@@ -48,5 +48,5 @@ async_wrap.disable();
4848

4949
process.on('exit', function() {
5050
// init should have only been called once with a parent.
51-
assert.equal(cntr, 1);
51+
assert.strictEqual(cntr, 1);
5252
});

‎test/parallel/test-async-wrap-propagate-parent.js

Copy file name to clipboardexpand all lines: test/parallel/test-async-wrap-propagate-parent.js
+7-7
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ function init(uid, type, parentUid, parentHandle) {
1818
cntr++;
1919
// Cannot assert in init callback or will abort.
2020
process.nextTick(() => {
21-
assert.equal(providers[type], 'TCPWRAP');
22-
assert.equal(parentUid, server._handle[uidSymbol],
23-
'server uid doesn\'t match parent uid');
24-
assert.equal(parentHandle, server._handle,
25-
'server handle doesn\'t match parent handle');
26-
assert.equal(this, client._handle, 'client doesn\'t match context');
21+
assert.strictEqual(providers[type], 'TCPWRAP');
22+
assert.strictEqual(parentUid, server._handle[uidSymbol],
23+
'server uid doesn\'t match parent uid');
24+
assert.strictEqual(parentHandle, server._handle,
25+
'server handle doesn\'t match parent handle');
26+
assert.strictEqual(this, client._handle, 'client doesn\'t match context');
2727
});
2828
}
2929
}
@@ -47,5 +47,5 @@ const server = net.createServer(function(c) {
4747

4848
process.on('exit', function() {
4949
// init should have only been called once with a parent.
50-
assert.equal(cntr, 1);
50+
assert.strictEqual(cntr, 1);
5151
});

‎test/parallel/test-async-wrap-throw-from-callback.js

Copy file name to clipboardexpand all lines: test/parallel/test-async-wrap-throw-from-callback.js
+3-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ if (typeof process.argv[2] === 'string') {
4040
} else {
4141

4242
process.on('exit', (code) => {
43-
assert.equal(msgCalled, callbacks.length);
44-
assert.equal(msgCalled, msgReceived);
43+
assert.strictEqual(msgCalled, callbacks.length);
44+
assert.strictEqual(msgCalled, msgReceived);
4545
});
4646

4747
callbacks.forEach((item) => {
@@ -58,7 +58,7 @@ if (typeof process.argv[2] === 'string') {
5858
if (errstring.includes('Error: ' + item))
5959
msgReceived++;
6060

61-
assert.equal(code, 1, `${item} closed with code ${code}`);
61+
assert.strictEqual(code, 1, `${item} closed with code ${code}`);
6262
});
6363
});
6464
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.