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(prefer-expect-assertions): support onlyFunctionsWithAsyncKeyword option #677

Merged

Conversation

mcampa
Copy link
Contributor

@mcampa mcampa commented Sep 25, 2020

We would like to add this new option on the prefer-expect-assertions rule, so the rule only applies to async tests.
I hope this you like this idea. I'm open for suggestions.

@mcampa mcampa force-pushed the prefer-expect-assertions-asyncOnly branch 2 times, most recently from 5f9ef48 to 18fa140 Compare September 25, 2020 21:03
Copy link
Collaborator

@G-Rath G-Rath left a comment

Choose a reason for hiding this comment

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

This seems like a reasonable option to have - aside from the code change I'd requested, all that's missing is updating the rules documentation :)

It would be good if you could reword your commit to be feat(prefer-expect-assertions) instead of feat(async-only), but that's not a blocker.

src/rules/__tests__/prefer-expect-assertions.test.ts Outdated Show resolved Hide resolved
@G-Rath G-Rath changed the title Add asyncOnly option to prefer-expect-assertions rule feat(prefer-expect-assertions): support asyncOnly option Sep 25, 2020
@mcampa mcampa force-pushed the prefer-expect-assertions-asyncOnly branch 2 times, most recently from 1cd06ab to 01e41de Compare September 25, 2020 22:20
@mcampa
Copy link
Contributor Author

mcampa commented Sep 28, 2020

Hi @G-Rath, I think I addressed all your comments.
Let me know if there is anything else needed.

@G-Rath
Copy link
Collaborator

G-Rath commented Sep 29, 2020

@mcampa cheers, it's looking good - I am now wondering if maybe it should be something like onlyFunctionsWithAsyncKeyword, to be really clear that by "async" we're meaning the keyword, not functions that return a promise.

What do you think?

@mcampa mcampa force-pushed the prefer-expect-assertions-asyncOnly branch 2 times, most recently from b7aee62 to 3e94e51 Compare September 29, 2020 20:29
@mcampa mcampa requested a review from G-Rath September 29, 2020 20:32
@mcampa
Copy link
Contributor Author

mcampa commented Sep 29, 2020

What do you think?

makes perfect sense, I'll make the change.

@mcampa mcampa force-pushed the prefer-expect-assertions-asyncOnly branch from 3e94e51 to 580fc57 Compare September 29, 2020 21:16
@mcampa mcampa changed the title feat(prefer-expect-assertions): support asyncOnly option feat(prefer-expect-assertions): support onlyFunctionsWithAsyncKeyword option Sep 29, 2020
@mcampa mcampa force-pushed the prefer-expect-assertions-asyncOnly branch from 580fc57 to 9bc6d55 Compare September 29, 2020 21:19
@mcampa
Copy link
Contributor Author

mcampa commented Oct 5, 2020

I believe all comments were addresses. Back to you @G-Rath 🤞

Copy link
Collaborator

@G-Rath G-Rath left a comment

Choose a reason for hiding this comment

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

Awesome, let's ship it!

@G-Rath G-Rath merged commit d0cea37 into jest-community:master Oct 5, 2020
github-actions bot pushed a commit that referenced this pull request Oct 5, 2020
# [24.1.0](v24.0.2...v24.1.0) (2020-10-05)

### Features

* **prefer-expect-assertions:** add `onlyFunctionsWithAsyncKeyword` option ([#677](#677)) ([d0cea37](d0cea37))
@github-actions
Copy link

github-actions bot commented Oct 5, 2020

🎉 This PR is included in version 24.1.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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants