Skip to content

Commit

Permalink
test: fix multiple incorrect mustNotCall() uses
Browse files Browse the repository at this point in the history
  • Loading branch information
tniessen committed Jul 28, 2022
1 parent 339c40d commit 343ff66
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-console-log-stdio-broken-dest.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const stream = new Writable({
});
const myConsole = new Console(stream, stream);

process.on('warning', common.mustNotCall);
process.on('warning', common.mustNotCall());

stream.cork();
for (let i = 0; i < EventEmitter.defaultMaxListeners + 1; i++) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-dns-channel-cancel-promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const addMessageListener = () => {
server.removeAllListeners('message');

server.once('message', () => {
server.once('message', common.mustNotCall);
server.once('message', common.mustNotCall());

resolver.cancel();
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-dns-channel-cancel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const addMessageListener = () => {
server.removeAllListeners('message');

server.once('message', () => {
server.once('message', common.mustNotCall);
server.once('message', common.mustNotCall());

resolver.cancel();
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-https-fallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function onSession(session, next) {

function testNoTls() {
// HTTP/1.1 client
get(Object.assign(parse(origin), clientOptions), common.mustNotCall)
get(Object.assign(parse(origin), clientOptions), common.mustNotCall())
.on('error', common.mustCall(cleanup))
.on('error', common.mustCall(testWrongALPN))
.end();
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-stream-readable-reading-readingMore.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const Readable = require('stream').Readable;
assert.strictEqual(state.reading, false);
assert.strictEqual(state.readingMore, false);

const onReadable = common.mustNotCall;
const onReadable = common.mustNotCall();

readable.on('readable', onReadable);

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-zlib-invalid-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ nonStringInputs.forEach(common.mustCall((input) => {

unzips.forEach(common.mustCall((uz, i) => {
uz.on('error', common.mustCall());
uz.on('end', common.mustNotCall);
uz.on('end', common.mustNotCall());

// This will trigger error event
uz.write('this is not valid compressed data.');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-zlib-sync-no-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ const message = 'Come on, Fhqwhgads.';
const buffer = Buffer.from(message);

const zipper = new zlib.Gzip();
zipper.on('close', common.mustNotCall);
zipper.on('close', common.mustNotCall());

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

const unzipper = new zlib.Gunzip();
unzipper.on('close', common.mustNotCall);
unzipper.on('close', common.mustNotCall());

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

0 comments on commit 343ff66

Please sign in to comment.