You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to propose a rule that verifies the name of a top-level describe block match the name of an export in the module with the same name, minus the .test / .spec postfix.
The text was updated successfully, but these errors were encountered:
I like it! but unfortunately I don't know if it's possible, since we can't parse other files with eslint - additionally we recommend using overrides to apply our rules to only test files which might affect things.
In saying that, iirc eslint-plugin-node might do something like this so maybe it is possible? 🤔
When I have a chance I'll play around with some things, see if there's maybe some eslint utils that could be used.
I believe their logic to process the referenced module is in eslint-module-utils.
G-Rath
changed the title
Rule proposal: enforce describe blocks match module exports
[new-rule] enforce describe blocks match module exports
Aug 27, 2022
I like to write my tests, so each
describe
block matches an export of the similar named module.For example, given the following module:
I would like to enforce the following layout for a test file:
I would like to propose a rule that verifies the name of a top-level describe block match the name of an export in the module with the same name, minus the
.test
/.spec
postfix.The text was updated successfully, but these errors were encountered: