-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[expect-expect]: Unable to allow methods in assertFunctionNames
#175
Labels
Comments
Thanks for reporting this issue with clear steps and a use case. It'd be good to consider a call expression with an object and property (like |
randycoulman
added a commit
to CodingZeal/eslint-config-zeal
that referenced
this issue
Oct 12, 2018
- New rule: `jest/expect-expect` defaults to `off` for now, as we are unable to configure it to recognize `td.verify` as an assertion method. See jest-community/eslint-plugin-jest#175. - New rule: `jest/no-alias-methods` defaults to `off` because we prefer `toThrowError` over `toThrow` and there's no way to configure the rule to allow some aliases but not all. - New rule: `jest/no-test-return-statement` defaults to `warn` - New rule: `jest/prefer-inline-snapshots` defaults to `off` - New rule: `jest/prefer-strict-equal` defaults to `warn` - New rule: `jest/require-tothrow-message` defaults to `warn`
I can push up a PR for this shortly. |
macklinu
added a commit
that referenced
this issue
Oct 13, 2018
macklinu
added a commit
that referenced
this issue
Oct 13, 2018
macklinu
added a commit
that referenced
this issue
Oct 13, 2018
SimenB
pushed a commit
that referenced
this issue
Oct 14, 2018
🎉 This issue has been resolved in version 21.24.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
In testing the
expect-expect
rule on one of my projects, I found that it was reporting a number of tests that didn't have expect calls. In these tests, I was usingtd.verify
from testdouble.js which verifies that a particular test double was called.I attempted to use the
assertFunctionNames
option to configuretd.verify
as a known expect function, but was unable to get it to work. The tests in questions were still reported as violating this rule.I tried both
assertFunctionNames: ["expect", "td.verify"]
andassertFunctionNames: ["expect", "verify"]
and neither approach worked.I was able to work around the issue by doing the following, but this is not the normal way to use testdouble.js and I'd prefer not to have to do it everywhere I use
td.verify
.I think the more general problem here is that the rule is not able to match anything but bare functions; it can't handle methods on an object.
I don't know the AST syntax well enough to know how to fix this, but I thought I'd at least report it here in the hope that someone more familiar can take care of it.
The text was updated successfully, but these errors were encountered: