forked from magma/fbc-js-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
69 lines (67 loc) · 2.4 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
module.exports = {
collectCoverageFrom: [
'**/fbcnms-projects/**/*.js',
'**/fbcnms-packages/**/*.js',
'!**/__mocks__/**',
'!**/__tests__/**',
'!**/fbcnms-packages/fbcnms-ui/stories/**',
'!**/thrift/gen-nodejs/**',
'!**/node_modules/**',
'!**/fbcnms-packages/fbcnms-test/**',
],
coverageReporters: ['json', 'html'],
modulePathIgnorePatterns: [],
projects: [
{
name: 'server',
testEnvironment: 'node',
testMatch: [
'<rootDir>/__tests__/*.js',
'<rootDir>/fbcnms-projects/**/server/**/__tests__/*.js',
'<rootDir>/fbcnms-packages/fbcnms-auth/**/__tests__/*.js',
'<rootDir>/fbcnms-packages/fbcnms-express-middleware/**/__tests__/*.js',
'<rootDir>/fbcnms-packages/fbcnms-platform-server/**/__tests__/*.js',
// run app/server shared tests in both node and jsdom environments
'<rootDir>/fbcnms-packages/fbcnms-util/**/__tests__/*.js',
'<rootDir>/fbcnms-projects/**/shared/**/__tests__/*.js',
],
transform: {
'^.+\\.js$': 'babel-jest',
},
transformIgnorePatterns: ['/node_modules/(?!@fbcnms)'],
},
{
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|less)$': 'identity-obj-proxy',
},
name: 'app',
setupFiles: [require.resolve('@fbcnms/babel-register/polyfill')],
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/fbcnms-projects/**/app/**/__tests__/*.js',
'<rootDir>/fbcnms-packages/fbcnms-ui/**/__tests__/*.js',
'<rootDir>/fbcnms-packages/fbcnms-alarms/(components|hooks)/__tests__/*.js',
// run app/server shared tests in both node and jsdom environments
'<rootDir>/fbcnms-packages/fbcnms-util/**/__tests__/*.js',
'<rootDir>/fbcnms-packages/fbcnms-mobileapp/**/__tests__/*.js',
'<rootDir>/fbcnms-projects/**/shared/**/__tests__/*.js',
],
transform: {
'^.+\\.js$': 'babel-jest',
},
transformIgnorePatterns: ['/node_modules/(?!@fbcnms)'],
},
],
testEnvironment: 'jsdom',
testPathIgnorePatterns: ['/node_modules/'],
};