From 651398491b888bf5a51022aa3859152aacb4f796 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 5 Mar 2019 12:06:18 +0700 Subject: [PATCH] Fix tests for #174 --- test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test.js b/test.js index 1c11ada3b6..91fd135a7a 100644 --- a/test.js +++ b/test.js @@ -533,7 +533,7 @@ if (Promise.prototype.finally) { test('finally function is executed on failure', async t => { let called = false; - const err = await t.throws(m('exit', ['2']).finally(() => { + const err = await t.throwsAsync(m('exit', ['2']).finally(() => { called = true; })); t.is(called, true); @@ -542,14 +542,14 @@ if (Promise.prototype.finally) { }); test('throw in finally function bubbles up on success', async t => { - const result = await t.throws(m('noop', ['foo']).finally(() => { + const result = await t.throwsAsync(m('noop', ['foo']).finally(() => { throw new Error('called'); })); t.is(result.message, 'called'); }); test('throw in finally bubbles up on error', async t => { - const result = await t.throws(m('exit', ['2']).finally(() => { + const result = await t.throwsAsync(m('exit', ['2']).finally(() => { throw new Error('called'); })); t.is(result.message, 'called');