-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.js
35 lines (35 loc) · 1.1 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
module.exports = {
projects: [
{
displayName: 'IDOL Frontend Tests',
testMatch: ['<rootDir>/frontend/**/*.test.(ts|tsx)'],
testPathIgnorePatterns: ['/node_modules/', '/.next/'],
testEnvironment: 'jsdom',
setupFiles: ['frontend/src/setup.ts'],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest'
},
transformIgnorePatterns: [
`/node_modules/(?!(lib-react)).+\\.js$`,
'^.+\\.module\\.(css|sass|scss)$'
],
moduleNameMapper: {
// Handle CSS imports (with CSS modules)
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
// Handle CSS imports (without CSS modules)
'^.+\\.(css|sass|scss)$': '<rootDir>/__mocks__/styleMock.js',
// Handle image imports
'^.+\\.(jpg|jpeg|png|gif|webp)$': `<rootDir>/__mocks__/fileMock.js`
}
},
{
displayName: 'IDOL Backend Tests',
testMatch: ['<rootDir>/**/*.test.ts'],
transform: {
'^.+\\.(ts|tsx)$': 'babel-jest'
},
setupFiles: ['backend/tests/setup.ts'],
rootDir: '<rootDir>/backend/'
}
]
};