mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
d9f394e607
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>
20 lines
416 B
JavaScript
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());
|