-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
23 lines (23 loc) · 906 Bytes
/
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
export default {
preset: 'ts-jest',
testEnvironment: 'jsdom',
moduleNameMapper: {
'^three/examples/jsm/controls/OrbitControls$': '<rootDir>/src/__mocks__/OrbitControlsMock.ts',
'^three/examples/jsm/controls/MapControls$': '<rootDir>/src/__mocks__/MapControlsMock.ts',
'^three/examples/jsm/loaders/GLTFLoader$': '<rootDir>/src/__mocks__/GLTFLoaderMock.ts',
'^three$': '<rootDir>/node_modules/three',
},
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', {
useESM: true,
}],
},
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
coverageDirectory: 'coverage',
coverageReporters: ['json', 'lcov', 'clover'],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts']
};