This repository was archived by the owner on Mar 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathjest.config.js
75 lines (73 loc) · 2.65 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
70
71
72
73
74
75
/**
* Copyright 2020 The Magma Authors.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @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')],
setupFilesAfterEnv: ['./jest-setup'],
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/fbcnms-projects/**/app/**/__tests__/*.js',
'<rootDir>/fbcnms-packages/fbcnms-ui/**/__tests__/*.js',
'<rootDir>/fbcnms-packages/fbcnms-alarms/**/__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)'],
},
],
testEnvironment: 'jsdom',
testPathIgnorePatterns: ['/node_modules/'],
};