From 21c5c78da765bf4f994d257a625fd70a97e03931 Mon Sep 17 00:00:00 2001 From: Alexander Tesfamichael Date: Thu, 4 May 2017 04:54:48 +0200 Subject: [PATCH] Simplify URL argument test (#296) --- test/arguments.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/arguments.js b/test/arguments.js index a772a57..ac40c96 100644 --- a/test/arguments.js +++ b/test/arguments.js @@ -24,12 +24,8 @@ test.before('setup', async () => { }); test('url is required', async t => { - try { - await got(); - t.fail('Exception was not thrown'); - } catch (err) { - t.regex(err.message, /Parameter `url` must be a string or object, not undefined/); - } + const err = await t.throws(got()); + t.regex(err.message, /Parameter `url` must be a string or object, not undefined/); }); test('options are optional', async t => {