UNPKG

609 BJavaScriptView Raw
1/* global jest */
2import Enzyme from 'enzyme';
3import Adapter from 'enzyme-adapter-react-16';
4Enzyme.configure({
5 adapter: new Adapter()
6});
7
8global.requestAnimationFrame = function (cb) {
9 cb(0);
10};
11
12global.window.cancelAnimationFrame = function () {};
13
14global.createSpyObj = function (baseName, methodNames) {
15 var obj = {};
16
17 for (var i = 0; i < methodNames.length; i += 1) {
18 obj[methodNames[i]] = jest.fn();
19 }
20
21 return obj;
22};
23
24global.document.createRange = function () {
25 return {
26 setStart: function setStart() {},
27 setEnd: function setEnd() {},
28 commonAncestorContainer: {}
29 };
30};
\No newline at end of file