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: https://github.com/nodejs/node/pull/22888
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Rich Trott authored and Myles Borins committed 2018-09-25 16:45:59 -04:00
1 parent f2158f30fb
commit e9416d4f67
2 files changed
+3 -3

No files matched your search

@@ -48,7 +48,7 @@ server.on('stream', common.mustCall((stream) => {
}));
server.setTimeout(serverTimeout);
server.on('timeout', () => {
assert.strictEqual(didReceiveData, false, 'Should not timeout');
assert.ok(!didReceiveData, 'Should not timeout');
});
server.listen(0, common.mustCall(() => {
@@ -40,13 +40,13 @@ server.on('stream', common.mustCall((stream) => {
stream.write(content);
stream.setTimeout(serverTimeout);
stream.on('timeout', () => {
assert.strictEqual(didReceiveData, false, 'Should not timeout');
assert.ok(!didReceiveData, 'Should not timeout');
});
stream.end();
}));
server.setTimeout(serverTimeout);
server.on('timeout', () => {
assert.strictEqual(didReceiveData, false, 'Should not timeout');
assert.ok(!didReceiveData, 'Should not timeout');
});
server.listen(0, common.mustCall(() => {