-
Notifications
You must be signed in to change notification settings - Fork 5
/
jest.config.js
31 lines (29 loc) · 1.2 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { config, pathsToModuleNameMapper } from '@jjangga0214/jest-config'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const tsConfig = require('./tsconfig.json')
export default {
...config,
// Monorepo configuration
// projects: ['<rootDir>/packages/*'], // ISSUE: https://github.com/facebook/jest/issues/12230
// An array of directory names to be searched recursively up from the requiring module's location
// moduleDirectories: [
// __dirname,
// path.join(__dirname, 'node_modules'),
// 'node_modules',
// ],
// A preset that is used as a base for Jest's configuration
// preset: 'ts-jest',
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: ['/node_modules/', 'test-project'],
// A map from regular expressions to paths to transformers
// transform: { '^.+\\.(t|j)sx?$': ['@swc/jest'] },
// transform: { '^.+\\.(t|j)sx?$': ['esbuild-jest'] },
// transform: { '^.+\\.(t|j)sx?$': ['ts-jest'] },
moduleNameMapper: {
...config.moduleNameMapper,
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
prefix: '<rootDir>/packages/',
}),
},
}