Skip to content

Commit

Permalink
finish converting all tests. remove enzyme
Browse files Browse the repository at this point in the history
  • Loading branch information
omsaggau committed Nov 27, 2023
1 parent d63e0a8 commit 64e6d90
Show file tree
Hide file tree
Showing 67 changed files with 2,017 additions and 1,161 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ Every new instance of `storiesOf` creates a new menu item in the storybook. When
a sub menu.

#### Testing
Testing is done with [Jest](https://jestjs.io/en/) and Enzyme. Write unit tests for all components and aim for a 100% test coverage.
Testing is done with [Jest](https://jestjs.io/en/) and React testing library. Write unit tests for all components and aim for a 100% test coverage. [Do no test component internals and state. Test on actual ouput on what user experiences.](https://testing-library.com/docs/guiding-principles)
To run the tests, simply run `npm test`. To run tests without using any cache, run `npm run clean-test`.
If you need to replace outdated screenshots, run `npm run clear-tests`.

[Here is a cheat sheet for Jest](https://github.com/sapegin/jest-cheat-sheet).

[Here is a cheat sheet for Enzyme](https://devhints.io/enzyme).
[Here is a cheat sheet for Testing library](https://testing-library.com/docs/react-testing-library/cheatsheet/).

#### Styling
Styling is done with SCSS. You should familiarise yourself just a bit with the [stylelint](./.stylelintrc) configuration,
Expand Down
3 changes: 1 addition & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ module.exports = {
modulePaths: [
'<rootDir>/src/scripts/atoms',
],
snapshotSerializers: ['enzyme-to-json/serializer'],
setupFiles: ['<rootDir>/src/setupTests.js'],
setupFilesAfterEnv: ['<rootDir>/src/setupTests.js'],
testMatch: ['**/*.test.jsx'],
transform: { '^.+\\.jsx?$': 'babel-jest' },
transformIgnorePatterns: ['<rootDir>/node_modules/'],
Expand Down
Loading

0 comments on commit 64e6d90

Please sign in to comment.