Skip to content

Commit

Permalink
Use error constructor to check for ParseError (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextes authored and sindresorhus committed Mar 8, 2017
1 parent 919703c commit a6907b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ test('catches errors on invalid non-200 responses', async t => {
});

test('should have statusCode in err', async t => {
const err = await t.throws(got(`${s.url}/non200-invalid`, {json: true}), got.ParseError);
const err = await t.throws(got(`${s.url}/non200-invalid`, {json: true}));
t.is(err.constructor, got.ParseError);
t.is(err.statusCode, 500);
});

Expand Down

0 comments on commit a6907b4

Please sign in to comment.