summaryrefslogtreecommitdiff
path: root/test/parallel/test-readable-single-end.js
blob: 0969d49aa48e9852379e0e2cd9f570631701b2e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict';

const common = require('../common');
const { Readable } = require('stream');

// This test ensures that there will not be an additional empty 'readable'
// event when stream has ended (only 1 event signalling about end)

const r = new Readable({
  read: () => {},
});

r.push(null);

r.on('readable', common.mustCall());
r.on('end', common.mustCall());