-
Notifications
You must be signed in to change notification settings - Fork 65
/
jest.config.js
51 lines (51 loc) · 1.99 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module.exports = {
roots: ['<rootDir>/src'],
setupFiles: ['<rootDir>/jestHelpers/setup.js'],
setupFilesAfterEnv: ['<rootDir>/jestHelpers/setupFilesAfterEnv.js'],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'styl'],
moduleNameMapper: {
'.(png|gif|jpe?g)$': '<rootDir>/jestHelpers/mocks/fileMock.js',
'.svg$': '<rootDir>/jestHelpers/mocks/iconMock.js',
'.styl$': 'identity-obj-proxy',
'\\.(css|less)$': 'identity-obj-proxy',
'^locales/.*': '<rootDir>/src/locales/en.json',
'^models(.*)': '<rootDir>/src/models$1',
'^sharing(.*)': '<rootDir>/src/sharing$1',
'^authentication(.*)': '<rootDir>/src/authentication$1',
'^viewer(.*)': '<rootDir>/src/viewer$1',
'^react-cozy-helpers(.*)': '<rootDir>/src/lib/react-cozy-helpers$1',
'^components(.*)': '<rootDir>/src/components$1',
'^hooks(.*)': '<rootDir>/src/hooks$1',
'^test(.*)': '<rootDir>/test/$1',
'^lib(.*)': '<rootDir>/src/lib$1',
'react-pdf/dist/esm/pdf.worker.entry':
'<rootDir>/jestHelpers/mocks/pdfjsWorkerMock.js',
'^cozy-client$': 'cozy-client/dist/index.js',
'^react-redux': '<rootDir>/node_modules/react-redux',
'^cozy-ui/react(.*)$': '<rootDir>/node_modules/cozy-ui/transpiled/react$1',
'^config/(.*)': '<rootDir>/src/config/$1',
'^constants/(.*)': '<rootDir>/src/constants/$1',
'^modules/(.*)': '<rootDir>/src/modules/$1',
'^queries(.*)': '<rootDir>/src/queries$1'
},
clearMocks: true,
transform: {
'\\.[jt]sx?$': 'babel-jest',
'^.+\\.webapp$': '<rootDir>/test/jestLib/json-transformer.js'
},
transformIgnorePatterns: [
'node_modules/(?!cozy-ui|cozy-harvest-lib|cozy-keys-lib|cozy-sharing|)',
'jest-runner'
],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
url: 'http://cozy.localhost:8080/'
},
testMatch: ['**/(*.)(spec|test).[jt]s?(x)'],
globals: {
__APP_SLUG__: 'drive',
__TARGET__: 'browser',
__DEVELOPMENT__: true
},
reporters: ['default', '<rootDir>/jestHelpers/ConsoleUsageReporter.js']
}