Skip to content

Commit 4d8674b

Browse files
authored
test: fix multiple incorrect mustNotCall() uses
This does not fix occurrences in test/parallel/test-dns-* because those tests contain unrelated pre-existing bugs that would cause the tests to fail with this fix. This unrelated bug in those tests should be fixed separately before the use of mustNotCall() can be fixed in those files. PR-URL: #44022 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 63aba56 commit 4d8674b

5 files changed

+6
-6
lines changed

test/parallel/test-console-log-stdio-broken-dest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const stream = new Writable({
1515
});
1616
const myConsole = new Console(stream, stream);
1717

18-
process.on('warning', common.mustNotCall);
18+
process.on('warning', common.mustNotCall());
1919

2020
stream.cork();
2121
for (let i = 0; i < EventEmitter.defaultMaxListeners + 1; i++) {

test/parallel/test-http2-https-fallback.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function onSession(session, next) {
141141

142142
function testNoTls() {
143143
// HTTP/1.1 client
144-
get(Object.assign(parse(origin), clientOptions), common.mustNotCall)
144+
get(Object.assign(parse(origin), clientOptions), common.mustNotCall())
145145
.on('error', common.mustCall(cleanup))
146146
.on('error', common.mustCall(testWrongALPN))
147147
.end();

test/parallel/test-stream-readable-reading-readingMore.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const Readable = require('stream').Readable;
124124
assert.strictEqual(state.reading, false);
125125
assert.strictEqual(state.readingMore, false);
126126

127-
const onReadable = common.mustNotCall;
127+
const onReadable = common.mustNotCall();
128128

129129
readable.on('readable', onReadable);
130130

test/parallel/test-zlib-invalid-input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ nonStringInputs.forEach(common.mustCall((input) => {
5353

5454
unzips.forEach(common.mustCall((uz, i) => {
5555
uz.on('error', common.mustCall());
56-
uz.on('end', common.mustNotCall);
56+
uz.on('end', common.mustNotCall());
5757

5858
// This will trigger error event
5959
uz.write('this is not valid compressed data.');

test/parallel/test-zlib-sync-no-event.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ const message = 'Come on, Fhqwhgads.';
77
const buffer = Buffer.from(message);
88

99
const zipper = new zlib.Gzip();
10-
zipper.on('close', common.mustNotCall);
10+
zipper.on('close', common.mustNotCall());
1111

1212
const zipped = zipper._processChunk(buffer, zlib.constants.Z_FINISH);
1313

1414
const unzipper = new zlib.Gunzip();
15-
unzipper.on('close', common.mustNotCall);
15+
unzipper.on('close', common.mustNotCall());
1616

1717
const unzipped = unzipper._processChunk(zipped, zlib.constants.Z_FINISH);
1818
assert.notStrictEqual(zipped.toString(), message);

0 commit comments

Comments
 (0)