-
Notifications
You must be signed in to change notification settings - Fork 13
/
jest.config.ts
60 lines (57 loc) · 1.75 KB
/
jest.config.ts
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
import type { Config } from '@jest/types';
const projectDefault = {
testEnvironment: 'node',
setupFilesAfterEnv: ['<rootDir>/testHelpers/helpers.ts'],
preset: 'ts-jest/presets/default-esm',
moduleNameMapper: {
'@vonage/cli-core': '<rootDir>/packages/cli-core/lib/index.ts',
'@vonage/cli-ux': '<rootDir>/packages/cli-ux/lib/index.ts',
'@vonage/cli-config': '<rootDir>/packages/cli-config/lib/index.ts',
'@vonage/cli-fs': '<rootDir>/packages/cli-fs/lib/index.ts',
'@vonage/cli-(.+)': '<rootDir>/packages/cli-$1/lib',
},
coveragePathIgnorePatterns: [
'dist',
'node_modules',
'<rootDir>/testHelpers',
],
};
const config: Config.InitialOptions = {
extensionsToTreatAsEsm: ['.ts'],
coverageDirectory: '<rootDir>/coverage/',
coveragePathIgnorePatterns: [
'node_modules',
'<rootDir>/testHelpers',
'<rootDir>/packages/cli/bin',
],
projects: [
{
...projectDefault,
displayName: 'CORE',
testMatch: ['<rootDir>/packages/cli-core/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: [
...projectDefault.coveragePathIgnorePatterns,
'<rootDir>/packages/cli-core/__tests__',
],
},
{
...projectDefault,
displayName: 'CONFIG',
testMatch: ['<rootDir>/packages/cli-config/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: [
...projectDefault.coveragePathIgnorePatterns,
'<rootDir>/packages/cli-config/__tests__',
],
},
{
...projectDefault,
displayName: 'JWT',
testMatch: ['<rootDir>/packages/cli-jwt/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: [
...projectDefault.coveragePathIgnorePatterns,
'<rootDir>/packages/cli-jwt/__tests__',
],
},
],
};
export default config;