-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathjest.config.js
37 lines (36 loc) · 1.13 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
const config = {
verbose: true,
collectCoverage: true,
collectCoverageFrom: [
'src/components/**/*.{js,jsx}',
'src/mixins/**/*.{js,jsx}',
'src/utils/**/*.{js,jsx}',
'!src/components/**/examples/**/*.{js,jsx}', // not component examples
'!src/components/icon/{comps,build}/**/*.{js,jsx}', // not icon components
'!**/*.backstop.js', // not backstop files
'!**/node_modules/**', // not node_modules
],
coverageDirectory: 'coverage',
moduleFileExtensions: [
'js',
'json',
'jsx',
],
moduleNameMapper: {
'distdir(.*)$': '<rootDir>/dist/$1',
'componentdir(.*)$': '<rootDir>/src/components/$1',
},
modulePathIgnorePatterns: [
'rollup.config.test.js',
'<rootDir>/test/e2e/',
'<rootDir>/templates/__tests__',
],
transform: {
'^.+\\.(js|jsx)?$': 'babel-jest',
'.+\\.(css|styl|less|sass|scss)$': '<rootDir>/node_modules/jest-css-modules-transform',
},
transformIgnorePatterns: [
'<rootDir>/node_modules/(?!(lodash-es|@rei\/cdr-tokens)/.*)', // https://stackoverflow.com/questions/42260218/jest-setup-syntaxerror-unexpected-token-export
],
};
module.exports = config;