eigen-testing
Write and maintain tests for Eigen, a React Native application using React Native Testing Library and Relay Test Utils. Use this skill when writing new tests, fixing failing tests, adding test coverage, updating existing tests, or when asked about testing best practices for
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Write and maintain tests for Eigen, a React Native application using React Native Testing Library and Relay Test Utils. Use this skill when writing new tests, fixing failing tests, adding test coverage, updating existing tests, or when asked about testing best practices for Eigen. Triggers on requests like \
How to use
Aktywuj skill w kontekście kodu Eigen, gdy pracujesz nad testami — odpowie na pytania o pisanie nowych testów, naprawianie istniejących lub zwiększanie pokrycia testami.
Dla komponentów bez Relay: użyj szablonu z
assets/component-test-template.tsx. Importuje onfireEventiscreenz React Native Testing Library orazrenderWithWrappersz narzędzi testowych Eigen.Dla komponentów Relay: użyj szablonu z
assets/relay-test-template.tsx. Zawiera onsetupTestWrapperi importgraphqlz react-relay.Umieść pliki testów w katalogach
__tests__obok kodu źródłowego i nazwij je z rozszerzeniem.tests.tsx(nie.test.tsxani.spec.tsx).Postępuj zgodnie z wzorem Arrange-Act-Assert: najpierw przygotuj komponent i dane, następnie wyzwól akcję, na koniec sprawdź rezultat. Unikaj przestarzałych funkcji takich jak
renderWithWrappersLEGACYczywaitUntil.Do testowania analityki używaj
toMatchInlineSnapshot(), a dla operacji asynchronicznych stosujfindBy*queries zamiast ręcznego czekania na promise'y.