Intro
A quick dive through the project and tests setup for unit testing, integration testing, and e2e testing with "Jest" and "Cypress".
Prelude
In this course we want to focus on important testing techniques and practices. I'll avoid talking about project creation or test configuration. If you don't have project to play with you can use the following repository template where you have:
- Applications to play with
- Good standards and practices
- Testing environment
- Guides
- Community support
- It's constantly improved
- Commits are linear and well organized
I'll use that template in whole course. In addition you can read this article where we explain mentioned repo. If you have your own app and tests configured - it's even better. You can try practices in your project and master them perfectly đ.
Running first time
Go to repository and click use template. After creating repo just clone it. Then type npm install --legacy-peer-deps and use commands which you want. You can find them in README.md file. They're are also explained below.
How to run storybook for UI lib?
Loading
How to run tests?
Loading
How to run apps?
Loading
- 1. Basics
10 minutes
Software testing
2 m
Grouping the tests
1 minute
The usage of describe and it
2 m
The best practices for naming tests
2 m
Navigating the different types of software tests
3 m
- 2. Mastering unit testing
38 minutes
Project and tests setup
3 m
Unit tests review
4 m
React component testing
5 m
Snapshot testing in React
4 m
Understanding stubs in testing
3 m
Understanding mocks in testing
5 m
Creating testing fixtures
4 m
Using spies in React and Typescript
3 m
Mocking environment variables
3 m
Using dependency injection pattern to improve fixtures
4 m
- 3. Mastering integration testing
12 minutes
Understanding the integration tests
4 m
Using MSW library to remove implementation details from tests
4 m
Creating fixture for MSW to reduce boilerplate and setup
4 m
- 4. Mastering e2e tests
8 minutes
Comments
Add your honest opinion about this article and help us improve the content.