forked from deephaven/web-client-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.base.cjs
36 lines (35 loc) · 1.22 KB
/
jest.config.base.cjs
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 = {
transform: {
'.(ts|tsx|js|jsx)': ['babel-jest', { rootMode: 'upward' }],
},
// Makes jest transform monaco, but continue ignoring other node_modules. Used for MonacoUtils test
transformIgnorePatterns: [
'node_modules/(?!(monaco-editor|d3-interpolate|d3-color)/)',
],
moduleNameMapper: {
'SpectrumTheme([^.]+)\\.module\\.scss$': path.join(
__dirname,
'./__mocks__/spectrumTheme$1Mock.js'
),
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(css|less|scss|sass)\\?inline$': path.join(
__dirname,
'./__mocks__/fileMock.js'
),
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
path.join(__dirname, './__mocks__/fileMock.js'),
'^fira$': 'identity-obj-proxy',
'^monaco-editor$': path.join(
__dirname,
'node_modules',
'monaco-editor/esm/vs/editor/editor.api.js'
),
// Handle monaco worker files
'\\.worker.*$': 'identity-obj-proxy',
// All packages except icons use src code
'^@deephaven/(?!icons)(.*)$': path.join(__dirname, './packages/$1/src'),
},
testEnvironment: 'jsdom',
setupFilesAfterEnv: [path.join(__dirname, './jest.setup.ts')],
};