-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
38 lines (35 loc) · 934 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
33
34
35
36
37
38
import nextJest from "next/jest";
import type { Config } from 'jest'
const createJestConfig = nextJest({
dir: "./",
});
const config: Config = {
preset: "ts-jest",
testEnvironment: "jest-environment-jsdom",
transform: {
"^.+\\.(js|jsx|ts|tsx)$": "ts-jest",
},
moduleDirectories: ["node_modules", "<rootDir>/"],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json'
},
fetch: global.fetch //added this to be able to mock 'fetch' in tests
},
collectCoverage: true,
coverageThreshold: {
global: {
branches: 70,
functions: 70,
lines: 80,
statements: 80,
}
},
coverageDirectory: "coverage",
coverageProvider: 'v8',
}
module.exports = createJestConfig(config);