This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/setupJest.js

13 lines
321 B
JavaScript
Raw Normal View History

2017-05-23 06:51:16 +00:00
import React from 'react';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
2017-07-15 23:08:12 +00:00
import localStorage from './__mocks__/localStorage';
2017-05-23 06:51:16 +00:00
const snap = children => {
const wrapper = shallow(children);
expect(toJson(wrapper)).toMatchSnapshot();
};
2017-06-28 03:59:53 +00:00
global.localStorage = localStorage;
2017-05-23 06:51:16 +00:00
global.snap = snap;