tsx_tests.mdc 598 B

12345678910111213141516171819202122232425
  1. ---
  2. description: Rules and guidelines for running *.spec.tsx tests and writing React tests
  3. globs: *.spec.tsx
  4. ---
  5. # Running *.spec.tsx tests
  6. Please run tests with command: CI=true yarn test
  7. For example: CI=true yarn test path/to/file.spec.tsx
  8. NOTE: `CI=true` runs jest in non-interactive mode.
  9. # React tests
  10. When writing React tests and using react-test-library, please use exports from 'sentry-test/reactTestingLibrary'. It re-exports from '@testing-library/react'. For example:
  11. ```
  12. import {
  13. render,
  14. screen,
  15. userEvent,
  16. waitFor,
  17. within,
  18. } from 'sentry-test/reactTestingLibrary';
  19. ```