Closed
Bug 1219152
Opened 10 years ago
Closed 9 years ago
[meta] Add unit tests for ESLint custom rules
Categories
(Developer Infrastructure :: Lint and Formatting, defect)
Developer Infrastructure
Lint and Formatting
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: pbro, Unassigned)
References
Details
(Keywords: meta)
We've started creating custom ESLint rules for our code base (bug 1218425, bug 1218409, bug 1168338, bug 1218412), so it's time we also add unit tests for those.
Rules should be very easy to test, they're really the sort of things that unit tests are good for: just feed them a series of text inputs, and expect the output to either be valid, or invalid with a list of expected error messages.
It should be possible to write xpcshell tests for them.
For info, default eslint rules are all unit tested, see http://eslint.org/docs/developer-guide/working-with-rules#rule-unit-tests
Comment 1•10 years ago
|
||
Default rules are tested by running them against a string and checking the output. Some of our rules are actually behaviors so there is no output making testing far more difficult.
We should certainly investigate how we can do this though.
Assignee: nobody → mratcliffe
Updated•10 years ago
|
Assignee: mratcliffe → nobody
Updated•9 years ago
|
Component: Developer Tools → Lint
Product: Firefox → Testing
Updated•9 years ago
|
Summary: Add unit tests for ESLint custom rules → [meta] Add unit tests for ESLint custom rules
Comment 2•9 years ago
|
||
We've now got a variety of tests for the custom rules, plus builders running in automation.
Whilst there's a few rules that haven't yet got tests, I think it is good enough to call this bug fixed.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Testing → Firefox Build System
Updated•4 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•