-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
46 lines (44 loc) · 1.32 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
// force timezone to UTC to allow tests to work regardless of local timezone
// generally used by snapshots, but can affect specific tests
process.env.TZ = 'UTC';
const baseConfig = require('./.config/jest.config'); // Jest configuration provided by Grafana scaffolding
const { nodeModulesToTransform, grafanaESModules } = require('./.config/jest/utils');
const esModules = [...grafanaESModules, '@bsull/augurs', 'monaco-promql'];
module.exports = {
...baseConfig,
transformIgnorePatterns: [nodeModulesToTransform(esModules)],
moduleNameMapper: {
...baseConfig.moduleNameMapper,
'\\.svg$': '<rootDir>/src/mocks/svgMock.js',
},
transform: {
'^.+\\.(t|j)sx?$': [
'@swc/jest',
{
sourceMaps: 'inline',
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
decorators: false,
dynamicImport: true,
},
target: 'es2022',
// Add these options for proper property descriptors
keepClassNames: true,
preserveAllComments: true,
transform: {
legacyDecorator: true,
decoratorMetadata: true,
},
},
module: {
type: 'commonjs',
strict: true,
strictMode: true,
noInterop: false,
},
},
],
},
};