fix: 修复后端 CI 检查与测试

This commit is contained in:
2026-07-22 11:17:39 +08:00
parent 257c39db90
commit da023759a1
6 changed files with 56 additions and 13 deletions

View File

@@ -197,7 +197,7 @@ describe('DatabaseMigrationsService — course attendance schema', () => {
],
getTable: { name: 'attendance_records', columns: [{ name: 'id' }] },
});
await bootstrapCourseAttendance(runner);
const service = await bootstrapCourseAttendance(runner);
await service.ensureCourseAttendanceSchema();
@@ -223,7 +223,7 @@ describe('DatabaseMigrationsService — course attendance schema', () => {
? { name, columns: [{ name: 'id' }] }
: { name, columns: [{ name: 'id' }, { name: 'schedule_id' }, { name: 'attendance_session_id' }] },
);
await bootstrapCourseAttendance(runner);
const service = await bootstrapCourseAttendance(runner);
await service.ensureCourseAttendanceSchema();
@@ -237,7 +237,7 @@ describe('DatabaseMigrationsService — course attendance schema', () => {
getTables: [{ name: 'attendance_records', columns: [{ name: 'id' }] }],
getTable: { name: 'attendance_records', columns: [{ name: 'id' }] },
});
await bootstrapCourseAttendance(runner);
const service = await bootstrapCourseAttendance(runner);
await service.ensureCourseAttendanceSchema();
const createSql: string = (runner.query as jest.Mock).mock.calls
@@ -497,5 +497,5 @@ async function bootstrapCourseAttendance(runner: MockRunner) {
{ provide: getDataSourceToken(), useValue: dataSource },
],
}).compile();
service = module.get(DatabaseMigrationsService);
return module.get<MigrationsPrivate & DatabaseMigrationsService>(DatabaseMigrationsService);
}