Last active
October 3, 2022 19:19
-
-
Save samuelastech/4c6aefb9de0a5f9d014dab6af5b7f20a to your computer and use it in GitHub Desktop.
Jest and supertest setup
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
{ | |
"scripts": { | |
"test": "jest --watch --verbose", | |
"test-coverage": "jest --coverage" | |
}, | |
"devDependencies": { | |
"@faker-js/faker": "...", | |
"factory-girl": "...", | |
"faker": "...", | |
"jest": "...", | |
"mongodb-memory-server": "...", | |
"supertest": "..." | |
} | |
} |
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
import { compilerOptions } from './tsconfig.json' | |
import { pathsToModuleNameMapper } from 'ts-jest' | |
export default { | |
bail: true, | |
clearMocks: true, | |
collectCoverage: true, | |
coverageDirectory: 'coverage', | |
coverageProvider: 'v8', | |
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>' }), | |
preset: 'ts-jest' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment