diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /devtools/client/shared/test-helpers | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/shared/test-helpers')
3 files changed, 16 insertions, 4 deletions
diff --git a/devtools/client/shared/test-helpers/jest-fixtures/ChromeUtils.js b/devtools/client/shared/test-helpers/jest-fixtures/ChromeUtils.js index 2fee8bc01c..d396777223 100644 --- a/devtools/client/shared/test-helpers/jest-fixtures/ChromeUtils.js +++ b/devtools/client/shared/test-helpers/jest-fixtures/ChromeUtils.js @@ -4,9 +4,21 @@ "use strict"; +const mockedESM = { + BinarySearch: { + insertionIndexOf() { + return 0; + }, + }, +}; + module.exports = { import: () => ({}), addProfilerMarker: () => {}, - defineESModuleGetters: () => {}, + defineESModuleGetters: (lazy, dict) => { + for (const key in dict) { + lazy[key] = mockedESM[key]; + } + }, importESModule: () => ({}), }; diff --git a/devtools/client/shared/test-helpers/jest-fixtures/Services.js b/devtools/client/shared/test-helpers/jest-fixtures/Services.js index 85d0bce5e0..d6198c8d2d 100644 --- a/devtools/client/shared/test-helpers/jest-fixtures/Services.js +++ b/devtools/client/shared/test-helpers/jest-fixtures/Services.js @@ -541,9 +541,9 @@ const Services = { appinfo: "", obs: { addObserver: () => {} }, strings: { - createBundle(bundle) { + createBundle() { return { - GetStringFromName(str) { + GetStringFromName() { return "NodeTest"; }, }; diff --git a/devtools/client/shared/test-helpers/shared-node-helpers.js b/devtools/client/shared/test-helpers/shared-node-helpers.js index ca6a728a8a..e9296d3b86 100644 --- a/devtools/client/shared/test-helpers/shared-node-helpers.js +++ b/devtools/client/shared/test-helpers/shared-node-helpers.js @@ -13,7 +13,7 @@ function setMocksInGlobal() { global.Cc = new Proxy( {}, { - get(target, prop, receiver) { + get(target, prop) { if (prop.startsWith("@mozilla.org")) { return { getService: () => ({}) }; } |