/* 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";
// The `*testPaths` defined below for test paths are the main path formats we // prefer to support for tests as they are commonly used across the tree.
// We prefer the tests to be in named directories as this makes it easier // to identify the types of tests developers are working with. Additionally, // it is not possible to scope ESLint rules to individual files based on .ini // files without a build step that would break editors, or an expensive loading // cycle.
// Please do not add more cases of multiple test types in a single // directory. This may cause ESLint rules to be incorrectly applied to the wrong // tests, leading to false negatives. It could cause the wrong sets of globals // to be defined in the scope, causing false positives when checking for no // undefined variables.
const mochitestTestPaths = [ // Note: we do not want to match testing/mochitest as that would apply // too many globals for that directory. "**/test/mochitest*/", "**/tests/mochitest*/", "testing/mochitest/tests/SimpleTest/", "testing/mochitest/tests/Harness_sanity/",
];
// Please DO NOT add more entries to the list below. // Doing so may cause conflicts in ESLint rules and globals, and cause // unexpected issues to be raised or missed.
let expectedDupePaths = new Set([ "caps/tests/mochitest/", "docshell/test/navigation/", "dom/base/test/", "dom/battery/test/", "dom/bindings/test/", "dom/broadcastchannel/tests/", "dom/console/tests/", "dom/encoding/test/", "dom/events/test/", "dom/file/tests/", "dom/file/ipc/tests/", "dom/indexedDB/test/", "dom/ipc/tests/", "dom/localstorage/test/", "dom/html/test/", "dom/html/test/forms/", "dom/manifest/test/", "dom/messagechannel/tests/", "dom/midi/tests/", "dom/network/tests/", "dom/payments/test/", "dom/plugins/test/mochitest/", "dom/promise/tests/", "dom/reporting/tests/", "dom/security/test/cors/", "dom/security/test/csp/", "dom/security/test/general/", "dom/security/test/https-only/", "dom/security/test/mixedcontentblocker/", "dom/security/test/referrer-policy/", "dom/security/test/sec-fetch/", "dom/serviceworkers/test/", "dom/system/tests/", "dom/url/tests/", "dom/websocket/tests/", "dom/workers/test/", "dom/xhr/tests/", "dom/xul/test/", "editor/composer/test/", "editor/libeditor/tests/", "extensions/permissions/test/", "gfx/layers/apz/test/mochitest/", "image/test/mochitest/", "layout/base/tests/", "layout/forms/test/", "layout/generic/test/", "layout/style/test/", "layout/svg/tests/", "layout/xul/test/", "parser/htmlparser/tests/mochitest/", "testing/mochitest/tests/python/files/", "toolkit/components/alerts/test/", "toolkit/components/printing/tests/", "toolkit/components/thumbnails/test/", "toolkit/components/url-classifier/tests/mochitest/", "toolkit/components/windowcreator/test/", "toolkit/components/windowwatcher/test/", "toolkit/content/tests/widgets/", "toolkit/xre/test/", "uriloader/exthandler/tests/mochitest/", "widget/tests/",
]); // Please DO NOT add more paths to the list above.
let paths = new Set(extraXpcshellTestPaths); for (let path of [
...extraBrowserTestPaths,
...extraChromeTestPaths,
...extraMochitestTestPaths,
]) { if (paths.has(path) && !expectedDupePaths.has(path)) { thrownew Error(`
Unexpected directory containing different test types: ${path}
Please do not add new paths containing different test types. Please use
separate directories.
Having different test types in the same directory may cause ESLint rules to be
incorrectly applied.
`);
}
paths.add(path);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.