-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
47 lines (35 loc) · 1.08 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
const fs = require('fs');
const path = require('path');
const corePackages = fs
.readdirSync(path.resolve(__dirname, './packages/@averjs'), {
withFileTypes: true
})
.filter((p) => p.isDirectory())
.map((p) => p.name);
/** @​typedef {import('ts-jest/dist/types')} */
module.exports = {
preset: 'jest-puppeteer',
clearMocks: true,
expand: true,
forceExit: true,
coverageDirectory: './coverage/',
collectCoverage: true,
collectCoverageFrom: [
'**/packages/@averjs/*/lib/**/*.ts',
'!**/packages/@averjs/**/*.d.ts'
],
coveragePathIgnorePatterns: ['__fixtures__', 'dist'],
setupFilesAfterEnv: ['./__tests__/utils/setup'],
watchPathIgnorePatterns: ['dist', 'node_modules'],
moduleFileExtensions: ['js', 'json', 'ts', 'node', 'vue'],
transform: {
'^.+\\.js?$': 'babel-jest',
'^.+\\.ts?$': 'ts-jest'
},
testMatch: ['**/__tests__/**/*.spec.ts'],
transformIgnorePatterns: ['node_modules/(?!(@averjs|averjs))'],
moduleNameMapper: {
[`@averjs/(${corePackages.join('|')})$`]:
'<rootDir>/packages/@averjs/$1/lib/index'
}
};