Skip to content

Commit

Permalink
ensure that piping really works
Browse files Browse the repository at this point in the history
For #244
  • Loading branch information
floatdrop committed Nov 14, 2016
1 parent 892813f commit b61401d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/stream.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import test from 'ava';
import intoStream from 'into-stream';
import getStream from 'get-stream';
import got from '../';
import {createServer} from './helpers/server';

Expand Down Expand Up @@ -133,6 +134,11 @@ test('check for pipe method', t => {
t.is(typeof stream.on('error', () => {}).pipe, 'function');
});

test('piping works', async t => {
t.is(await getStream(got.stream(`${s.url}/`)), 'ok');
t.is(await getStream(got.stream(`${s.url}/`).on('error', () => {})), 'ok');
});

test.after('cleanup', async () => {
await s.close();
});

0 comments on commit b61401d

Please sign in to comment.