Created
August 28, 2021 17:39
-
-
Save luminuszz/2ddb189c21ef33d833491acf1ce9120c to your computer and use it in GitHub Desktop.
Setup jest config for resolve ts-paths
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable @typescript-eslint/no-var-requires */ | |
const { pathsToModuleNameMapper } = require('ts-jest/utils') | |
const { compilerOptions } = require('./tsconfig.json') | |
module.exports = { | |
setupFiles: ['dotenv/config'], | |
clearMocks: true, | |
verbose: true, | |
collectCoverage: true, | |
preset: 'ts-jest', | |
collectCoverageFrom: [ | |
'<rootDir>/src/modules/**/services/*.ts', | |
'<rootDir>/src/modules/**/controllers/*.ts', | |
'<rootDir>/src/**/**/*.pipe.ts', | |
], | |
coverageDirectory: 'coverage', | |
coverageReporters: ['text-summary', 'lcov'], | |
testEnvironment: 'node', | |
testMatch: ['**/*.spec.ts'], | |
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { | |
prefix: '<rootDir>', | |
}), | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment