antd-jest-demo

demo to show how to test React components with some extras

Stars
6

About

This is a demo to show how to test React components with some extras.

Involved are React, Ant Design, Babel, Jest, Enzyme, webpack, some custom CSS, cats, and emoji .

Configuration

Here comes the tricky part. These are some things you need to consider when testing with Jest:

Try it out

Installation

Just install the Node modules:

npm i

Linting

ESlint is configured as a lint script in package.json:

npm run lint

Run the tests

The test script in package.json will run Jest using the default path __tests__:

npm test

Preview the components

Components can be previewed via React Storybook. It will be available on (http://localhost:9900) if you run:

npm start

LICENSE

WTFPL WTFPL (http://www.wtfpl.net/)