Skip to content

Commit

Permalink
test(pipe) empty buffer | write file
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Nov 21, 2018
1 parent b777950 commit a396baf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const path = require('path');
const http = require('http');
const os = require('os');
const zlib = require('zlib');
const {Readable} = require('stream');

const through2 = require('through2');
const pump = require('pump');
Expand Down Expand Up @@ -32,6 +33,19 @@ test('check parameters', (t) => {
t.end();
});

test('empty buffer | write file', async (t) => {
const inStream = new Readable({
read() {}
});

inStream.push(null);

const [e] = await tryToCatch(_pipe, [inStream, fs.createWriteStream('/')]);

t.equal(e.code, 'EISDIR', 'should equal');
t.end();
});

test('file1 | gunzip maybe: error', async (t) => {
const file = fs.createReadStream('/hello');

Expand Down

0 comments on commit a396baf

Please sign in to comment.