Example app built with
create-react-appfor integration and snapshot testing.
The project is already set up with all packages to test react components: enzyme, enzyme-adapter-react-16, react-test-renderer and enzyme-to-json for snapshot testing. You can read more about setting it up here: Running test @ create-react-app
with npm
git clone https://github.com/FEND16/jest-react-testing.git
cd jest-react-testing
npm installwith yarn
git clone https://github.com/FEND16/jest-react-testing.git
cd jest-react-testing
yarnProject has a few test already that are mostly integration tests and snapshot tests. All tests should pass when you run the test command.
yarn testnpm testyarn test --coveragenpm run test -- --coverageRunning ESLint
./node_modules/.bin/eslintRunning from global eslint
npm i -g eslinteslint .eslintrcIf you want .eslintrc to be detected by your editor you need to install plugin/extensions for your editor.
- Reach 100% code coverage!
- Upload your solution as a branch with your name to this repository. You should have push-rights to it.
- Compare with a friend how you did to reach full coverage. How many tests where run? Did you test all important functionality? Where you able to reach high coverage without testing certain functions? What parts of the code did you expect to test but didn't have to?