mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Add PublicAPIModule
This adds all controllers needed in the public API (at least as currently specified) and implements some routes under `/me` Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
eeeacb8c67
commit
348cd3ffe1
9 changed files with 164 additions and 0 deletions
26
src/api/public/me/me.controller.spec.ts
Normal file
26
src/api/public/me/me.controller.spec.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { getRepositoryToken } from '@nestjs/typeorm';
|
||||
import { HistoryModule } from '../../../history/history.module';
|
||||
import { User } from '../../../users/user.entity';
|
||||
import { UsersModule } from '../../../users/users.module';
|
||||
import { MeController } from './me.controller';
|
||||
|
||||
describe('Me Controller', () => {
|
||||
let controller: MeController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [MeController],
|
||||
imports: [UsersModule, HistoryModule],
|
||||
})
|
||||
.overrideProvider(getRepositoryToken(User))
|
||||
.useValue({})
|
||||
.compile();
|
||||
|
||||
controller = module.get<MeController>(MeController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue