Jest preset for unit-testing
Jest preset for unit-testing
Install package:
``bash`
npm i --save-dev @tramvai/test-unit-jest
Add new preset to your jest.config:
`js`
module.exports = {
preset: '@tramvai/test-unit-jest',
};
This presets implements next settings:
- default test runner jest-circuis
- default testEnvironment is node@swc-node/jest
- uses for transformationidentity-obj-proxy
- css files are mapped with
- image files are mapped to empty string
Based on jest doc
Just add at the start of test file following comment:
`ts``
/**
* @jest-environment your-environment
*/