forked from MileTwo/nextjs-ts-prisma-auto-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
25 lines (23 loc) · 885 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
import type { Config } from '@jest/types';
// Sync object
const config: Config.InitialOptions = {
collectCoverage: true,
setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/'],
transform: {
'\\.m?jsx?$': 'jest-esm-transformer',
'^.+\\.(js|jsx|ts|tsx)$': ['<rootDir>/node_modules/babel-jest', { configFile: './test.babelrc' }],
},
testEnvironment: 'jsdom',
moduleNameMapper: {
'^components/(.*)$': '<rootDir>/components/$1',
'^lib/(.*)$': '<rootDir>/lib/$1',
'^pages/(.*)$': '<rootDir>/pages/$1',
'^services/(.*)$': '<rootDir>/services/$1',
'^tests/(.*)': '<rootDir>/tests/$1',
'^types/(.*)$': '<rootDir>/types/$1',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
verbose: true,
};
export default config;