jest.config.js 500 B

12345678910111213
  1. const { pathsToModuleNameMapper } = require('ts-jest/utils');
  2. // In the following statement, replace `./tsconfig` with the path to your `tsconfig` file
  3. // which contains the path mapping (ie the `compilerOptions.paths` option):
  4. const { compilerOptions } = require('../../tsconfig.json');
  5. module.exports = {
  6. "roots": [
  7. "<rootDir>/src"
  8. ],
  9. preset: 'ts-jest',
  10. testEnvironment: 'node',
  11. moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths , { prefix: '<rootDir>/../../' } ),
  12. };