-
-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Proposal
I'd like to propose a new rule that require's the use of a name
property in test cases that aren't simple strings. I'm thinking the default behavior would be for it to require it, only if the test case object has options
and / or settings
defined. If the object just has 'code`, then don't flag it. And then perhaps there's also an option to require it always?
Motivation
The default Ruletester
output is usually sufficient when the test cases only consist of the code. But if the test case includes options and / or settings, the code for that test case is likely shared with other test cases (that just have different options / settings applied). In such cases, the output is still just the code. So, if you're trying to track down a failure, and you only have the code from the failure to work with, it can be hard to find the culprit test case.
Here's an example of where we adopted this pattern in eslint-plugin-package-json
Before | After |
---|---|
![]() |
![]() |
Thoughts?