|
@ -1,5 +1,6 @@ |
|
|
import test from 'ava'; |
|
|
import test from 'ava'; |
|
|
import intoStream from 'into-stream'; |
|
|
import intoStream from 'into-stream'; |
|
|
|
|
|
import getStream from 'get-stream'; |
|
|
import got from '../'; |
|
|
import got from '../'; |
|
|
import {createServer} from './helpers/server'; |
|
|
import {createServer} from './helpers/server'; |
|
|
|
|
|
|
|
@ -133,6 +134,11 @@ test('check for pipe method', t => { |
|
|
t.is(typeof stream.on('error', () => {}).pipe, 'function'); |
|
|
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 () => { |
|
|
test.after('cleanup', async () => { |
|
|
await s.close(); |
|
|
await s.close(); |
|
|
}); |
|
|
}); |
|
|