-
Notifications
You must be signed in to change notification settings - Fork 144
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: rename await-fire-event
to await-async-event
and support user-event
#652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this! I left some comments.
lib/rules/await-fire-event.ts
Outdated
@@ -10,8 +10,13 @@ import { | |||
} from '../node-utils'; | |||
|
|||
export const RULE_NAME = 'await-fire-event'; | |||
const EVENT_MODULES = ['fireEvent', 'userEvent'] as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have EVENTS_SIMULATORS
exported in utils
. Any problem with reusing that one?
lib/rules/await-fire-event.ts
Outdated
additionalProperties: false, | ||
properties: { | ||
eventModule: { | ||
type: 'string', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I think I didn't specify this really well in the original ticket. The idea is that this is a list accepting either "fire-event", "user-event", or both!
Frameworks like Vue Testing Library will need to report both, so they'll need to set this option to ["fire-event", "user-event"]
.
By default, it should be just ["user-event"]
It should be fairly easy to adapt your current code tho.
Thanks for the feedback, I'll take a look at those comments! Forgot about draft PRs, thanks for updating that too 🤦♂️ |
await-fire-event
to await-async-event
and support user-event
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @skovy! I added a few comments, but should be easy to fix. I think after that it should be ready to go 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last request! Can you add some tests without setting the option so it takes the default value? This way we explicitly test the default options. Duplicating existing tests just without the option property is fine.
BREAKING CHANGE: rename await-fire-event to await-async-event and add support for user-event
🎉 This PR is included in version 6.0.0-alpha.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…or `user-event` (#652) BREAKING CHANGE: `await-fire-event` is now called `await-async-event`
BREAKING CHANGE: rename
await-fire-event
toawait-async-event
and supportuser-event
Checks
npm run generate:rules-list
)npm run generate:configs
)Changes
await-fire-event
rule to become theawait-async-event
ruleuserEvent
for most, butfireEvent
for those that have async fire event methodsContext
Resolves #626