QamoosTech
Testing & QualityBeginner

Assertion

Pronunciationuh-SUR-shun

Definition

A statement in a test that checks if a specific condition is true; if the condition is false, the test fails.

Where you hear it

In unit tests, integration tests, and test-driven development conversations.

Examples

  • The test uses an assertion to verify that the function returns the correct calculated total.
  • If the API response status code is not two hundred, the assertion throws an error.

Common mistake

Putting multiple unrelated checks into a single assertion instead of writing clear, separate checks for each expected outcome.