-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.ts
45 lines (42 loc) · 1.37 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
import type {Config} from 'jest';
const common = {
modulePathIgnorePatterns: ['/npm'],
};
const config: Config = {
collectCoverageFrom: ['<rootDir>/packages/**/*.{ts,tsx}'],
coveragePathIgnorePatterns: ['node_modules', 'dist', '__tests__'],
coverageReporters: ['lcov', ['text', {skipFull: true}]],
projects: [
{
...common,
displayName: 'unit',
globals: {
IS_REACT_ACT_ENVIRONMENT: true,
},
moduleNameMapper: {
'^./dist/(.+)': './src/$1',
'^@webext-pegasus/rpc$': '<rootDir>/packages/rpc/index.ts',
'^@webext-pegasus/store$': '<rootDir>/packages/store/index.ts',
'^@webext-pegasus/store-zustand$':
'<rootDir>/packages/store-zustand/index.ts',
'^@webext-pegasus/transport$': '<rootDir>/packages/transport/index.ts',
'^@webext-pegasus/transport/(.+)$': '<rootDir>/packages/transport/$1',
},
modulePathIgnorePatterns: ['<rootDir>/packages/example-extension/'],
preset: 'ts-jest',
setupFilesAfterEnv: ['<rootDir>/test-utils/testPegasus.ts'],
testEnvironment: 'jsdom',
testMatch: ['**/__tests__/unit/**/*.test{.ts,.tsx,.js,.jsx}'],
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.tsx$': [
'ts-jest',
{
tsconfig: 'tsconfig.test.json',
},
],
},
},
],
};
export default config;