Browse Source

✅ test(auth): update phone decrypt integration test dependencies

- import Role entity from user-module for complete entity setup
- add Role entity to integration test database setup to prevent test errors
yourname 3 weeks ago
parent
commit
fc2d1dbd0a

+ 2 - 2
packages/auth-module/tests/integration/phone-decrypt.integration.test.ts

@@ -2,7 +2,7 @@ import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
 import { testClient } from 'hono/testing';
 import { authRoutes } from '../../src/routes';
 import { IntegrationTestDatabase, setupIntegrationDatabaseHooksWithEntities } from '@d8d/shared-test-util';
-import { UserEntity } from '@d8d/user-module';
+import { Role, UserEntity } from '@d8d/user-module';
 import { redisUtil } from '@d8d/shared-utils';
 import { File } from '@d8d/file-module';
 
@@ -28,7 +28,7 @@ vi.mock('../../src/services/mini-auth.service', () => ({
 }));
 
 // 设置集成测试钩子
-setupIntegrationDatabaseHooksWithEntities([UserEntity, File])
+setupIntegrationDatabaseHooksWithEntities([UserEntity, File, Role])
 
 describe('手机号解密API集成测试', () => {
   let client: ReturnType<typeof testClient<typeof authRoutes>>;