This is a list app designed to help users organize their gifts and respective recipients. The app was primarily built to improve Test Driven Development and using Jest and Enzyme in a React environment.
Installation | Testing | Challenges and Solutions | Code Snippets | Acknowledgements
OS X & Linux:
npm install
Snapshot testing is done with Jest and assertion testing is done with Enzyme.
npm install --save-dev enzyme react-test-renderer
You will need to install and configure the Enzyme Adapter by running the commonad and creating the following files so it know show to communicate with React.
npm install --save-dev enzyme enzyme-adapter-react-15
// src/tempPolyfills.js
const requestAnimationFrame = global.requestAnimationFrame = callback => {
setTimeout(callback, 0);
}
export default requestAnimationFrame;
// src/setupTests.js
import requestAnimationFrame from './tempPolyfills';
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter(), disableLifecycleMethods: true });
Here are some of challenges I encountered along the way and how I went about solving them.
David Katz, thank you for your course. It was a great way to take my React and Jest knowledge to the next level.