@namics/test-suite
Version:
jest test suite
53 lines (40 loc) • 1.82 kB
Markdown
# Test suite [](https://www.npmjs.com/package/@namics/test-suite)
> reusable and easy to use jest test suite
## Usage
`npm i -D @namics/test-suite`
This packages uses [jest](https://jestjs.io/) and [enzyme](http://airbnb.io/enzyme/) please read their documentations for details.
Most parts are copied from the [Create React App](https://github.com/facebook/create-react-app) unit test solution.
**package.json**
```json
...
"scripts": {
"test": "test-suite --coverage",
"test:dev": "test-suite",
...
},
...
```
## Collect Coverage
**package.json**
```json
"jest": {
"collectCoverageFrom": [
"src/**/*.{js|jsx|ts|tsx}",
"!src/**/*.stories.{js|jsx|ts|tsx}",
"!src/dev.ts",
"!src/index.tsx"
]
},
```
allowed configurations:
| key | documentation |
|-------------------------|------------------------------------------------------------------------------|
| collectCoverageFrom | https://jestjs.io/docs/en/configuration#collectcoveragefrom-array |
| coverageReporters | https://jestjs.io/docs/en/configuration#coveragereporters-array-string |
| coverageThreshold | https://jestjs.io/docs/en/configuration#coveragethreshold-object |
| resetMocks | https://jestjs.io/docs/en/configuration#resetmocks-boolean |
| resetModules | https://jestjs.io/docs/en/configuration#resetmodules-boolean |
| snapshotSerializers | https://jestjs.io/docs/en/configuration#snapshotserializers-array-string |
| watchPathIgnorePatterns | https://jestjs.io/docs/en/configuration#watchpathignorepatterns-array-string |
## License
[MIT License](./LICENSE)