Assertions är påståenden i ett test som kontrollerar om ett villkor är sant — verifierar att det faktiska resultatet matchar det förväntade resultatet. De är kärnan i hur test avgör pass eller misslyckande: om en assertion misslyckas, misslyckas testet.
Vad assertions gör
An ASSERTION checks that something is as expected:
→ "assert that the actual value EQUALS the expected value"
→ if TRUE → the assertion passes; if FALSE → the assertion FAILS → the TEST FAILS
→ Assertions are how a test VERIFIES behavior (the "check" part of a test).
Vanliga assertion-typer
(result).();
(obj).({ : });
(value).();
(value).();
(value).();
(count).();
(price).();
(array).();
(array).();
(text).();
( ()).();
(value)..();
