-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
24 lines (21 loc) · 965 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
// jest.config.js
const nextJest = require('next/jest');
const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
});
const customJestConfig = {
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
moduleNameMapper: {
'^~(.*)$': '<rootDir>/src/$1',
'swiper/react': '<rootDir>/src/tests/mocks/datum/swiper.tsx',
'swiper': '<rootDir>/src/tests/mocks/datum/swiper.tsx'
},
// transformIgnorePatterns: ['<rootDir>/node_modules/(?!swiper)/', '<rootDir>/node_modules/(?!graphql)/'],
transformIgnorePatterns: ['<rootDir>/node_modules/(?!swiper)/'],
collectCoverageFrom: ['<rootDir>/src/**/*.{js,jsx,ts,tsx}', '<rootDir>/!src/**/*.d.ts'],
setupFilesAfterEnv: ['<rootDir>/src/tests/mocks/setupTests.ts'],
snapshotResolver: './snapshotResolver.js',
};
module.exports = createJestConfig(customJestConfig);