-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
41 lines (39 loc) · 1.38 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
const fs = require('fs')
module.exports = {
projects: [
fs.readdirSync('./packages').map(name => {
return {
name,
displayName: name,
preset: 'ts-jest',
setupFiles: ['<rootDir>/scripts/jestSetUp'],
moduleNameMapper: {
'^@teamwork/autocomplete-([-\\w]+)$':
'<rootDir>/packages/$1/src',
},
testMatch: [`<rootDir>/packages/${name}/src/**/*.test.ts`],
// This is necessary to transpile JS files containing ES modules.
transformIgnorePatterns: ['<rootDir>/node_modules/(?!@syncot)'],
transform: {
'\\.(ts|js)x?$': 'ts-jest',
},
globals: {
'ts-jest': {
tsConfig: {
...require(`./packages/${name}/tsconfig.json`)
.compilerOptions,
allowJs: true,
},
},
},
}
}),
],
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/packages/*/src/**/*.{ts,tsx,js,jsx}',
'!<rootDir>/packages/*/src/**/*.test.{ts,tsx,js,jsx}',
'!<rootDir>/**/*.d.{ts,tsx,js,jsx}',
'!<rootDir>/node_modules/',
],
}