react-testing-library workshop, by Kent C. Dodds
Course material for testing React components using react-testing-library, by Kent C. Dodds
react-testing
└───src
└─── __tests__
│ │ │
│ │ │ (test files)
│ │
│ │ (component files)
react-dom.js
- Render a React component for testingjest-dom.js
- Use jest-dom for improved assertionsdom-testing-library.js
- Use dom-testing-library to write more maintainablereact-testing-library.js
- Use react-testing-library to render and testlocalized.js
- Testing localized content with react-testing-librarystate.js
- Test React Component state changes with react-testing-libraryprop-updates.js
- Test prop updates with react-testing-librarya11y.js
- Test accessibility of rendered React Components with jest-axedependency-injection.js
- Mock HTTP Requests with Dependency Injection inhttp-jest-mock.js
- Mock HTTP Requests with jest.mock in React Componentmock-component.js
- Mock react-transition-group in React Component Testserror-boundaries.js
- Test componentDidCatch handler error boundaries withtdd-markup.js
- Test drive the development of a React Form withtdd-functionality.js
- TDD the functionality of a React Form withreact-router.js
- Test react-router Provider history object in Reactredux.js
- Test a redux connected React Componentcustom-hook.js
- Test a custom hookportals.js
- Test React portalsunmounting.js
- Test Unmounting a React Component with react-testing-libraryapp.js
- Testing the full application.Clone the forked repository
git clone https://github.com/user/react-testing
(if you use git
)
or
gh repo clone https://github.com/user/react-testing
(if you use gh
cli)
Install the dependencies
npm install
(if you use npm
)
or
yarn
(if you use yarn
)
Start the project
npm start
(if you npm
)
or
yarn start
(if you use yarn
)
See the CONTRIBUTING.md file to see the step about how to contribute.
Credits: Kent C. Dodds