Skip to content

chicrock/jest-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jest-example

  • Jest Example with react via typescript

Install

Install React

yarn add react react-dom
yarn add -D @types/react @types/react-dom babel-preset-env babel-preset-react babel-preset-typescript parcel-bundler ts-node typescript

Install ts-jest

yarn add -D ts-jest react-test-renderer @types/jest @types/react-test-renderer

Install enzyme

  • A library that's useful for testing the react components
  • Enzyme github
yarn add -D enzyme enzyme-adapter-react-16 @types/enzyme @types/enzyme-adapter-react-16

Jest Snapshot Concept

  • Jest create the sanpshot automatically.
  • After when the test fail, check the source code was updated or not.
  • If the source code was updated, update shanpshot.
  • If the source code isn't updated, there is a bug

About

Jest Example with react(+parcel)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published