-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathjest.config.js
More file actions
21 lines (18 loc) · 915 Bytes
/
Copy pathjest.config.js
File metadata and controls
21 lines (18 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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 { grafanaESModules, nodeModulesToTransform } = require('./.config/jest/utils');
// Add ESM-only modules missing from grafanaESModules to the list of modules
// that need to be transformed
const additionalESModules = ['@react-hookz/web', '@ver0/deep-equal'];
module.exports = {
// Jest configuration provided by Grafana scaffolding
...require('./.config/jest.config'),
// Override transformIgnorePatterns to include the additional ESM-only modules
transformIgnorePatterns: [nodeModulesToTransform([...grafanaESModules, ...additionalESModules])],
// Add module name mapper to resolve react-router/dom
moduleNameMapper: {
...require('./.config/jest.config').moduleNameMapper,
'^react-router/dom$': 'react-router-dom',
},
};