forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1860427 - Add a new environment to ESLint for testharness.js and …
…automatically use it for html files including the harness. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D191581
- Loading branch information
Showing
4 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
tools/lint/eslint/eslint-plugin-mozilla/lib/environments/testharness.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* @fileoverview Defines the environment for testharness.js files. This | ||
* is automatically included in (x)html files including | ||
* /resources/testharness.js. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
// These globals are taken from dom/imptests/testharness.js, via the expose | ||
// function. | ||
|
||
module.exports = { | ||
globals: { | ||
EventWatcher: false, | ||
test: false, | ||
async_test: false, | ||
promise_test: false, | ||
promise_rejects: false, | ||
generate_tests: false, | ||
setup: false, | ||
done: false, | ||
on_event: false, | ||
step_timeout: false, | ||
format_value: false, | ||
assert_true: false, | ||
assert_false: false, | ||
assert_equals: false, | ||
assert_not_equals: false, | ||
assert_in_array: false, | ||
assert_object_equals: false, | ||
assert_array_equals: false, | ||
assert_approx_equals: false, | ||
assert_less_than: false, | ||
assert_greater_than: false, | ||
assert_between_exclusive: false, | ||
assert_less_than_equal: false, | ||
assert_greater_than_equal: false, | ||
assert_between_inclusive: false, | ||
assert_regexp_match: false, | ||
assert_class_string: false, | ||
assert_exists: false, | ||
assert_own_property: false, | ||
assert_not_exists: false, | ||
assert_inherits: false, | ||
assert_idl_attribute: false, | ||
assert_readonly: false, | ||
assert_throws: false, | ||
assert_unreaded: false, | ||
assert_any: false, | ||
fetch_tests_from_worker: false, | ||
timeout: false, | ||
add_start_callback: false, | ||
add_test_state_callback: false, | ||
add_result_callback: false, | ||
add_completion_callback: false, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters