-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
97 lines (96 loc) · 2.75 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/** @type {import('ts-jest').JestConfigWithTsJest} */
// TODO pass pkg name through process.env
module.exports = {
preset: 'ts-jest',
rootDir: './',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
"^.+\\.(js|jsx)$": "babel-jest",
},
testPathIgnorePatterns: ['<rootDir>/node_modules'],
coverageDirectory: '<rootDir>/coverage',
collectCoverageFrom: [
'<rootDir>/packages/**/src/**/*.test.(js|ts)',
'!<rootDir>/packages/**/src/**/constant.(js|ts)',
'!<rootDir>/packages/**/src/**/index.(js|ts)',
],
projects: [
{
displayName: 'template-package',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
"^.+\\.(js|jsx)$": "babel-jest",
},
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/packages/template-package/**/*.test.(js|ts)',
'<rootDir>/packages/template-package/**/test/*.test.(js|ts)',
],
moduleNameMapper: {
'@js-rocks/lodash-tiny': '<rootDir>/packages/lodash-tiny/src'
},
},
{
displayName: 'vue-tiny',
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
"^.+\\.(js|jsx)$": "babel-jest",
},
testMatch: [
'<rootDir>/packages/vue-tiny/**/*.test.(js|ts)',
'<rootDir>/packages/vue-tiny/**/test/*.test.(js|ts)',
],
moduleNameMapper: {
'@js-rocks/lodash-tiny': '<rootDir>/packages/lodash-tiny/src'
},
},
{
displayName: 'react-tiny',
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
"^.+\\.(js|jsx)$": "babel-jest",
},
testMatch: [
'<rootDir>/packages/react-tiny/**/*.test.(js|ts)',
'<rootDir>/packages/react-tiny/**/test/*.test.(js|ts)',
],
moduleNameMapper: {
'@js-rocks/lodash-tiny': '<rootDir>/packages/lodash-tiny/src'
},
},
{
displayName: 'lodash-tiny',
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/packages/lodash-tiny/**/*.test.(js|ts)',
'<rootDir>/packages/lodash-tiny/**/test/*.test.(js|ts)',
]
},
{
displayName: 'promise-tiny',
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/packages/promise-tiny/**/*.test.(js|ts)',
'<rootDir>/packages/promise-tiny/**/test/*.test.(js|ts)',
]
},
{
displayName: 'babel-tiny',
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/packages/babel-tiny/**/*.test.(js|ts)',
'<rootDir>/packages/babel-tiny/**/test/*.test.(js|ts)',
]
},
{
displayName: 'jsx-parser-tiny',
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/packages/jsx-parser-tiny/**/*.test.(js|ts)',
'<rootDir>/packages/jsx-parser-tiny/**/test/*.test.(js|ts)',
]
}
]
};