From fc83fe7fe9682edb531184c45adf04b76255e287 Mon Sep 17 00:00:00 2001 From: David Govea Date: Wed, 13 Feb 2019 21:49:06 -0800 Subject: [PATCH] refactor some `throws` calls to `throwsAsync` error from ava: Function returned a promise. Use `t.throwsAsync()` instead: --- test/node.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/node.test.js b/test/node.test.js index 6738e10..2528b9e 100644 --- a/test/node.test.js +++ b/test/node.test.js @@ -68,21 +68,21 @@ test('should allow removal of auth() header', t => { test('should throw an error if we fail to pass a string `path`', async t => { const api = new Frisbee(options); - const error = await t.throws(() => api.get({})); + const error = await t.throwsAsync(api.get({})); t.is(error.message, '`path` must be a string'); }); test(`should throw an error if we fail to pass an object options`, async t => { const api = new Frisbee(options); - let error = await t.throws(() => api.get('', [])); + let error = await t.throwsAsync(() => api.get('', [])); t.is(error.message, '`options` must be an object'); - error = await t.throws(() => api.get('', 1)); + error = await t.throwsAsync(() => api.get('', 1)); t.is(error.message, '`options` must be an object'); }); test('should throw an error if we pass a non object `options`', async t => { const api = new Frisbee(options); - const error = await t.throws(() => api.get('', false)); + const error = await t.throwsAsync(() => api.get('', false)); t.is(error.message, '`options` must be an object'); });