forked from VikeLabs/courseup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
30 lines (29 loc) · 890 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
24
25
26
27
28
29
30
const baseTsConfig = require('./tsconfig.json');
// Sync object
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
verbose: true,
preset: 'ts-jest',
globals: {
'ts-jest': {
tsconfig: {
...baseTsConfig.compilerOptions,
jsx: 'react-jsx',
},
},
},
testEnvironment: 'jsdom',
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testPathIgnorePatterns: ['/node_modules', 'functions'],
testRegex: 'src/.*(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
modulePaths: ['<rootDir>/src/'],
moduleNameMapper: {
'^.+\\.(css|scss)$': '<rootDir>/src/lib/utils/jest/__mocks__/styleMock.js',
'^swiper.*$': '<rootDir>/src/lib/utils/jest/__mocks__/moduleMock.js',
},
};
module.exports = config;