-
Notifications
You must be signed in to change notification settings - Fork 237
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-restricted-matchers] allow restricting matchers without specific modifier #1156
Comments
Yeah, I mentioned this when I implemented the rule:
I was sort of hoping no one would ask so I wouldn't have to decide on an actual solution, but you have so guess it's time to bite the bullet 😅 In hindsight it might have been better to make (that actually does sound like a good idea - @SimenB fyi I might do this in our next major) For now I think it's probably easiest to take an object with a
|
Oh, sorry I didn't read that. 😬 This sounds good. 👌 Btw if this feature is done, I think, the {
"toHaveBeenCalled": {
message: "Use `toHaveBeenCalledTimes` (and `toHaveBeenCalledWith` if it is necessary) instead",
allowedModifiers: ["not"]
},
"toBeCalled": {
message: "Use `toBeCalledTimes` (and `toBeCalledWith` if it is necessary) instead",
allowedModifiers: ["not"]
}
} What do you think about? 👀 |
All good, I wasn't expecting you to go digging around PRs - I mentioned it just as a tie-in and reminder to myself :)
Yeah we probably could - I'm on the fence about actually doing that though because I think that the situation is a good one and by having a specific rule you can more easily enable it in shared configs (the rules I axed with |
🎉 This issue has been resolved in version 27.0.0-next.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 27.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@G-Rath is this totally solved? |
@SimenB yup, not sure why it didn't get closed by GitHub |
Hy guys, I have an issue
If I want to restrict one of matchers except it is negated, I can't tell the config that.
For example:
toHaveBeenCalled
exceptnot.toHaveBeenCalled
Can you add this little feature to
no-restricted-matchers
rule?The text was updated successfully, but these errors were encountered: