|
1 | | -const { pathsToModuleNameMapper } = require('ts-jest'); |
2 | | -//const { compilerOptions } = require('./tsconfig.json'); |
| 1 | +import { pathsToModuleNameMapper } from 'ts-jest'; |
| 2 | + |
3 | 3 | const tsConfigPaths = { |
4 | | - '@/*': ['src/*'], |
5 | | - '@tests/*': ['tests/*'], |
| 4 | + '@/*': [ 'src/*' ], |
| 5 | + '@tests/*': [ 'tests/*' ], |
6 | 6 | }; |
7 | 7 |
|
8 | 8 | /** @type {import('@jest/types').Config.InitialOptions } */ |
9 | | -module.exports = { |
| 9 | +export default { |
10 | 10 | preset: 'ts-jest/presets/js-with-ts', |
11 | 11 | testEnvironment: 'node', |
12 | 12 | transform: { '^.+\\.tsx?$': 'ts-jest' }, |
13 | 13 | testRegex: '(/__test__/.*|/tests/.*|(\\.|/)(test|spec))\\.[tj]sx?$', |
14 | | - testPathIgnorePatterns: ['/node_modules/', '/dist/'], |
15 | | - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], |
| 14 | + testPathIgnorePatterns: [ '/node_modules/', '/dist/' ], |
| 15 | + moduleFileExtensions: [ 'ts', 'tsx', 'js', 'jsx', 'json' ], |
16 | 16 | moduleNameMapper: pathsToModuleNameMapper(tsConfigPaths, { prefix: `${__dirname}/` }), |
17 | 17 |
|
18 | 18 | coverageDirectory: './coverage', |
19 | | - coverageReporters: ['html', 'text'], |
20 | | - collectCoverageFrom: ['src/**/*.{ts,js}', '!**/node_modules/**', '!**/vendor/**', '!**/dist/**', '!**/tests/**'], |
| 19 | + coverageReporters: [ 'html', 'text' ], |
| 20 | + collectCoverageFrom: [ 'src/**/*.{ts,js}', '!**/node_modules/**', '!**/vendor/**', '!**/dist/**', '!**/tests/**' ], |
21 | 21 | }; |
0 commit comments