Coder Social home page Coder Social logo

react-testing's Introduction

React Testing

This module builds upon the topic of client-side testing by extending it into the realm of React.

Project Description

The objectives of this module are the following:

  • To write tests for a React application using Jest and Enzyme. These two libraries are commonly used in production for testing React components and applications.
  • To practice reading over and understanding code which you did not write, but that you do need to test.

For this exercise, you're given a complete React application. Your job is to:

  1. Go through and inspect all of the different pieces of the code.
  2. Write tests for all of the components in the ./src/components directory.
  3. Write these tests in the correspondingly-named files in the ./src/tests directory.

You'll be using Jest and Enzyme in order to test React components.

Initialization and Setup

You can run the complete application by installing Node modules with the yarn command, and then running yarn start.

Run yarn test in order to run the test suite. Of course, this isn't going to actually test anything yet, since you haven't written the tests!

Stretch Goals

Add additional test files calculate.test.js and operate.test.js in the tests directory to test the files in the ./src/logic folder. The files in this directory aren't React components, so for testing them you'll actually just be using Jest without Enzyme.

react-testing's People

Contributors

seanchen1991 avatar mixelpixel avatar luishrd avatar

Watchers

James Cloos 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.