mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 16:14:43 -04:00

adds auth service adds auth module adds token-auth strategy adds token-auth to all public api calls Signed-off-by: Philip Molares <philip.molares@udo.edu>
31 lines
812 B
TypeScript
31 lines
812 B
TypeScript
import { Test, TestingModule } from '@nestjs/testing';
|
|
import { AuthService } from './auth.service';
|
|
import { UsersModule } from '../users/users.module';
|
|
import { getRepositoryToken } from '@nestjs/typeorm';
|
|
import { User } from '../users/user.entity';
|
|
|
|
describe('AuthService', () => {
|
|
let service: AuthService;
|
|
|
|
beforeEach(async () => {
|
|
const module: TestingModule = await Test.createTestingModule({
|
|
providers: [
|
|
AuthService,
|
|
{
|
|
provide: getRepositoryToken(User),
|
|
useValue: {},
|
|
},
|
|
],
|
|
imports: [UsersModule],
|
|
})
|
|
.overrideProvider(getRepositoryToken(User))
|
|
.useValue({})
|
|
.compile();
|
|
|
|
service = module.get<AuthService>(AuthService);
|
|
});
|
|
|
|
it('should be defined', () => {
|
|
expect(service).toBeDefined();
|
|
});
|
|
});
|