0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-stream-readable-next-no-null.js
Antoine du Hamel d9f394e607
test: remove unnecessary noop function args to mustNotCall()
PR-URL: https://github.com/nodejs/node/pull/48513
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2023-06-24 16:16:07 +02:00

20 lines
416 B
JavaScript

'use strict';
const { mustNotCall, expectsError } = require('../common');
const { Readable } = require('stream');
async function* generate() {
yield null;
}
const stream = Readable.from(generate());
stream.on('error', expectsError({
code: 'ERR_STREAM_NULL_VALUES',
name: 'TypeError',
message: 'May not write null values to stream'
}));
stream.on('data', mustNotCall());
stream.on('end', mustNotCall());