-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
27 lines (27 loc) · 935 Bytes
/
jest.config.js
File metadata and controls
27 lines (27 loc) · 935 Bytes
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
module.exports = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/src/setupTests.js'],
moduleNameMapper: {
'\\.(css|less|scss)$': 'identity-obj-proxy',
'^lightweight-charts$': '<rootDir>/src/__mocks__/lightweight-charts.js'
},
transform: {
'^.+\\.(js|jsx|mjs)$': 'babel-jest'
},
moduleFileExtensions: ['js', 'jsx', 'json'],
testMatch: [
'<rootDir>/src/**/__tests__/**/*.(js|jsx)',
'<rootDir>/src/**/?(*.)(test|spec).(js|jsx)'
],
collectCoverageFrom: [
'src/**/*.(js|jsx)',
'!src/index.js',
'!src/main.jsx',
'!src/**/*.stories.(js|jsx)',
'!src/setupTests.js'
],
coverageReporters: ['text', 'lcov', 'html'],
clearMocks: true, // resets call counts after each test
resetMocks: false, // do NOT reset mock implementations — factory defaults must persist
restoreMocks: false // only meaningful for jest.spyOn; false removes confusion with jest.fn() mocks
}