Assertions ਇੱਕ ਟੈਸਟ ਵਿੱਚ statement ਹਨ ਜੋ ਚੰਗਾ ਕਰਦੀ ਹਨ ਕਿ ਕੀ ਕੋਈ condition true ਹੈ — ਇਹ ਪ੍ਰਮਾਣਿਤ ਕਰਦੀ ਹੈ ਕਿ actual result expected result ਨਾਲ match ਕਰਦਾ ਹੈ। ਇਹ ਟੈਸਟ ਦੇ pass ਜਾਂ fail ਨੂੰ ਨਿਰਧਾਰਿਤ ਕਰਨ ਦਾ core ਹੈ: ਜੇ ਕੋਈ assertion fail ਹੋਵੇ ਤਾਂ ਟੈਸਟ fail ਹੁੰਦਾ ਹੈ।
Assertions ਕੀ ਕਰਦੀ ਹੈ
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).
Common assertion types
(result).();
(obj).({ : });
(value).();
(value).();
(value).();
(count).();
(price).();
(array).();
(array).();
(text).();
( ()).();
(value)..();
