New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test setup #1

merged 8 commits into from Nov 20, 2017


None yet
1 participant

brunolm commented Nov 20, 2017



Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components' output.

RAF requestAnimationFrame polyfill for node and the browser.

npm i -D raf enzyme enzyme-adapter-react-16 @types/enzyme @types/enzyme-adapter-react-16

Test setup file

create-react-app by default loads src/setupTests file with jest.

Enzyme needs to be configured with an adapter and raf polyfills need to be loaded.

import 'raf/polyfill';

import * as Adapter from 'enzyme-adapter-react-16';
import { configure } from 'enzyme';

configure({ adapter: new Adapter() });

brunolm added some commits Nov 20, 2017

Add enzyme
npm i -D enzyme enzyme-adapter-react-16 @types/enzyme @types/enzyme-adapter-react-16
Add test setup file
By default this is the file create-react-app reads to setup tests

@brunolm brunolm merged commit 0b6e526 into master Nov 20, 2017

@brunolm brunolm deleted the test-setup branch Nov 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment