Skip to content

Commit

Permalink
Add enzyme and enzyme-to-json to the it-shallow-renders plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
negativetwelve committed Sep 3, 2017
1 parent dff4f72 commit 325cea6
Show file tree
Hide file tree
Showing 4 changed files with 296 additions and 11 deletions.
3 changes: 2 additions & 1 deletion packages/jest-plugin-it-shallow-renders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"setup.js"
],
"dependencies": {
"react-test-renderer": "^16.0.0-alpha"
"enzyme": "^2.9.1",
"enzyme-to-json": "^1.5.1"
},
"peerDependencies": {
"jest": "*",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Libraries
import Renderer from 'react-test-renderer';
import {shallow} from 'enzyme';
import toJSON from 'enzyme-to-json';


const itShallowRenders = (render) => {
Expand All @@ -9,7 +10,7 @@ const itShallowRenders = (render) => {

it('shallow renders snapshot', () => {
const rendered = render();
const element = Renderer.create(rendered).toJSON();
const element = toJSON(shallow(rendered));

expect(element).toMatchSnapshot();
});
Expand Down

0 comments on commit 325cea6

Please sign in to comment.