Renamed all instances of 'TSInjex' to 'TSinjex' for consistency across the codebase, including interfaces, classes, and test files. Updated the version in `package.json` from 0.0.5 to 0.0.6. Added Jest setup example to the `README.md` to guide developers on initial configuration for testing.
22 lines
612 B
Markdown
22 lines
612 B
Markdown
|
|
|
|
## 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`
|
|
],
|
|
};
|
|
``` |