Assertions são instruções em um teste que verificam se uma condição é verdadeira — confirmando que o resultado real corresponde ao resultado esperado. Elas são o núcleo de como os testes determinam se passam ou falham: se uma assertion falha, o teste falha.
O que as assertions fazem
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).
Tipos comuns de assertion
(result).();
(obj).({ : });
(value).();
(value).();
(value).();
(count).();
(price).();
(array).();
(array).();
(text).();
( ()).();
(value)..();
