You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... which is ugly and depends on all the methods called, so there's not really any point to using allowedFunctionCalls for this (instead of disable comments or disabling the rule altogether)
Could we add something like allowedClasses?
The text was updated successfully, but these errors were encountered:
Is there a reason why you're running this rule against your file if you have this custom extension? I'm not against adjusting the options to make the rule more flexible, but would like to understand more of your use-case first since I'm not sure why (or how) you'd want mix test cases with this (which is really when the result is needed - even if you're using things like jest.mock next to this, you can probably still safely disable require-hook)
Yeah, I could disable this per-file in the config, that's true... I could also use disable comments. However, I expect to have more tests in more files that do not all use the class, so specifying which files to apply the rule to and which not would be a kind of pain...
Also you may want to use such a tester and then add some more tests manually in the same file, in which case you really have to use disable comments - I am not sure I'll be in such a scenario, but it's another option that comes to mind...
Hi,
I have a lot of tests that are really similar, so I built a class that scaffolds all the tests and invoke it in my test file like so:
However, this triggers
jest/require-hook
. In that rule, there is theallowedFunctionCalls
option. However, when I printedgetNodeName(node)
here, I gotNodeExtensionTester.shouldMatchUnistNode.shouldNotMatchUnistNode.shouldNotMatchUnistNode.runTests
... which is ugly and depends on all the methods called, so there's not really any point to using
allowedFunctionCalls
for this (instead of disable comments or disabling the rule altogether)Could we add something like
allowedClasses
?The text was updated successfully, but these errors were encountered: