Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created September 9, 2018 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/a29ee73240b3d9e6f5a4d0391401abfb to your computer and use it in GitHub Desktop.
Save productioncoder/a29ee73240b3d9e6f5a4d0391401abfb to your computer and use it in GitHub Desktop.
Setup tests in create-react-app using Enzyme
import React from 'react';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import {createSerializer} from 'enzyme-to-json';
expect.addSnapshotSerializer(createSerializer({mode: 'deep'}));
// React 16 Enzyme adapter
Enzyme.configure({adapter: new Adapter()});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment