Skip to content

Instantly share code, notes, and snippets.

@fmoessle
Created September 8, 2021 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmoessle/3828bf8474ac4f49dec8c0af76a34f5c to your computer and use it in GitHub Desktop.
Save fmoessle/3828bf8474ac4f49dec8c0af76a34f5c to your computer and use it in GitHub Desktop.
const { pathsToModuleNameMapper } = require('ts-jest/utils')
const { compilerOptions } = require('./tsconfig')
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
// this enables us to use tsconfig-paths with jest
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment