Skip to content

Conversation

@novemberborn
Copy link
Member

PR #576 changed the t.throws() assertion to return the thrown error, or if asynchronous a promise for the rejection reason. Unfortunately this only worked for asynchronous errors.

The tests cover the changes in lib/assert.js but t.throws() is an enhanced assertion. This commit ensures any values returned from lib/assert.js assertions are indeed returned by the corresponding t. assertions.

PR #576 changed the `t.throws()` assertion to return the thrown error, or if
asynchronous a promise for the rejection reason. Unfortunately this only worked
for asynchronous errors.

The tests cover the changes in `lib/assert.js` but `t.throws()` is an *enhanced*
assertion. This commit ensures any values returned from `lib/assert.js`
assertions are indeed returned by the corresponding `t.` assertions.
@jamestalmage
Copy link
Contributor

LGTM

@sotojuan
Copy link
Contributor

Looking good here too!

sindresorhus added a commit that referenced this pull request Mar 18, 2016
…not-returning

Ensure t.throws() returns the error
@sindresorhus sindresorhus merged commit 8d47119 into master Mar 18, 2016
@sindresorhus sindresorhus deleted the fix-enhanced-assert-throws-not-returning branch March 18, 2016 03:10
@sindresorhus
Copy link
Member

👌😎🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants