Browse Source

ensure that piping really works

For #244
allow-304
Vsevolod Strukchinsky 8 years ago
parent
commit
b61401d631
  1. 6
      test/stream.js

6
test/stream.js

@ -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';
@ -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();
});

Loading…
Cancel
Save