GithubHelp home page GithubHelp logo

fend16 / jest-react-testing-2 Goto Github PK

View Code? Open in Web Editor NEW
0.0 12.0 0.0 609 KB

Example app to practice testing :zap:

License: MIT License

HTML 12.50% JavaScript 87.50%
react jest enzyme unit-testing integration-testing

jest-react-testing-2's Introduction

jest-react-testing-2

Example app built with create-react-app for 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

Installation

with npm

git clone https://github.com/FEND16/jest-react-testing.git
cd jest-react-testing
npm install

with yarn

git clone https://github.com/FEND16/jest-react-testing.git
cd jest-react-testing
yarn

Running tests

Project has a few test already that are mostly integration tests and snapshot tests. All tests should pass when you run the test command.

yarn test
npm test

With coverage

yarn test --coverage
npm run test -- --coverage

ESLint

Running ESLint

./node_modules/.bin/eslint

Running from global eslint

npm i -g eslint
eslint .eslintrc

ESLint editor integrations

If you want .eslintrc to be detected by your editor you need to install plugin/extensions for your editor.

Exercise

  1. Reach 100% code coverage!
  2. Upload your solution as a branch with your name to this repository. You should have push-rights to it.
  3. 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?

jest-react-testing-2's People

Contributors

martin-alversjo avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.