jest.config.js 550 B

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