Please beware all features or bug fixes must be tested by one or more specs (unit-tests, visual regression).
For unit testing we are using Jest along with React Testing Library and jest-dom.
yarn test
- one time unit tests run
yarn test:watch
- run with watcher
- https://testing-library.com/docs/intro
- https://github.com/testing-library/jest-dom/blob/master/README.md
- https://kentcdodds.com/blog/common-mistakes-with-react-testing-library
For visual regression we are using reg-cli and storycap. These test are typically run during CI/CD pipeline.
If this visual-tests
step fails due to intended changes, you have to update snapshots manually, by
running yarn test:storybook:visual:update
and commit updated snapshots.
Linting (eslint and stylelint) is runned in a pre-commit hook as well as in CI.
yarn lint
- check all files
yarn lint:fix
- check and try to fix errors in all files
yarn lint:css
- check styled-components syntax in all files
Typings check is automatically runned in CI.
yarn types
- check all files