summaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-readable-data.js
blob: 277adddde635844d999521c4de20cc0df348db7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict';
const common = require('../common');

const { Readable } = require('stream');

const readable = new Readable({
  read() {}
});

function read() {}

readable.setEncoding('utf8');
readable.on('readable', read);
readable.removeListener('readable', read);

process.nextTick(function() {
  readable.on('data', common.mustCall());
  readable.push('hello');
});