-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
40 lines (39 loc) · 1.25 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
36
37
38
39
40
require('dotenv').config()
module.exports = {
roots: ['<rootDir>'],
setupFiles: ['./jest.setup.js', 'jest-canvas-mock'],
moduleFileExtensions: ['js', 'ts', 'tsx', 'json'],
testPathIgnorePatterns: ['<rootDir>[/\\\\](node_modules|.next)[/\\\\]'],
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(ts|tsx)$'],
transform: {
'^.+\\.(ts|tsx)$': 'babel-jest',
},
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
moduleNameMapper: {
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/test/__mocks__/fileMock.js',
'@/lib/(.*)': '<rootDir>/lib/$1',
'@/components/(.*)': '<rootDir>/components/$1',
'@/pages/(.*)': '<rootDir>/pages/$1',
'graphql/(.*)': '<rootDir>/graphql/$1',
'@/utils/(.*)': '<rootDir>/utils/$1',
'hooks/(.*)': '<rootDir>/hooks/$1',
'lotties/(.*)': '<rootDir>/lotties/$1',
},
testEnvironment: 'jest-environment-jsdom',
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
collectCoverageFrom: [
'<rootDir>/pages/**/*.+(js|ts|tsx)',
'<rootDir>/components/**/*.+(js|ts|tsx)',
],
coverageThreshold: {
global: {
statements: 80,
functions: 80,
lines: 80,
},
},
}