Skip to content

Navigation Menu

Sign in
Appearance settings

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

Appearance settings

Commit e9416d4

Browse filesBrowse files
TrottMylesBorins
authored andcommitted
test: simplify assertion in http2 tests
In test-http2-timeout-large-write.js and test-http2-timeout-large-write-file.js: Use assert.ok() on a boolean that the test itself creates and sets, rather than assert.strictEqual(). This allows us to use a static message without running afoul of the upcoming "do not use string literals with assert.strictEqual()" lint rule. Backport-PR-URL: #22888 PR-URL: #22849 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent f2158f3 commit e9416d4
Copy full SHA for e9416d4

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎test/sequential/test-http2-timeout-large-write-file.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-http2-timeout-large-write-file.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ server.on('stream', common.mustCall((stream) => {
4848
}));
4949
server.setTimeout(serverTimeout);
5050
server.on('timeout', () => {
51-
assert.strictEqual(didReceiveData, false, 'Should not timeout');
51+
assert.ok(!didReceiveData, 'Should not timeout');
5252
});
5353

5454
server.listen(0, common.mustCall(() => {
Collapse file

‎test/sequential/test-http2-timeout-large-write.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-http2-timeout-large-write.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ server.on('stream', common.mustCall((stream) => {
4040
stream.write(content);
4141
stream.setTimeout(serverTimeout);
4242
stream.on('timeout', () => {
43-
assert.strictEqual(didReceiveData, false, 'Should not timeout');
43+
assert.ok(!didReceiveData, 'Should not timeout');
4444
});
4545
stream.end();
4646
}));
4747
server.setTimeout(serverTimeout);
4848
server.on('timeout', () => {
49-
assert.strictEqual(didReceiveData, false, 'Should not timeout');
49+
assert.ok(!didReceiveData, 'Should not timeout');
5050
});
5151

5252
server.listen(0, common.mustCall(() => {

0 commit comments

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