• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const { mustNotCall, expectsError } = require('../common');
3const { Readable } = require('stream');
4
5async function* generate() {
6  yield null;
7}
8
9const stream = Readable.from(generate());
10
11stream.on('error', expectsError({
12  code: 'ERR_STREAM_NULL_VALUES',
13  name: 'TypeError',
14  message: 'May not write null values to stream'
15}));
16
17stream.on('data', mustNotCall((chunk) => {}));
18
19stream.on('end', mustNotCall());
20