-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
33 lines (29 loc) · 833 Bytes
/
jest.config.ts
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 { join } from 'path';
import type { Config } from 'jest';
process.env.TZ = 'UTC';
const cwd = __dirname;
const baseConfig: Config = {
preset: 'ts-jest',
rootDir: cwd,
transform: {
'^.+\\.[t]sx?$': ['ts-jest', { tsconfig: join(cwd, './tsconfig.lint.json') }],
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
moduleFileExtensions: ['js', 'ts', 'json'],
testEnvironment: 'node',
};
const globalConfig: Config = {
coverageDirectory: join(cwd, './test-reports'),
verbose: true,
collectCoverageFrom: [
'./packages/*/lib/*.ts',
'!**/dist/**/*',
'!**/index.ts',
'!**/*.test.ts',
'!**/*.spec.ts',
],
reporters: ['default', 'jest-junit'],
};
export { baseConfig };
export default { ...baseConfig, ...globalConfig };