2017-09-28 14:25:49 +02:00
|
|
|
import 'jest-enzyme/lib/index';
|
|
|
|
|
|
|
|
// setup file
|
|
|
|
import { configure } from 'enzyme';
|
|
|
|
import Adapter from 'enzyme-adapter-react-16';
|
|
|
|
|
2018-06-12 21:50:13 +03:00
|
|
|
import registerRequireContextHook from 'babel-plugin-require-context-hook/register';
|
|
|
|
|
|
|
|
registerRequireContextHook();
|
|
|
|
|
2017-11-19 18:22:46 -05:00
|
|
|
// mock console.info calls for cleaner test execution
|
2017-11-21 04:18:36 +03:00
|
|
|
global.console.info = jest.fn().mockImplementation(() => {});
|
2017-11-19 18:22:46 -05:00
|
|
|
|
2017-09-28 14:25:49 +02:00
|
|
|
configure({ adapter: new Adapter() });
|
2017-11-12 13:40:07 -05:00
|
|
|
|
|
|
|
/* Fail tests on PropType warnings
|
|
|
|
This allows us to throw an error in tests environments when there are prop-type warnings. This should keep the tests
|
|
|
|
free of warnings going forward.
|
|
|
|
*/
|
|
|
|
|
|
|
|
const throwError = message => {
|
|
|
|
throw new Error(message);
|
|
|
|
};
|
|
|
|
|
|
|
|
global.console.error = throwError;
|
|
|
|
global.console.warn = throwError;
|