forked from kamilkisiela/graphql-hive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
33 lines (31 loc) · 939 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
29
30
31
32
33
import { resolve, dirname } from 'path';
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { pathsToModuleNameMapper } from 'ts-jest';
const ROOT_DIR = dirname(fileURLToPath(import.meta.url));
const TSCONFIG = resolve(ROOT_DIR, 'tsconfig.json');
const tsconfig = JSON.parse(readFileSync(TSCONFIG, 'utf-8'));
export default {
transform: { '^.+\\.tsx?$': 'ts-jest' },
extensionsToTreatAsEsm: ['.ts', '.tsx'],
testEnvironment: 'node',
rootDir: ROOT_DIR,
globals: {
'ts-jest': {
diagnostics: false,
tsconfig: TSCONFIG,
useESM: true,
},
},
restoreMocks: true,
reporters: ['default'],
modulePathIgnorePatterns: ['dist', 'integration-tests', 'tmp', 'target'],
moduleNameMapper: {
...pathsToModuleNameMapper(tsconfig.compilerOptions.paths, {
prefix: `${ROOT_DIR}/`,
}),
'^(\\.{1,2}/.*)\\.js$': '$1',
},
setupFiles: [],
collectCoverage: false,
};