Skip to content

Instantly share code, notes, and snippets.

@markodayan
Created December 30, 2021 15:05
Show Gist options
  • Save markodayan/5b009cd0eb321dc7d2f4484957c14139 to your computer and use it in GitHub Desktop.
Save markodayan/5b009cd0eb321dc7d2f4484957c14139 to your computer and use it in GitHub Desktop.
Jest Configuration (specifically TS prep)
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('./tsconfig.json');
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
modulePaths: ['<rootDir>'],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment