feat: Add unit tests for backend validators and configure Jest.

This commit is contained in:
JakkrapartXD 2026-03-04 10:58:37 +07:00
parent ebcae0b3e7
commit 9bb941b45e
16 changed files with 2071 additions and 381 deletions

22
Backend/jest.config.js Normal file
View file

@ -0,0 +1,22 @@
/** @type {import('jest').Config} */
const config = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/tests'],
testMatch: ['**/*.test.ts'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
clearMocks: true,
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/generated/**',
'!src/server.ts'
],
transform: {
'^.+\\.tsx?$': ['ts-jest', { tsconfig: './tsconfig.test.json' }]
}
};
module.exports = config;