npm run test
to run everything we have.npm run test:unit
to run unit tests.jest
snapshots to be sure that our components rendering did not change without notice. It saved us million times!Index
component, mount it to the page, then render it to string, and serialize to the text file inside __snapshots__
folder near the test itself. There can be multiple snapshots for different component states.npm run test:unit -u
to update existing snapshots with the updated state.axios-mock-adapter
to illustrate the point. You are free to use any kind of mocks you want.svg
icons. At some point jest
might fail to load and transform them.jest-svg-transformer
and jest-transform-stub
that will help you in this field.jest-svg-transformer
will load svg
as fake componentjest-transform-stub
will just stub all static files with no-opsnpm audit
to fail your CI when bad packages are found.