Skip to content
Myr

Fix tests for #174

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sindre Sorhus · committed by Sindre Sorhus · parent 136987e · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:test.js+3 added-3 removed
531 unmodified lines
532 });533534 test('finally function is executed on failure', async t => {535 let called = false;536 const err = await t.throws(m('exit', ['2']).finally(() => {536 const err = await t.throwsAsync(m('exit', ['2']).finally(() => {537 called = true;538 }));539 t.is(called, true);540 t.is(typeof err.stdout, 'string');541 t.is(typeof err.stderr, 'string');542 });543544 test('throw in finally function bubbles up on success', async t => {545 const result = await t.throws(m('noop', ['foo']).finally(() => {545 const result = await t.throwsAsync(m('noop', ['foo']).finally(() => {546 throw new Error('called');547 }));548 t.is(result.message, 'called');549 });550551 test('throw in finally bubbles up on error', async t => {552 const result = await t.throws(m('exit', ['2']).finally(() => {552 const result = await t.throwsAsync(m('exit', ['2']).finally(() => {553 throw new Error('called');554 }));555 t.is(result.message, 'called');556 });
1 unmodified line