-
Notifications
You must be signed in to change notification settings - Fork 9
/
jest.config.js
42 lines (42 loc) · 1.47 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
moduleDirectories: ['node_modules', './tests'],
modulePathIgnorePatterns: ['<rootDir>/dist/', '.history'],
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
'\\.(less|css)$': 'jest-less-loader',
'^.+\\.(js|jsx)$': [
'babel-jest',
{
presets: ['@babel/preset-env'],
plugins: [['@babel/transform-runtime']],
},
],
},
collectCoverage: true,
coveragePathIgnorePatterns: ['<rootDir>/scripts/', 'tests/'],
coverageDirectory: './.ci/',
moduleNameMapper: {
'^@bifrostui/(styles.*)$': '<rootDir>/tests/mocks/styleMock.js',
'^@bifrostui/react$': '<rootDir>/packages/bui-core/src',
'^@bifrostui/([icons|utils|types].*)$': '<rootDir>/packages/bui-$1/src',
'^testing$': '<rootDir>/tests',
'\\.(css|less|scss)$': '<rootDir>/tests/mocks/styleMock.js',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/tests/mocks/fileTransformer.js',
'swiper/react/swiper-react':
'<rootDir>/node_modules/swiper/react/swiper-react',
},
setupFilesAfterEnv: ['@testing-library/jest-dom'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
transformIgnorePatterns: [
'<rootDir>/node_modules/(?!(swiper|ssr-window|dom7|dayjs)(/|$)|(.pnpm/[^/]+/node_modules/\\1))',
],
};