forked from commercetools/ui-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.test.config.js
36 lines (35 loc) · 1.14 KB
/
jest.test.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
const vendorsToTranspile = require('./vendors-to-transpile');
// Resolve the absolute path of the caller location.
const rootPath = process.cwd();
module.exports = {
displayName: 'test',
globals: {
'process.env': {
NODE_ENV: 'test',
},
},
moduleDirectories: ['src', 'packages', 'node_modules'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/test/transform-file.js',
'\\.css$': 'identity-obj-proxy',
},
clearMocks: true,
rootDir: rootPath,
setupFiles: [
'raf/polyfill',
'<rootDir>/test/setup-tests.js',
'jest-localstorage-mock',
],
setupFilesAfterEnv: ['<rootDir>/scripts/setup-test-framework.js'],
snapshotSerializers: ['enzyme-to-json/serializer'],
testEnvironment: 'jest-environment-jsdom-sixteen',
testURL: 'https://mc.commercetools.com/',
testPathIgnorePatterns: ['node_modules'],
testRegex: '\\.spec\\.js$',
transform: {
'^.+\\.[t|j]sx?$': 'babel-jest',
},
transformIgnorePatterns: [`node_modules/(?!(${vendorsToTranspile})/)`],
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-master'],
};