-
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
Alias names to ".true" and ".false". #288
Comments
I was playing around and discovered if you reassign the name in the destruction it doesn't fail. For instance: test('test name', ({is, true: isTrue}) => {
// is(), isTrue()
}); This does not throw. So you can choose to merge #290 or not. |
It seems like you have found a good solution to your problem. I don't think it is a good idea for us to start aliasing methods. Eventually we will introduce the ability to fully integrate custom assertions. When that happens, you will be able to modify our default assert plugin with the aliases you desire and apply it once across your entire project. |
I don't see the point of using destructuring when it's more verbose than just doing |
Sounds good 👍 |
These are tokens, so in some usages they fail...
For instance with how I use AVA, I destructure the functions at the top. This way I don't have to prefix every operation with
t.
(which looks ugly in my opinion). So I do this:But, whenever you when using functions with token-like names, it fails. For example, this destructuring fails getting
.true
:Would be nice if there were some alias functions for any token-similar named functions for cases like this...
.true()
and.false()
The text was updated successfully, but these errors were encountered: