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

fix(prefer-expect-assertions): support .each #798

Merged
merged 1 commit into from Apr 2, 2021

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Mar 21, 2021

Fixes #676

Issue was that we were using a specific selector, which couldn't account for .each - have refactored the rule to match using conditions instead like the rest of our rules.

Had to modify isEachCall in the process - technically it's got a slightly different behaviour as it's stricter, but this is actually what's being checked for in the refactored utils so when #792 is landed this method will be doing the right thing anyway. Plus this hasn't broken any tests so its fine

(it did break TypeScript, which is why I had to make a change to lowercase-name - I'm pretty sure this is another instance of microsoft/TypeScript#35953 but tbh I'm going to look to do a major refactor of our types once I've straighted out the .each-based stuff anyway, which'll include dropping some of the generics that we don't really need).

@G-Rath G-Rath merged commit f758243 into main Apr 2, 2021
@G-Rath G-Rath deleted the support-each-in-prefer-expect-assertions branch April 2, 2021 20:05
github-actions bot pushed a commit that referenced this pull request Apr 2, 2021
## [24.3.3](v24.3.2...v24.3.3) (2021-04-02)

### Bug Fixes

* **no-duplicate-hooks:** support `describe.each` ([#797](#797)) ([243cb4f](243cb4f)), closes [#642](#642)
* **prefer-expect-assertions:** support `.each` ([#798](#798)) ([f758243](f758243)), closes [#676](#676)
@github-actions
Copy link

github-actions bot commented Apr 2, 2021

🎉 This PR is included in version 24.3.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[prefer-expect-assertions] Doesn't work within .each blocks
2 participants