-
Notifications
You must be signed in to change notification settings - Fork 13
/
jest.config.js
35 lines (35 loc) · 1.08 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
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
const { compilerOptions } = require('./tsconfig');
module.exports = {
testEnvironment: 'jsdom',
transform: {
'^.+\\.(js|jsx|ts|tsx)$': [
'<rootDir>/node_modules/babel-jest',
{
presets: ['next/babel'],
plugins: [],
},
],
},
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
],
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: {
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
'^.+\\.(css|sass|scss)$': '<rootDir>/__mocks__/styleMock.js',
'^.+\\.(jpg|jpeg|png|gif|webp|avif|svg)$': `<rootDir>/__mocks__/fileMock.js`,
'next/link': '<rootDir>/__mocks__/nextLink.jsx',
'^@components/(.*)$': '<rootDir>/src/components/$1',
'^@context/(.*)$': '<rootDir>/src/context/$1',
'^@lib/(.*)$': '<rootDir>/src/lib/$1',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/.next/',
'^.+\\.module\\.(css|sass|scss)$',
],
};