/* eslint-disable @typescript-eslint/no-var-requires */ const { pathsToModuleNameMapper } = require('ts-jest/utils') // In the following statement, replace `./tsconfig` with the path to your `tsconfig` file // which contains the path mapping (ie the `compilerOptions.paths` option): const { compilerOptions } = require('./tsconfig.json') const { cd, $, chalk } = require('zx') module.exports = { moduleFileExtensions: ['js', 'json', 'ts'], rootDir: '.', testRegex: '.*\\.spec\\.ts$', transform: { '^.+\\.(t|j)s$': 'ts-jest', }, collectCoverageFrom: ['**/*.(t|j)s'], coverageDirectory: '../coverage', testEnvironment: 'node', globals: { isDev: process.env.NODE_ENV === 'development', $, chalk, cd, }, moduleNameMapper: { ...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '/' }), '^src/(.*)$': '/src/$1', '^test/(.*)$': '/test/$1', '^src$': '/src', '^~/(.*)$': '/src/$1', '^~$': '/src', '^test$': '/test', }, }