Skip to content

Commit e5de225

Browse files
Trotttargos
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: #22912 PR-URL: #22849 Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent b31a4d0 commit e5de225

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

+1-1
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(() => {

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

+2-2
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)