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)

defect
Not set
normal

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
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
Assignee: mratcliffe → nobody
Component: Developer Tools → Lint
Product: Firefox → Testing
Depends on: 1330071
Summary: Add unit tests for ESLint custom rules → [meta] Add unit tests for ESLint custom rules
Depends on: 1379119
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
Product: Testing → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.