-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.cjs
29 lines (26 loc) · 1.01 KB
/
jest.config.cjs
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
const nextJest = require('next/jest')
const { pathsToModuleNameMapper } = require('ts-jest')
const { compilerOptions } = require('./tsconfig')
const nextJestConfig = nextJest({ dir: './' })
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/tests/global-mocks.ts'],
moduleFileExtensions: ['js', 'ts', 'tsx', 'json'],
testMatch: ['<rootDir>/tests/specs/**/*.test.{ts,tsx}'],
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' })
},
collectCoverageFrom: ['<rootDir>/components/**/*.{ts,tsx}', '<rootDir>/helpers/**/*.{ts,tsx}', '<rootDir>/app/**/*.{ts,tsx}'],
coverageDirectory: '<rootDir>/tests/coverage',
coverageReporters: ['text-summary', 'lcov', 'html'],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80
}
}
}
module.exports = nextJestConfig(config)