-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Pre-bind assertion methods #1592
Comments
Yea we can give it a shot. It's a bunch more function allocations so it'd be interesting to see what happens when there's loads of tests in a single file, but on the other hand I doubt it'll really have an impact, especially in the most recent Node.js. |
Can I work on this? |
@reddysridhar53 it's all yours! |
How to do the work on this project? |
@irahulcse You mean how to contribute? See our comprehensive contribution guide: https://github.com/avajs/ava/blob/master/contributing.md |
Assertions are now bound. Fixes #1592. Assertions are now skipped by calling `.skip()` at the end, e.g. `t.fail.skip()`. This is consistent with the test interface, where `skip()` can only be used at the end of the chain. The private `t._test` value has been removed. Instead a WeakMap is used internally to look up the corresponding Test instance given an ExecutionContext.
Assertions are now bound. Fixes #1592. Assertions are now skipped by calling `.skip()` at the end, e.g. `t.fail.skip()`. This is consistent with the test interface, where `skip()` can only be used at the end of the chain. The private `t._test` value has been removed. Instead a WeakMap is used internally to look up the corresponding Test instance given an ExecutionContext.
Assertions are now bound. Fixes #1592. Assertions are now skipped by calling `.skip()` at the end, e.g. `t.fail.skip()`. This is consistent with the test interface, where `skip()` can only be used at the end of the chain. The private `t._test` value has been removed. Instead a WeakMap is used internally to look up the corresponding Test instance given an ExecutionContext.
Or simply all methods on the test context
t
.I didn't really buy the use-case in #1255, but after that I've encountered some situations where it could have been useful.
Sometimes I need to skip an assert based on some condition:
The above results in an error:
Or use a different assertion. I realize it's not a very good practice, but sometimes it's just the best way to do it.
Right now I have to do:
Which is not very nice.
The text was updated successfully, but these errors were encountered: