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/frontend/utils/setupJest.js

14 lines
346 B
JavaScript
Raw Normal View History

2017-05-23 06:51:16 +00:00
/* eslint-disable */
import React from 'react';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
2017-06-28 03:59:53 +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;