mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor: controller tests (#18100)
This commit is contained in:
parent
df2cf5d106
commit
f34f83e164
15 changed files with 183 additions and 101 deletions
|
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue