1 |
|
2 | import Enzyme from 'enzyme';
|
3 | import Adapter from 'enzyme-adapter-react-16';
|
4 | Enzyme.configure({
|
5 | adapter: new Adapter()
|
6 | });
|
7 |
|
8 | global.requestAnimationFrame = function (cb) {
|
9 | cb(0);
|
10 | };
|
11 |
|
12 | global.window.cancelAnimationFrame = function () {};
|
13 |
|
14 | global.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 |
|
24 | global.document.createRange = function () {
|
25 | return {
|
26 | setStart: function setStart() {},
|
27 | setEnd: function setEnd() {},
|
28 | commonAncestorContainer: {}
|
29 | };
|
30 | }; |
\ | No newline at end of file |