-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathjest.config.js
More file actions
55 lines (55 loc) · 1.4 KB
/
jest.config.js
File metadata and controls
55 lines (55 loc) · 1.4 KB
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
52
53
54
55
module.exports = {
globals: {
__ALLOW_HTTP__: false,
__TARGET__: 'browser',
__SENTRY_TOKEN__: 'token',
cozy: {}
},
moduleDirectories: ['src', 'node_modules'],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'styl'],
moduleNameMapper: {
'\\.(png|gif|jpe?g|svg|css)$': '<rootDir>/test/__mocks__/fileMock.js',
'.styl$': 'identity-obj-proxy',
'^cozy-client$': 'cozy-client/dist/index',
'^@/test(.*)': '<rootDir>/test/$1',
'^@/(.*)$': '<rootDir>/src/$1'
},
setupFilesAfterEnv: ['<rootDir>/test/jestLib/setup.js'],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
url: 'http://cozy.localhost:8080/'
},
transform: {
'\\.(js|jsx|mjs)$': [
'@swc/jest',
{
jsc: {
experimental: {
plugins: [['@swc-contrib/mut-cjs-exports', {}]]
},
parser: {
jsx: true
}
}
}
],
'\\.(ts|tsx)$': [
'@swc/jest',
{
jsc: {
experimental: {
plugins: [['@swc-contrib/mut-cjs-exports', {}]]
},
parser: {
syntax: 'typescript',
tsx: true
}
}
}
],
'^.+\\.webapp$': '<rootDir>/test/jestLib/json-transformer.js'
},
transformIgnorePatterns: [
'node_modules/(?!cozy-ui|cozy-harvest-lib|cozy-keys-lib|cozy-sharing|react-swipeable-views-core|copy-text-to-clipboard)'
]
}