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
Test Case - CI/CD Glossary DefinitionTest Case: A test case is a single scenario with defined inputs, actions, and expected outcomes that verifies…
Mutation Score - CI/CD Glossary DefinitionMutation Score: Mutation score is the percentage of introduced mutants that the test suite detected (killed)…
Arrange, Act, Assert - CI/CD Glossary DefinitionArrange, Act, Assert: Arrange, Act, Assert (AAA) is a pattern for structuring a test into three clear phases:…