Assertion libraries & matchers
Në shqip: Libraritë e pohimeve
ShpjegimiSQ
Pohimet kontrollojnë rezultatin: expect(x).toBe(5), assert x == 5, assertThat(x).isEqualTo(5). Libraritë si Chai, AssertJ dhe FluentAssertions japin „matchers“ të lexueshëm dhe mesazhe gabimi të qarta.
EnglishEN
Assertions check the result: expect(x).toBe(5), assert x == 5, assertThat(x).isEqualTo(5). Libraries like Chai, AssertJ and FluentAssertions provide readable “matchers” and clear failure messages.
Si ta mendosh
Si pikat e kontrollit në një listë: ✓ ose ✗.
Lexoje në anglisht
Like checkpoints on a list: ✓ or ✗.
Shembull kodijavascript
expect(lista).toHaveLength(3);
expect(perdoruesi).toMatchObject({ emri: "Arta" });
expect(() => ndaj(1, 0)).toThrow();