Dependency constraints for rule tests #16395
Unanswered
bradzacher
asked this question in
Ideas
Replies: 1 comment
-
Sorry for the delay on responding to this. In general, I see That said, it may be useful to share with others. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wanted to float this idea past everyone here. Happy to raise an RFC for this if there's appetite for the change.
Recently I was working on adding regression testing to the @typescript-eslint project. We have a few dependencies for which we support both current and old versions (for us specifically typescript and eslint).
I was working on adding some CI jobs to test against old versions when I realised that many of our rule tests need to be run against specific versions of dependencies.
Namely we have two cases:
In some other repos I've seen them handle this dependency problem by declaring separate test blocks for example:
But I don't really like this style because it means you're splitting tests up across multiple calls.
Instead I built out some infrastructure directly into the rule tester that allows you to constrain specific rule tests to specific versions within the test's declaration:
Do we think this might be more generally useful to the plugin author community?
Is this something that might be worth building directly into ESLint?
As I said - happy to raise an RFC for this if there's appetite for the change.
Beta Was this translation helpful? Give feedback.
All reactions