Skip to content

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

@G-Rath G-Rath requested a review from SimenB July 15, 2022 04:54
@G-Rath G-Rath force-pushed the create-prefer-mock-promise-shorthand branch from 2c0a4c2 to 087b1c2 Compare July 15, 2022 04:56
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

3 participants