From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../shared/test-helpers/shared-jest.config.js | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 devtools/client/shared/test-helpers/shared-jest.config.js (limited to 'devtools/client/shared/test-helpers/shared-jest.config.js') diff --git a/devtools/client/shared/test-helpers/shared-jest.config.js b/devtools/client/shared/test-helpers/shared-jest.config.js new file mode 100644 index 0000000000..9f72fbd9fd --- /dev/null +++ b/devtools/client/shared/test-helpers/shared-jest.config.js @@ -0,0 +1,42 @@ +/* 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"; + +const fixturesDir = `${__dirname}/jest-fixtures`; + +module.exports = { + verbose: true, + moduleNameMapper: { + // Custom name mappers for modules that require m-c specific API. + "^devtools/shared/generate-uuid": `${fixturesDir}/generate-uuid`, + "^devtools/shared/DevToolsUtils": `${fixturesDir}/devtools-utils`, + // This is needed for the Debugger, for some reason + "shared/DevToolsUtils": `${fixturesDir}/devtools-utils`, + + // Mocks only used by node tests. + "Services-mock": `${fixturesDir}/Services`, + "ChromeUtils-mock": `${fixturesDir}/ChromeUtils`, + + "^promise": `${fixturesDir}/promise`, + "^resource://devtools/client/shared/fluent-l10n/fluent-l10n.js": `${fixturesDir}/fluent-l10n`, + "^resource://devtools/client/shared/unicode-url.js": `${fixturesDir}/unicode-url`, + // This is needed for the Debugger, for some reason + "shared/unicode-url.js": `${fixturesDir}/unicode-url`, + "shared/telemetry.js": `${fixturesDir}/telemetry`, + "^resource://devtools/client/shared/telemetry.js": `${fixturesDir}/telemetry`, + // This is needed for the Debugger, for some reason + "client/shared/telemetry$": `${fixturesDir}/telemetry`, + "devtools/shared/plural-form$": `${fixturesDir}/plural-form`, + // Sometimes returning an empty object is enough + "^resource://devtools/client/shared/link": `${fixturesDir}/empty-module`, + "^devtools/shared/flags": `${fixturesDir}/empty-module`, + "^resource://devtools/shared/indexed-db.js": `${fixturesDir}/indexed-db`, + "^devtools/shared/layout/utils": `${fixturesDir}/empty-module`, + "^devtools/client/shared/components/tree/TreeView": `${fixturesDir}/empty-module`, + // Map all require("devtools/...") to the real devtools root. + "^devtools/(.*)": `${__dirname}/../../../$1`, + "^resource://devtools/(.*)": `${__dirname}/../../../$1`, + }, +}; -- cgit v1.2.3