From a6907b439919166a3f5d9d18cdef3afc5440245f Mon Sep 17 00:00:00 2001 From: Alexander Tesfamichael Date: Wed, 8 Mar 2017 19:54:40 +0100 Subject: [PATCH] Use error constructor to check for ParseError (#273) --- test/json.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/json.js b/test/json.js index 802d020..ddc0dae 100644 --- a/test/json.js +++ b/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); });