generated from permafrost-dev/typescript-project-skeleton-esbuild-jest
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
25 lines (20 loc) · 992 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
const { pathsToModuleNameMapper } = require('ts-jest');
//const { compilerOptions } = require('./tsconfig.json');
const tsConfigPaths = {
'@/*': ['src/*'],
'@tests/*': ['tests/*'],
};
/** @type {import('@jest/types').Config.InitialOptions } */
module.exports = {
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'node',
transform: { '^.+\\.tsx?$': 'ts-jest' },
transformIgnorePatterns: ['node_modules/(?!(nanoid)/)'],
testRegex: '(/__test__/.*|/tests/.*|(\\.|/)(test|spec))\\.[tj]sx?$',
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/tests/fakes/', '/tests/fixtures/'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
moduleNameMapper: pathsToModuleNameMapper(tsConfigPaths, { prefix: `${__dirname}/` }),
coverageDirectory: './coverage',
coverageReporters: ['html', 'text'],
collectCoverageFrom: ['src/**/*.{ts,js}', '!src/types/**/*', '!**/node_modules/**', '!**/vendor/**', '!**/dist/**', '!**/tests/**'],
};