tg-bot-builder
Version:
Modular NestJS builder for multi-step Telegram bots with Prisma persistence and pluggable session storage.
37 lines (33 loc) • 1.12 kB
text/typescript
import type { Config } from 'jest';
import { pathsToModuleNameMapper } from 'ts-jest';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { compilerOptions } = require('./tsconfig.json');
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
roots: ['<rootDir>/src', '<rootDir>/test'],
testMatch: ['**/?(*.)+(spec|test).ts'],
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
coverageDirectory: '<rootDir>/coverage',
setupFilesAfterEnv: ['<rootDir>/test/setup/jest.setup.ts'],
passWithNoTests: true,
moduleNameMapper: {
'^@nestjs/(.*)$': '<rootDir>/node_modules/@nestjs/$1',
...pathsToModuleNameMapper(compilerOptions?.paths ?? {}, {
prefix: '<rootDir>/',
}),
},
transform: {
'^.+\\.(t|j)s$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
diagnostics: {
ignoreCodes: [2578],
},
},
],
},
};
export default config;