-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
63 lines (58 loc) · 1.63 KB
/
jest.config.js
File metadata and controls
63 lines (58 loc) · 1.63 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Enable full object reporting in console.log
import { inspect } from 'util'
inspect.defaultOptions.depth = null
/** @type {import('@jest/types').Config.InitialOptions.CoverageThresholdValue} */
const fullCoverage = {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
}
const esBuildConfig = {
sourcemap: true,
platform: 'node',
external: ['/node_modules/*'],
loader: 'ts',
}
/** @type {import('ts-jest').JestConfigWithTsJest} */
const config = {
preset: 'ts-jest/presets/default-esm',
cacheDirectory: '.jest-cache',
collectCoverage: true,
coveragePathIgnorePatterns: ['node_modules/', 'test/', 'generated/'],
coverageReporters: ['json', 'lcov', 'text', 'text-summary', 'clover'],
coverageThreshold: {
'./src/*.ts': fullCoverage,
global: fullCoverage,
},
globalSetup: '<rootDir>/jest/global-setup.mjs',
globalTeardown: '<rootDir>/jest/global-teardown.mjs',
moduleNameMapper: {
'@odd/api': '<rootDir>/node_modules/@odd/api',
'@odd/api/(.*)$': '<rootDir>/node_modules/@odd/api/$1',
'@root/(.*)$': '<rootDir>/$1',
'@test/(.*)$': '<rootDir>/test/$1',
'@test': '<rootDir>/test/index.ts',
'^@/(.*)$': '<rootDir>/src/$1',
},
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/dist/',
'<rootDir>/generated/',
],
testTimeout: 60000,
transform: {
'^.+\\.tsx?$': [
'esbuild-jest',
{
format: 'esm',
sourcemap: 'inline',
target: 'esnext',
},
],
},
transformIgnorePatterns: ['/node_modules/', '/generated/'],
}
export default config