forked from grafana/pyroscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
36 lines (35 loc) · 1.28 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
const path = require('path');
module.exports = {
// TypeScript files (.ts, .tsx) will be transformed by ts-jest to CommonJS syntax, and JavaScript files (.js, jsx) will be transformed by babel-jest.
preset: 'ts-jest/presets/js-with-babel',
testEnvironment: 'jsdom',
setupFilesAfterEnv: [path.join(__dirname, 'setupAfterEnv.ts')],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/?(*.)+(spec|test).+(ts|tsx|js)',
],
moduleNameMapper: {
'@webapp(.*)$': path.join(__dirname, 'webapp/javascript/$1'),
},
transform: {
'\\.module\\.(css|scss)$': 'jest-css-modules-transform',
'\\.(css|scss)$': 'jest-css-modules-transform',
'\\.svg$': path.join(__dirname, 'svg-transform.js'),
},
transformIgnorePatterns: [
// force us to not transpile these dependencies
// https://stackoverflow.com/a/69150188
'node_modules/(?!(true-myth|d3|d3-array|internmap|d3-scale|react-notifications-component|graphviz-react))',
],
globals: {
'ts-jest': {
tsconfig: path.join(__dirname, `tsconfig.test.json`),
diagnostics: {
// https://github.com/kulshekhar/ts-jest/issues/1647#issuecomment-832577036
pathRegex: /\.(test)\.tsx$/,
},
},
},
globalSetup: '<rootDir>/globalSetup.js',
globalTeardown: '<rootDir>/globalTeardown.js',
};