-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
23 lines (20 loc) · 857 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
/** @type {import('ts-jest').JestConfigWithTsJest} **/
export default {
preset: 'ts-jest',
moduleNameMapper: {
// if your using tsconfig.paths thers is no harm in telling jest
'@components/(.*)$': '<rootDir>/src/components/$1',
'@/(.*)$': '<rootDir>/src/$1',
// mocking assests and styling
'^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/tests/mocks/fileMock.ts',
'^.+\\.(css|less|scss|sass)$': '<rootDir>/tests/mocks/styleMock.ts',
/* mock models and services folder */
'(assets|models|services)': '<rootDir>/tests/mocks/fileMock.ts',
},
// to obtain access to the matchers.
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
modulePaths: ['<rootDir>'],
testEnvironment: 'jsdom',
};