summaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-readable-invalid-chunk.js
blob: fcd7414bb66632cf1bcae41e74ce297be6c8f9af (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 stream = require('stream');

const readable = new stream.Readable({
  read: () => {}
});

function checkError(fn) {
  common.expectsError(fn, {
    code: 'ERR_INVALID_ARG_TYPE',
    type: TypeError
  });
}

checkError(() => readable.push([]));
checkError(() => readable.push({}));
checkError(() => readable.push(0));