-
-
Notifications
You must be signed in to change notification settings - Fork 172
/
jest.config.js
25 lines (23 loc) · 879 Bytes
/
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
const { resolve } = require('path')
const { pathsToModuleNameMapper } = require('ts-jest')
const CI = !!process.env.CI
const ROOT_DIR = __dirname
const TSCONFIG = resolve(ROOT_DIR, 'tsconfig.json')
const tsconfig = require(TSCONFIG)
module.exports = {
testEnvironment: 'node',
rootDir: ROOT_DIR,
restoreMocks: true,
reporters: ['default'],
modulePathIgnorePatterns: ['dist', 'test-assets', 'test-files', 'fixtures', '.bob'],
testPathIgnorePatterns: ['/node_modules/', '/dist/', '.bob/'],
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths, { prefix: `${ROOT_DIR}/` }),
collectCoverage: false,
cacheDirectory: resolve(ROOT_DIR, `${CI ? '' : 'node_modules/'}.cache/jest`),
transform: {
'^.+\\.mjs?$': 'babel-jest',
'^.+\\.ts?$': 'babel-jest',
'^.+\\.js$': 'babel-jest',
},
resolver: 'bob-the-bundler/jest-resolver.js',
}