95ef003e99ede8aba11bbb44a1f42606128f0a58

* refactor: consolidate registration decorators - Introduced `Register` decorator to handle class and instance registration in the DI container. - Deprecated `RegisterInstance` in favor of `Register`, which now internally handles instance registration. - Added support for marking dependencies as deprecated with a warning logged upon first resolution. - Updated documentation with examples and notes on deprecation. * tests: add mode parameter to RegisterInstanceDecorator - Introduced a `mode` parameter to the `test_RegisterInstanceDecorator` function allowing 'instance' or 'standalone' modes. - Updated test cases to utilize the new `mode` parameter when registering an instance. - Disabled specific ESLint rule in `Decorators.test.ts` for deprecation warnings. - Added an additional test call to `test_RegisterInstanceDecorator` with 'instance' mode. * docs: Reflect changes to changelog * refactor: add region tags for overloads in Register.ts * docs: Reflect changes to changelog * refactor: consolidate registration decorators - Introduced `Register` decorator to handle class and instance registration in the DI container. - Deprecated `RegisterInstance` in favor of `Register`, which now internally handles instance registration. - Added support for marking dependencies as deprecated with a warning logged upon first resolution. - Updated documentation with examples and notes on deprecation. * tests: add mode parameter to RegisterInstanceDecorator - Introduced a `mode` parameter to the `test_RegisterInstanceDecorator` function allowing 'instance' or 'standalone' modes. - Updated test cases to utilize the new `mode` parameter when registering an instance. - Disabled specific ESLint rule in `Decorators.test.ts` for deprecation warnings. - Added an additional test call to `test_RegisterInstanceDecorator` with 'instance' mode. * docs: Reflect changes to changelog * refactor: add region tags for overloads in Register.ts * docs: Reflect changes to changelog * docs: Reflect changes to changelog und push version
TSinjex
Configuration
Identifiers
Strings and symbols are possible for the identifiers.
Jest
For the use of TSinjex with Jest, the corresponding source files can be found under ./src
of the TSinjex node_module folder. To use these files, the moduleNameMapper
must be configured in the Jest configuration file. The following example shows how to configure the Jest configuration file to use the source files of TSinjex.
Example jest setup
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`
],
};
Languages
TypeScript
85.9%
JavaScript
14.1%