React Native stöder testning på flera nivåer — unit tests (logik), komponenttester (med React Native Testing Library), och end-to-end-tester (med Detox). En bra teststrategi förbättrar tillförlitligheten och förtroendet.
Unit- och komponenttestning (Jest + Testing Library)
JEST → the standard JS test runner (unit tests for logic, functions, hooks)
REACT NATIVE TESTING LIBRARY → test components by rendering and interacting with them
(the way a user would) — query elements, fire events, assert on output
{ render, fireEvent, screen } ;
(, {
();
fireEvent.(screen.());
(screen.()).();
});
