Based on next-theme-ui-example
.
Featuring:
- TypeScript
- Next
- ThemeUI
- NProgress
- Jest
- react-testing-library
Jest is configured and ready to use with react-testing-library
.
There is a custom rendering setup similar to what is found in the documentation. It wraps all tested components with ThemeUI's ThemeProvider
.
The custom test renderer, and all react-testing-library
exports are available without using relative imports:
import { render, fireEvent } from 'test-utils';
Make sure you import from 'test-utils'
or your tests may crash if the theme is expected.
Because ThemeUI uses emotion under the hood, jest-emotion
's snapshot serializer is included.
Refer to the emotion's testing documentation for more info.