jest-preset-ns

An opinionated
Jest preset
for both react and non-react projects.
It comes with two default presets with both babel and typescript support.
Features
- default preset and preset for react are available
- modern javascript (babel) and typescript (ts-jest) support
- mocks files (eg. png, gif, jpg, ...) and date (jest-date-mock)
automatically
- looks for tests in
__tests__
and for *.(spec|test).[jt]s(x)?
files
- easy extendable
Installation
npm install --save-dev jest-preset-ns jest
yarn add jest-preset-ns jest --dev
Usage
Add jest-preset-ns
as
preset
to your Jest config. This can be done by adding it to your package.json
or
jest.config.js
:
{
"jest": {
"preset": "jest-preset-ns"
}
}
module.exports = {
preset: 'jest-preset-ns',
}
Feel free to extend the "jest"
-configuration object along the way with your
own settings.
For running tests, use the Jest CLI.
Compatibility
This package is compatible only with React 16+.
Helpful tips
How to Publish
yarn lerna:version
npx lerna-changelog --from <tag> --to <tag>
git add CHANGELOG.md && git commit -m "chore: updated CHANGELOG"
git push --follow-tags
yarn lerna:publish
References