Closed
Bug 1331006
Opened 8 years ago
Closed 8 years ago
Create a rule to import test globals for mochitest/chrome/browser tests from SimpleTest/EventUtils
Categories
(Developer Infrastructure :: Lint and Formatting, defect)
Tracking
(firefox53 fixed)
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
Details
Attachments
(1 file)
SimpleTest & EventUtils get used quite a bit in tests. Rather than trying to list all their global values in the *.eslintrc.js files, I've created a rule to import the globals automatically.
This knocks off another 300 no-undef errors off the list.
Assignee | ||
Comment 1•8 years ago
|
||
Also included are some other globals, and missing .eslintrc.js files for new test directories.
Comment hidden (mozreview-request) |
Comment 3•8 years ago
|
||
mozreview-review |
Comment on attachment 8826659 [details]
Bug 1331006 - [eslint] Define more globals, and add a rule to import test globals from SimpleTest/EventUtils.
https://reviewboard.mozilla.org/r/104562/#review105718
::: toolkit/components/windowcreator/test/test_nsFind.html:159
(Diff revision 1)
> - function assertFound(node, searchValue) {
> - ok(find(node, searchValue), "\"" + searchValue + "\" not found");
> + function assertFound(node, value) {
> + ok(find(node, value), "\"" + value + "\" not found");
> }
>
> - function assertNotFound(node, searchValue) {
> - ok(!find(node, searchValue), "\"" + searchValue + "\" found");
> + function assertNotFound(node, value) {
> + ok(!find(node, value), "\"" + value + "\" found");
Why were all these changes necessary?
::: tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-test-globals.js:34
(Diff revision 1)
> + // Public
> + // ---------------------------------------------------------------------------
> +
> + return {
> + Program: function(node) {
> + //
Unnecessary comment?
Attachment #8826659 -
Flags: review?(dtownsend) → review+
Assignee | ||
Comment 4•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8826659 [details]
Bug 1331006 - [eslint] Define more globals, and add a rule to import test globals from SimpleTest/EventUtils.
https://reviewboard.mozilla.org/r/104562/#review105718
> Why were all these changes necessary?
Mochitests have the "no-shadow" rule enabled. Adding the .eslintrc.js file to the directory triggered the failures.
> Unnecessary comment?
Yep, fixed. I also updated the documentation at the top of the file.
Comment hidden (mozreview-request) |
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8d4fe24cd664
[eslint] Define more globals, and add a rule to import test globals from SimpleTest/EventUtils. r=mossop
Comment 7•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Updated•7 years ago
|
Product: Testing → Firefox Build System
Updated•6 years ago
|
Version: Version 3 → 3 Branch
Updated•3 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
•