API testing
Në shqip: Testimi i API-ve
ShpjegimiSQ
Testimi i API-ve dërgon kërkesa direkt te backend-i (pa ndërfaqe) dhe kontrollon kodin e statusit, JSON-in, kohën e përgjigjes dhe gabimet. Më i shpejtë dhe më i qëndrueshëm se testet e ndërfaqes.
EnglishEN
API testing sends requests straight to the backend (no UI) and checks the status code, JSON, response time and errors. Faster and more stable than UI tests.
Si ta mendosh
Si të provosh kuzhinën direkt, pa kaluar nga kamerieri.
Lexoje në anglisht
Like testing the kitchen directly, without going through the waiter.
Shembull kodijavascript
const r = await fetch("/api/nxenesit/5");
expect(r.status).toBe(200);
expect(await r.json()).toMatchObject({ id: 5 });