forked from Women-Coding-Community/wcc-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
32 lines (28 loc) · 847 Bytes
/
jest.config.ts
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
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
import type { Config } from 'jest';
import nextJest from 'next/jest.js';
const createJestConfig = nextJest({
dir: './',
});
const config: Config = {
clearMocks: true,
collectCoverage: true,
coverageDirectory: 'coverage',
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testPathIgnorePatterns: ['/node_modules/', '/.next/'],
coverageProvider: 'v8',
preset: 'ts-jest',
testEnvironment: 'jsdom',
moduleNameMapper: {
'^@/components/(.*)$': '<rootDir>/components/$1',
'^@next/router': 'next-router-mock',
},
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': 'ts-jest',
},
};
export default createJestConfig(config);