-
Notifications
You must be signed in to change notification settings - Fork 148
test: cleanup tests #588
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
test: cleanup tests #588
Conversation
eaae209
to
3042446
Compare
Thinking about all the changes we did to test all rules for the corresponding Testing Library frameworks, I think it makes sense to add some improvements to our In my mind, it could look like this: // rules/foo.js
export default createTestingLibraryRule({
// ...
meta: {
// ...
supportedFrameworks: ['react', 'vue']
// ^ we extend our TestingLibraryRuleMeta so it has this new required property,
// which can be used also to autogenerate a table of compatible frameworks for each rule doc
}
})
// test/lib/rules/foo.js
ruleTester.run(RULE_NAME, rule, {
valid: [
{
code: `
import { fireEvent } from '{TESTING_LIBRARY_FRAMEWORK}'
// ^ this placeholder gets replaced automatically,
// iterating over each value from supportedFrameworks
await fireEvent.click(element)
`
}
]
}) I don't want to hijack the PR, so if you think this could be useful to avoid repetition, improve test maintenance, and make it easier to contribute in the future, I'll move the discussion to a new issue. |
@Belco90 We could even derive We should even be able to run all rules on all testing frameworks though. |
3042446
to
8dba935
Compare
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.
LGTM!
🎉 This PR is included in version 5.5.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Follow-up of #582, #583, #584, #585 & #587