Skip to content

Commit

Permalink
Refine test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhut committed Feb 26, 2019
1 parent bfedb34 commit 36a89f3
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'ava'
import * as http from 'http'
import { createServer } from 'http'
import axiosist from '.'

test('should request', t =>
Expand Down Expand Up @@ -93,10 +93,9 @@ test('should response redirect', t =>
t.is(response.headers.location, 'http://example.com/')
}))

test('should work with http server', t => {
const app = http.createServer((req, res) => {
res.end('foo')
})

return axiosist(app).get('/').then(() => t.pass())
})
test('should work with http server', t =>
axiosist(
createServer((req, res) => res.end('foo'))
).get('/').then(response => {
t.is(response.data, 'foo')
}))

0 comments on commit 36a89f3

Please sign in to comment.