forked from kamilkisiela/graphql-inspector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
28 lines (26 loc) · 814 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
26
27
28
const { resolve } = require('path');
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const ROOT_DIR = __dirname;
const TSCONFIG = resolve(ROOT_DIR, 'tsconfig.json');
const tsconfig = require(TSCONFIG);
const CI = !!process.env.CI;
module.exports = {
transform: { '^.+\\.tsx?$': 'ts-jest' },
testEnvironment: 'node',
rootDir: ROOT_DIR,
globals: {
'ts-jest': {
diagnostics: false,
tsconfig: 'tsconfig.json',
},
},
restoreMocks: true,
reporters: ['default'],
modulePathIgnorePatterns: ['dist'],
testPathIgnorePatterns: ['__tests__/assets/'],
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths, {
prefix: `${ROOT_DIR}/`,
}),
cacheDirectory: resolve(ROOT_DIR, `${CI ? '' : 'node_modules/'}.cache/jest`),
collectCoverage: false,
};