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

Allow function calls at end of side-effect-getter chains #997

Closed
shicks opened this issue Jun 23, 2017 · 2 comments
Closed

Allow function calls at end of side-effect-getter chains #997

shicks opened this issue Jun 23, 2017 · 2 comments

Comments

@shicks
Copy link

shicks commented Jun 23, 2017

Google's JS style guide prohibits getters with side effects, which causes difficulty when using the "expect" style of assertions. Allowing a () at the end of such chains would mitigate this issue and allow people writing in Google style to use the nicer "expect" style, rather than only being able to use the old-fashioned "assert" style.

@meeber
Copy link
Contributor

meeber commented Jun 24, 2017

@shicks There has been a lot of discussion on this issue, and one attempt to support using the getters as methods, which had to be reverted due to unexpected incompatibilities and breaking changes. Here are some of the relevant threads: #302, #371, #726 (comment).

The last time we discussed this issue, the opinion was that the dirty-chai plugin is an acceptable solution for this problem.

@shicks
Copy link
Author

shicks commented Jun 24, 2017

Sounds good, we'll look into recommending that plugin, and hopefully someday chai core will finally move off of property assertions. Thanks for all the background!

@shicks shicks closed this as completed Jun 24, 2017
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