forked from wangziqi/gongxue-base
test: update attendance service mocks
This commit is contained in:
@@ -21,6 +21,7 @@ const createService = () => {
|
||||
create: jest.fn((value: Record<string, unknown>) => ({ id: 90, ...value })),
|
||||
save: jest.fn(async (value: unknown) => value),
|
||||
};
|
||||
const attendanceDeviceRepo = { find: jest.fn().mockResolvedValue([]) };
|
||||
const dataSource = {
|
||||
transaction: jest.fn(
|
||||
async (cb: (manager: { getRepository: jest.Mock }) => Promise<unknown>) => {
|
||||
@@ -43,9 +44,10 @@ const createService = () => {
|
||||
{} as never,
|
||||
{} as never,
|
||||
sessionRepo as never,
|
||||
attendanceDeviceRepo as never,
|
||||
dataSource as unknown as DataSource,
|
||||
);
|
||||
return { service, attendanceRepo, dingRawRepo, scheduleRepo, classStudentRepo, sessionRepo, dataSource };
|
||||
return { service, attendanceRepo, dingRawRepo, scheduleRepo, classStudentRepo, sessionRepo, attendanceDeviceRepo, dataSource };
|
||||
};
|
||||
|
||||
const endedSchedule = {
|
||||
|
||||
Reference in New Issue
Block a user