montacerdk / tdd-react-jest-enzyme

A demo React TypeScript project using TDD method.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TDD in React TypeScript using Jest and Enzyme

This project was bootstrapped with Create React App. In this project, I am using the Test Driven Development with Jest and Enzyme.

Prerequisites

Jest is already configured and installed with Create React App. We just need to install enzyme and enzyme-adapter-react.

  • PS: Currently, there is no official enzyme-adapter-react-17 for the React 17 version. So, I am using a version from the community. Issue.
npm install -D enzyme @wojtekmaj/enzyme-adapter-react-17

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

About

A demo React TypeScript project using TDD method.


Languages

Language:TypeScript 53.8%Language:HTML 36.9%Language:CSS 9.3%