Browse Source

Use error constructor to check for ParseError (#273)

extract-response
Alexander Tesfamichael 8 years ago
committed by Sindre Sorhus
parent
commit
a6907b4399
  1. 3
      test/json.js

3
test/json.js

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

Loading…
Cancel
Save