-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.mjs
36 lines (31 loc) · 996 Bytes
/
jest.config.mjs
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
/* eslint-disable @typescript-eslint/no-var-requires */
// import compilerOptions from "./tsconfig.json" assert {type: "json"};
// const { pathsToModuleNameMapper } = require('ts-jest');
// const { compilerOptions } = require('./tsconfig.json');
import nextJest from 'next/jest.js';
const createJestConfig = nextJest({
dir: './',
});
const config = {
...createJestConfig({
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironment: 'jest-environment-jsdom',
}),
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: '.',
testRegex: '.*\\.spec\\.ts$',
transform: {
'^.+\\.(t|j)s$': 'ts-jest',
},
collectCoverageFrom: ['src/**/*.(t|j)s'],
coverageDirectory: '../coverage',
testEnvironment: 'node',
pathsToModuleNameMapper: {
'^@/src/(.*)$': '<rootDir>/src/$1',
},
// moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
// prefix: '<rootDir>',
// }),
};
export default createJestConfig(config);
// module.exports = config;