mirror of
https://github.com/immich-app/immich.git
synced 2025-12-26 09:14:58 +03:00
refactor: controller tests (#18100)
This commit is contained in:
@@ -8,16 +8,18 @@ import { automock, ControllerContext, controllerSetup, mockBaseService } from 't
|
||||
|
||||
describe(UserController.name, () => {
|
||||
let ctx: ControllerContext;
|
||||
const service = mockBaseService(UserService);
|
||||
|
||||
beforeAll(async () => {
|
||||
ctx = await controllerSetup(UserController, [
|
||||
{ provide: LoggingRepository, useValue: automock(LoggingRepository, { strict: false }) },
|
||||
{ provide: UserService, useValue: mockBaseService(UserService) },
|
||||
{ provide: UserService, useValue: service },
|
||||
]);
|
||||
return () => ctx.close();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
service.resetAllMocks();
|
||||
ctx.reset();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user