JS Guide
Home
Questions
Topics
Companies
Resources
Bookmarks
Search
Toggle theme
Open menu
Home
Questions
Search
Progress
Home
Topics
testing
testing
Unit testing, integration testing, and E2E testing strategies
15
All
5
beginner
5
intermediate
5
advanced
0 of 15 topics read
0%
5 Topics
intermediate
Code Coverage Metrics
intermediate
12 min
Understanding the four types of code coverage (line, branch, statement, function), interpreting coverage reports, setting meaningful targets, and knowing why 100% coverage does not guarantee bug-free code.
Testing Custom React Hooks
intermediate
12 min
How to test custom React hooks using renderHook, handling state updates with act(), testing hook return values, and avoiding common pitfalls when hooks depend on context or async operations.
Integration Tests vs Unit Tests
intermediate
12 min
The difference between unit tests and integration tests, when to use each, the testing pyramid versus testing trophy, and how integration tests provide the best return on investment for most applications.
Mocking Functions, Modules, and APIs
intermediate
15 min
How to use jest.fn(), jest.mock(), and jest.spyOn() (or their Vitest equivalents) to isolate code under test, plus API mocking with MSW for realistic network request testing.
React Testing Library
intermediate
15 min
Testing React components the way users interact with them using React Testing Library's query priority hierarchy, userEvent for realistic interactions, and the philosophy of testing behavior over implementation details.