1 | import React from 'react';
|
2 | import chai from 'chai';
|
3 | import sinonChai from 'sinon-chai';
|
4 | import sinon from 'sinon-sandbox';
|
5 | import chaiEnzyme from 'chai-enzyme';
|
6 | import Enzyme from 'enzyme';
|
7 |
|
8 | let Adapter;
|
9 |
|
10 | try {
|
11 | Adapter = require('enzyme-adapter-react-16');
|
12 | } catch (e) {
|
13 | try {
|
14 | Adapter = require('enzyme-adapter-react-15');
|
15 | } catch (e) {
|
16 | try {
|
17 | Adapter = require('enzyme-adapter-react-15.4');
|
18 | } catch (e) {
|
19 | Adapter = require('enzyme-adapter-react-14');
|
20 | }
|
21 | }
|
22 | }
|
23 |
|
24 | Enzyme.configure({ adapter: new Adapter(), disableLifecycleMethods: true });
|
25 |
|
26 | chai.use(sinonChai);
|
27 | chai.use(chaiEnzyme());
|
28 |
|
29 | afterEach(() => {
|
30 | sinon.restore();
|
31 | });
|