React Testing Library
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
React Testing Library teston komponentët ashtu siç i përdor një njeri: gjen butona sipas tekstit, klikon dhe kontrollon çfarë shfaqet — jo detajet e brendshme. Përdoret bashkë me Vitest ose Jest.
EnglishEN
React Testing Library tests components the way a person uses them: it finds buttons by their text, clicks and checks what appears — not internal details. It's used with Vitest or Jest.
Si ta mendosh
Si një testues që e provon aplikacionin si klient i zakonshëm.
Lexoje në anglisht
Like a tester who tries the app as an ordinary customer.
Shembull kodijavascript
render(<Numeruesi />);
await userEvent.click(screen.getByRole("button", { name: /gol/i }));
expect(screen.getByText("Gola: 1")).toBeInTheDocument();