-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
39 lines (33 loc) · 954 Bytes
/
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
module.exports = {
// Set the test environment
testEnvironment: 'jsdom',
// Define where Jest should look for test files
roots: [
'<rootDir>/__tests__',
'<rootDir>/chat/static/js',
'<rootDir>/cal/static/js',
'<rootDir>/dashboard/static/js'
],
// File patterns to match for test files
testMatch: [
'**/__tests__/**/*.test.js?(x)',
'**/__tests__/**/*.spec.js?(x)',
'**/?(*.)+(spec|test).js?(x)'
],
// Explicitly tell Jest which files to ignore
testPathIgnorePatterns: [
'/node_modules/',
'/__tests__/mocks/'
],
// Setup files to run before tests
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
// Transform files with Babel
transform: {
'^.+\\.js$': 'babel-jest'
},
// Mock static assets
moduleNameMapper: {
'\\.(css|less|scss|sass)$': '<rootDir>/__tests__/mocks/styleMock.js',
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/__tests__/mocks/fileMock.js'
}
};