-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
50 lines (49 loc) · 1.3 KB
/
jest.config.js
File metadata and controls
50 lines (49 loc) · 1.3 KB
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
43
44
45
46
47
48
49
50
/** @type {import('jest').Config} */
const config = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@components/(.*)$': '<rootDir>/src/components/$1',
'^@styles/(.*)$': '<rootDir>/src/styles/$1',
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
'^@hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^@lib/(.*)$': '<rootDir>/src/lib/$1',
'^@contracts/(.*)$': '<rootDir>/contracts/$1',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
testMatch: [
'**/__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(spec|test).[jt]s?(x)',
],
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.d.ts',
'!src/**/*.stories.{js,jsx,ts,tsx}',
'!src/**/__tests__/**',
],
coveragePathIgnorePatterns: [
'/node_modules/',
'/.next/',
'/coverage/',
'/dist/',
],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['@swc/jest', {
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
},
transform: {
react: {
runtime: 'automatic',
},
},
},
}],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
testPathIgnorePatterns: ['/node_modules/', '/.next/', '/test/'],
};
module.exports = config;