forked from Simicart/pagebuilder-module-pwa-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
44 lines (43 loc) · 1.3 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
const jestConfig = {
transform: {
// Reproduce the Webpack `graphql-tag/loader` that lets Venia
// import `.graphql` files into JS.
'\\.(gql|graphql)$': 'jest-transform-graphql',
// Use the default babel-jest for everything else.
'\\.(jsx?|css)$': 'babel-jest'
},
transformIgnorePatterns: [
'!node_modules/react-runtime',
'/node_modules/(?!@magento).+\\.js$'
],
moduleNameMapper: {
'\\.(jpg|jpeg|png)$': '@magento/venia-ui/__mocks__/fileMock.js',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy'
},
// Include files with zero tests in overall coverage analysis by specifying
// coverage paths manually.
collectCoverage: true,
collectCoverageFrom: [
// Code directories
'src/**/*.js',
// Not the create-pwa package, which requires manual testing
'!packages/create-pwa/**/*.js',
// Not node_modules
'!**/node_modules/**',
// Not __tests__, __helpers__, or __any_double_underscore_folders__
'!**/TestHelpers/**',
'!**/__[[:alpha:]]*__/**',
'!**/.*/__[[:alpha:]]*__/**',
// Not this file itself
'!jest.config.js'
],
// Don't look for test files in these directories.
testPathIgnorePatterns: [
'dist',
'node_modules',
'__fixtures__',
'__helpers__',
'__snapshots__'
]
};
module.exports = jestConfig;