Skip to content

Instantly share code, notes, and snippets.

@phunguyen19
Created June 28, 2021 08:35
Show Gist options
  • Select an option

  • Save phunguyen19/2e90ddee2b5c23baddf9d4ba7801cf2e to your computer and use it in GitHub Desktop.

Select an option

Save phunguyen19/2e90ddee2b5c23baddf9d4ba7801cf2e to your computer and use it in GitHub Desktop.
nestjs jest config coverage & module name mapper
{
"moduleFileExtensions": ["js", "json", "ts"],
"rootDir": ".",
"testEnvironment": "node",
"testRegex": ".e2e-spec.ts$",
"verbose": true,
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"moduleNameMapper": {
"^src/(.*)": "<rootDir>/src/$1",
"^test/(.*)": "<rootDir>/test/$1"
},
"coverageDirectory": "./coverage-e2e",
"coveragePathIgnorePatterns": ["<rootDir>/test/", "<rootDir>/node_modules/"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment