Configured Jest for improved test coverage reporting and threshold enforcement. Updated README with project time and test coverage badges. Added scripts to fix coverage report paths and generate badges. Updated dependencies to include necessary tools for coverage reporting. Bumped package version to 0.0.9.
37 lines
1.4 KiB
Markdown
37 lines
1.4 KiB
Markdown
### Project Time
|
|
|
|

|
|
|
|
### Test Coverage
|
|
|
|
[Coverage Report..](https://pxammaxp.github.io/TSinjex/coverage/lcov-report/index.html)
|
|
|
|
| Statements | Branches | Functions | Lines |
|
|
| --------------------------- | ----------------------- | ------------------------- | ----------------- |
|
|
|  |  |  |  |
|
|
|
|
|
|
# TSinjex
|
|
|
|
## Configuration
|
|
|
|
### Jest
|
|
|
|
#### Example jest setup
|
|
|
|
```ts
|
|
module.exports = {
|
|
setupFilesAfterEnv: ['./scripts/jest.setup.js'],
|
|
preset: 'ts-jest',
|
|
testEnvironment: 'node',
|
|
testMatch: ['**/__tests__/**/*.test.ts', '**/?(*.)+(test).ts'],
|
|
moduleDirectories: ['node_modules', 'src'],
|
|
moduleNameMapper: {
|
|
'^src/(.*)$': '<rootDir>/src/$1', // Map src to the source folder
|
|
'^ts-injex$': '<rootDir>/node_modules/ts-injex/src', // Map ts-injex to the source folder
|
|
},
|
|
transformIgnorePatterns: [
|
|
'node_modules/(?!ts-injex)' // **Dont** ignore ts-injex on preset `ts-jest`
|
|
],
|
|
};
|
|
``` |