forked from grafana/oncall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
51 lines (46 loc) · 1.29 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module.exports = {
...require('./.config/jest.config'),
testEnvironment: 'jsdom',
moduleDirectories: ['node_modules', 'src'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'd.ts', 'cjs'],
moduleNameMapper: {
'grafana/app/(.*)': '<rootDir>/src/jest/grafanaMock.ts',
'openapi-fetch': '<rootDir>/src/jest/openapiFetchMock.ts',
'jest/matchMedia': '<rootDir>/src/jest/matchMedia.ts',
'^jest$': '<rootDir>/src/jest',
'^.+\\.(css|scss)$': '<rootDir>/src/jest/styleMock.ts',
'^lodash-es$': 'lodash',
'^.+\\.svg$': '<rootDir>/src/jest/svgTransform.ts',
'^.+\\.png$': '<rootDir>/src/jest/grafanaMock.ts',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
reporters: process.env.HTML_REPORT_ENABLED
? [
'default',
[
'jest-html-reporters',
{
openReport: process.env.NODE_ENV !== 'production',
},
],
]
: ['default'],
testTimeout: 10000,
testPathIgnorePatterns: ['/node_modules/', '/e2e-tests/'],
transform: {
'^.+\\.(t|j)sx?$': [
'@swc/jest',
{
sourceMaps: 'inline',
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
decorators: true,
dynamicImport: true,
},
},
},
],
},
};