@lynx-js/react/testing-library
ReactLynx Testing Library is a simple and complete ReactLynx unit testing library that encourages good testing practices.
Inspired completely by react-testing-library
Similar to react-testing-library, this library is designed to test your ReactLynx components in the same way you would test React components using react-testing-library.
Setup
Setup vitest:
Then you can start writing tests and run them with vitest!
Usage
💡 Since our testing environment (@lynx-js/testing-environment) is based on jsdom, You may also be interested in installing @testing-library/jest-dom so you can use
the custom jest matchers.
Examples
See our examples for more usage.
Credits
- Testing Library for the testing utilities and good practices for React testing.
参考
QueryByBoundAttribute
QueryByRole
重新导出 QueryByRole
QueryByText
重新导出 QueryByText
QueryMethod
重新导出 QueryMethod
SelectorMatcherOptions
WithSuggest
重新导出 WithSuggest