fix(backend): update transformIgnorePatterns for ESM modules in pnpm

- Fix uuid and @nestjs/elasticsearch ESM parsing errors

- Use flexible regex pattern: node_modules/(?!.*(uuid|@nestjs\+elasticsearch).*/)

- Supports pnpm's nested .pnpm structure
This commit is contained in:
2026-03-28 13:09:39 +07:00
parent e1773481e2
commit 33274adab0
+6 -2
View File
@@ -47,8 +47,12 @@ module.exports = {
// Global setup after env
setupFilesAfterEnv: ['../test/jest.setup.ts'],
// Transform ignore patterns (ให้ Jest ประมวลผล uuid)
transformIgnorePatterns: ['node_modules/(?!uuid/)'],
// Transform ignore patterns (ให้ Jest ประมวลผล ESM modules)
// รองรับ uuid และ @nestjs/elasticsearch ที่เป็น ESM
// ใช้ .* เพื่อ match path ย่อยใน pnpm structure
transformIgnorePatterns: [
'node_modules/(?!.*(uuid|@nestjs[\\+]elasticsearch).*/)',
],
// Coverage thresholds ตาม Testing Strategy spec
coverageThreshold: {