0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-24 20:29:23 +01:00
nodejs/test/parallel/test-stream-readable-with-unimplemented-_read.js
Robert Nagy 09d8c0c8d2 stream: destroy readable on read error
PR-URL: https://github.com/nodejs/node/pull/39342
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-07-12 12:08:43 +02:00

14 lines
338 B
JavaScript

'use strict';
const common = require('../common');
const { Readable } = require('stream');
const readable = new Readable();
readable.read();
readable.on('error', common.expectsError({
code: 'ERR_METHOD_NOT_IMPLEMENTED',
name: 'Error',
message: 'The _read() method is not implemented'
}));
readable.on('close', common.mustCall());