forked from KaotoIO/kaoto-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
47 lines (38 loc) · 1.65 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
const path = require('path');
module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
moduleNameMapper: {
'\\.(css|less)$': path.resolve(__dirname, './src/__mocks__/styleMock.js'),
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
path.resolve(__dirname, './src/__mocks__/fileMock.js'),
'@patternfly/react-code-editor': path.resolve(
__dirname,
'./src/__mocks__/reactCodeEditorMock.js'
),
'@kaoto/api': path.resolve(__dirname, './src/api'),
'@kaoto/assets': path.resolve(__dirname, './src/assets'),
'@kaoto/components': path.resolve(__dirname, './src/components'),
'@kaoto/layout': path.resolve(__dirname, './src/layout'),
'@kaoto/types': path.resolve(__dirname, './src/types'),
'@kaoto/routes': path.resolve(__dirname, './src/routes'),
'@kaoto/services': path.resolve(__dirname, './src/services'),
'@kaoto/store': path.resolve(__dirname, './src/store'),
'@kaoto/utils': path.resolve(__dirname, './src/utils'),
},
roots: ['<rootDir>'],
// A preset that is used as a base for Jest's configuration
preset: 'ts-jest',
// The path to a module that runs some code to configure or set up the testing framework before each test
setupFilesAfterEnv: [path.resolve(__dirname, './setupTests.ts')],
testEnvironment: 'jsdom',
};