auth débuts

This commit is contained in:
batche
2022-10-28 15:19:26 +02:00
parent ed7e6a066b
commit 2619eb42e1
30 changed files with 207 additions and 6 deletions

View File

@@ -5,8 +5,7 @@ import { UsersModule } from './users/users.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ConfigModule } from '@nestjs/config';
import { FriendshipsModule } from './friendship/friendships.module';
import { RouterModule } from '@nestjs/core';
import { routesForUsers } from './routes/routes';
import { AuthenticationController } from './auth/authentication.controller';
@Module({
imports: [UsersModule,
@@ -26,7 +25,7 @@ import { routesForUsers } from './routes/routes';
synchronize: true,
}),
],
controllers: [AppController],
controllers: [AppController, AuthenticationController],
providers: [AppService],
})
export class AppModule {}

View File

@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AuthenticationController } from './authentication.controller';
describe('AuthenticationController', () => {
let controller: AuthenticationController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [AuthenticationController],
}).compile();
controller = module.get<AuthenticationController>(AuthenticationController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});

View File

@@ -0,0 +1,7 @@
import { Controller } from '@nestjs/common';
@Controller('/')
export class AuthenticationController {
}

View File

@@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { UsersModule } from 'src/users/users.module';
import { AuthenticationService } from './authentication.service';
@Module({
imports: [UsersModule],
providers: [AuthenticationService],
})
export class AuthenticationModule {}

View File

@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AuthenticationService } from './authentication.service';
describe('AuthenticationService', () => {
let service: AuthenticationService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [AuthenticationService],
}).compile();
service = module.get<AuthenticationService>(AuthenticationService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

View File

@@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class AuthenticationService {}