Commit 42ad3be6 authored by Nicolas Chevobbe's avatar Nicolas Chevobbe
Browse files

Bug 1672932 - [devtools] Don't use devtool-launchpad l10n fixtures in debugger...

Bug 1672932 - [devtools] Don't use devtool-launchpad l10n fixtures in debugger jest tests. r=ladybenko.

The l10n module works properly in Node environment now, so we can directly use it.

Depends on D94568

Differential Revision: https://phabricator.services.mozilla.com/D94570
parent 8eb8c854
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@ module.exports = {
    "!**/*.mock.js",
    "!**/*.spec.js",
  ],
  transform: {
    "\\.[jt]sx?$": "babel-jest",
  },
  transformIgnorePatterns: ["node_modules/(?!(devtools-|react-aria-))"],
  setupTestFrameworkScriptFile: "<rootDir>/src/test/tests-setup.js",
  setupFiles: ["<rootDir>/src/test/shim.js", "jest-localstorage-mock"],
+5 −14
Original line number Diff line number Diff line
@@ -4,9 +4,6 @@

// @flow

import { readFileSync } from "fs";
import path from "path";

global.requestAnimationFrame = callback => setTimeout(callback, 0);
global.isWorker = false;

@@ -53,19 +50,13 @@ global.loader = {
};

global.DebuggerConfig = {};
const rootPath = path.join(__dirname, "../../");
function getL10nBundle() {
  const read = file => readFileSync(path.join(rootPath, file));

  try {
    return read("./assets/panel/debugger.properties");
  } catch (e) {
    return read("../locales/en-US/debugger.properties");
  }
}
// $FlowIgnore
const { LocalizationHelper } = require("devtools/shared/l10n");
global.L10N = new LocalizationHelper(
  "devtools/client/locales/debugger.properties"
);

global.L10N = require("devtools-launchpad").L10N;
global.L10N.setBundle(getL10nBundle());
global.performance = { now: () => 0 };

const { URL } = require("url");