-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.js
20 lines (19 loc) · 852 Bytes
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const { pathsToModuleNameMapper } = require('ts-jest')
const { compilerOptions } = require('./tsconfig.json')
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
setupFilesAfterEnv: ['<rootDir>/src/test/setup.ts'],
// https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping/
roots: ['src'],
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
// Transform @dao-dao/* packages since they are not transpiled.
transform: {
'node_modules/@dao-dao/.+\\.tsx?': ['ts-jest'],
},
// node_modules is ignored by default, so override that behavior and allow
// @dao-dao/* packages to be transformed by using a negative lookahead.
transformIgnorePatterns: ['node_modules/(?!@dao-dao/.+\\.tsx?)'],
}