/react-testing-strategy

This is the complete implementation of this blog about react (component/unit) testing strategy: https://ethan.thoughtworkers.me/#/post/2023-12-10-react-unit-testing-best-practices-v2

Primary LanguageTypeScriptMIT LicenseMIT

README

This is a skeleton project for using React stack to deliver modern web applications. I am planning to merge this with my own initializer project.

Tech stack

  • pnpm @7
  • React @18.2
  • React Router DOM @6
  • Redux @4 & Redux Toolkit @1.8
  • TypeScript @4.8
  • Webpack @5
  • Emotion @11
  • Material UI @5
  • axios @1.4
  • Jest @29
  • ESLint @8
  • Prettier @2.7
  • Husky @8
  • React testing library @13
  • WIP - React Query (api)
  • WIP - msw (mock server)

Getting started

npm i -g pnpm@7
pnpm i

Start local server

pnpm start

Lint & Test

pnpm lint
pnpm test

Build

pnpm build

Testing Strategy

Please check out my post React 系列(二):单元测试最佳实践 for a recommended best practices of how to deploy the testing strategy for this architecture.