Assertion Basics
Multiple Choice Beginner
Question
What happens when an assertion fails in a test?
Hint
Assertions are the 'check' part of a test.
Explanation
An assertion is a statement that checks whether a condition is true. If the condition is false, the assertion fails, the test is marked as failed, and an error (often with a descriptive message) is thrown. The test runner catches this error and reports the failure.
Related Resources
Related Lessons
- Assertions
Using assertions to verify behavior.
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.