Browse Source

Fix http.request throw error test

error-handling
Luke Childs 7 years ago
parent
commit
bee1210cd3
  1. 4
      test/error.js

4
test/error.js

@ -73,8 +73,8 @@ test.serial('http.request error', async t => {
throw new TypeError('The header content contains invalid characters'); throw new TypeError('The header content contains invalid characters');
}); });
const err = await t.throws(got(s.url)); const err = await t.throws(got(s.url));
t.truthy(err instanceof TypeError); t.true(err instanceof got.RequestError);
t.regex(err.message, /The header content contains invalid characters/); t.is(err.message, 'The header content contains invalid characters');
stub.restore(); stub.restore();
}); });

Loading…
Cancel
Save