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

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

{
  // Don't emit 'end' after 'close'.

  const r = new Readable();

  r.on('end', common.mustNotCall());
  r.resume();
  r.destroy();
  r.on('close', common.mustCall(() => {
    r.push(null);
  }));
}