-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathjest.config.js
30 lines (30 loc) · 1.07 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
module.exports = {
roots: ['<rootDir>/src'],
testEnvironmentOptions: {
url: 'http://cozy.localhost:8080/'
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'styl'],
setupFilesAfterEnv: ['<rootDir>/test/jestLib/setup.js'],
moduleDirectories: ['src', 'node_modules', 'test'],
moduleNameMapper: {
'\\.(png|gif|jpe?g|svg)$': '<rootDir>/test/__mocks__/fileMock.js',
// identity-obj-proxy module is installed by cozy-scripts
'\\.(css|styl)$': 'identity-obj-proxy',
'^cozy-client$': 'cozy-client/dist/index.js',
'^cozy-ui/react(.*)$': 'cozy-ui/transpiled/react$1',
'^@atlaskit/editor-core(.*)$':
'<rootDir>/node_modules/cozy-editor-core/src$1',
'^test(.*)': '<rootDir>/test/$1'
},
testEnvironment: '<rootDir>/test/jestLib/custom-test-env.js',
transformIgnorePatterns: ['node_modules/(?!cozy-(ui|sharing|harvest-lib))'],
transform: {
'^.+\\.webapp$': '<rootDir>/test/jestLib/json-transformer.js',
'^.+\\.(ts|tsx|js|jsx)?$': 'babel-jest'
},
globals: {
__ALLOW_HTTP__: false,
__TARGET__: 'browser',
cozy: {}
}
}