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

No error on invalid expect? #531

Closed
mikkotikkanen opened this issue Oct 8, 2015 · 2 comments
Closed

No error on invalid expect? #531

mikkotikkanen opened this issue Oct 8, 2015 · 2 comments

Comments

@mikkotikkanen
Copy link

I just found out that, the current project that I'm working on, has some test cases which have typoed expects and to my dismay, these tests still pass.

fe. expect(true).be.fasle; passes with flying colors, even though it is expecting it to be something that doesn't even exist.

Isn't this something that should be fixed?

@keithamus
Copy link
Member

Hey @mikkotikkanen thanks for the issue.

We're aware of the problem, and we're working on some solutions. Have a look at #407 which will try to throw errors if you access non-existent properties like fasle (it will use Proxies, so will be somewhat experimental). Also see #457 which is our general roadmap ticket, where I've glossed over the idea of having a legacy style interface which would ensure all methods have parens, so expect(true).to.be.true becomes expect(true).to.be.true().

I'll close this now, because of the above mentioned issues. Feel free to continue the discussion in those other issues. #407 is ready for an initial PR, so if you're comfortable with Proxies, feel free to give it a try!

@mikkotikkanen
Copy link
Author

Kk. It would be nice if there fe. would be a switch that would force the parens to be there, so that you could opt-in to the more secure implementation of the API.

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

No branches or pull requests

2 participants