Skip to content

Commit

Permalink
fix: Test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasdao committed Aug 14, 2017
1 parent b296642 commit 80caabc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ describe('index', () =>

const fn = serveHTTP('/users/{graphiqlpath}', { schema: {} }, appconfig)

const result_01 = fn(req_01, res_01).then(() => {
assert.equal(1,2, 'Requests with the wrong route should failed with a \'not found\' error.')
const result_01 = fn(req_01, res_01).then(res => {
assert.equal(res.statusCode, 404)
assert.equal(res._getData(), 'Endpoint \'/\' not found.')
})
.catch(err => assert.equal(err.message, 'Endpoint \'/\' not found.'))
.catch(err => assert.equal(1,2, `Should fail but still return a response.`))

return Promise.all([result_01])
})))
Expand Down

0 comments on commit 80caabc

Please sign in to comment.