Skip to content
Latchkey

Assertion - CI/CD Glossary Definition

An assertion verifies that the code under test produced the expected result; a failed assertion fails the test.

An assertion is a statement in a test that checks whether a value or condition matches what is expected. If it fails, the test fails.

Assertions are the part of a test that actually verifies behavior. A test with no meaningful assertion runs code but proves nothing, which is why mutation testing targets weak assertions.

Examples

Common forms include assertEqual(a, b), expect(x).toBe(y), and assert result == 42. Prefer specific assertions over broad truthiness checks.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →