Files
firefox/devtools/client/accessibility/test/node/setup.js
T
Julian Descottes 688411a2f4 Bug 1589597 - Rename accessibility jest test folder to node r=ladybenko
Depends on D49707
Following the naming convention decided in RFC Bug 1564431

Differential Revision: https://phabricator.services.mozilla.com/D49708
2019-10-18 13:56:15 +00:00

30 lines
833 B
JavaScript

/* 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";
/* global global */
// Configure enzyme with React 16 adapter.
const Enzyme = require("enzyme");
const Adapter = require("enzyme-adapter-react-16");
Enzyme.configure({ adapter: new Adapter() });
global.loader = {
lazyGetter: (context, name, fn) => {
const module = fn();
global[name] = module;
},
lazyRequireGetter: (context, name, module, destructure) => {
const value = destructure ? require(module)[name] : require(module || name);
global[name] = value;
},
};
global.define = function(fn) {
fn(null, global, { exports: global });
};
global.requestIdleCallback = function() {};