Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix tests for #174
  • Loading branch information
sindresorhus committed Mar 5, 2019
1 parent 136987e commit 6513984
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test.js
Expand Up @@ -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);
Expand All @@ -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');
Expand Down

0 comments on commit 6513984

Please sign in to comment.