-
Notifications
You must be signed in to change notification settings - Fork 9
/
jest.config.js
30 lines (30 loc) · 981 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
module.exports = {
moduleDirectories: ['node_modules', 'app/javascript'],
moduleFileExtensions: ['js', 'ts'],
automock: false,
resetMocks: true,
transform: { '^.+\\.(js)?$': 'babel-jest' },
cacheDirectory: '<rootDir>/.jest-cache',
collectCoverage: true,
coverageDirectory: 'coverage/frontend',
coverageReporters: ['text', 'lcov'],
collectCoverageFrom: [
'<rootDir>/app/javascript/**/*.js',
'!<rootDir>/app/javascript/**/index.js',
'!<rootDir>/app/javascript/**/application.js',
'!<rootDir>/app/javascript/utils/test.js'
],
reporters: ['default'],
setupFilesAfterEnv: ['<rootDir>/app/javascript/jestGlobalMocks.js'],
transformIgnorePatterns: ['node_modules/*'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/app/javascript/$1'
},
roots: ['app/javascript'],
testEnvironment: 'jsdom',
testMatch: ['**/app/javascript/**/*.spec.(js|ts)'],
testPathIgnorePatterns: [],
testEnvironmentOptions: {
url: 'http://localhost'
}
}