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

feat: create prefer-mock-promise-shorthand rule #1167

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Jul 15, 2022

I've decided not to do jest.fn(...) because it's sort of an odd duck where I could the case being made that people want to stick with using mockImplementation when they're using the other methods for consistency + that jest.fn(() => Promise.resolve(...)) is not as much improved being written as jest.fn().mockResolvedValue(...) as what this rule currently covers.

Resolves #104

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

@G-Rath G-Rath force-pushed the create-prefer-mock-promise-shorthand branch from 460fa5f to dbd72a2 Compare July 29, 2022 23:32
@G-Rath G-Rath merged commit d965592 into main Jul 29, 2022
@G-Rath G-Rath deleted the create-prefer-mock-promise-shorthand branch July 29, 2022 23:48
github-actions bot pushed a commit that referenced this pull request Jul 29, 2022
# [26.7.0](v26.6.0...v26.7.0) (2022-07-29)

### Features

* create `prefer-mock-promise-shorthand` rule ([#1167](#1167)) ([d965592](d965592))
@github-actions
Copy link

🎉 This PR is included in version 26.7.0 🎉

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.

New Rule: Prefer mock resolved/rejected shorthands
2 participants