Concept: Test Independence
Question
Why should tests be independent of each other?
Hint
If test B depends on test A, what happens if A fails?
Explanation
Tests should be independent so they can run in any order and in parallel. If tests depend on each other, a failure in one causes cascading failures in others, making it hard to identify the root cause. Independent tests also enable parallel execution for faster test runs and make it easier to run individual tests in isolation during development.
Related Resources
Related Lessons
- Test Best Practices
Writing maintainable tests.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.