-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.js
30 lines (29 loc) · 918 Bytes
/
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
const { compilerOptions } = require('./tsconfig');
console.log(compilerOptions.paths);
const { pathsToModuleNameMapper } = require('ts-jest');
/** @type {import('jest').Config} */
module.exports = {
moduleFileExtensions: ['js', 'json', 'ts'],
// collectCoverage: true,
coverageProvider: 'v8',
transform: {
'^.+\\.(js|ts)$': 'ts-jest',
},
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!**/*.stories.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
'!<rootDir>/out/**',
'!<rootDir>/.next/**',
'!<rootDir>/*.config.js',
'!<rootDir>/coverage/**',
],
testEnvironment: 'node',
rootDir: './',
roots: ['<rootDir>/src/', '<rootDir>/tests/'],
testRegex: '(/tests/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
coverageDirectory: './coverage',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
moduleDirectories: ['node_modules', '<rootDir>'],
};