Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure t.throws() returns the error #651

Merged
merged 1 commit into from
Mar 18, 2016

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.

4 participants