Skip to content

Commit

Permalink
MAT-6726 Removed some redundant code and completed test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-akins committed Feb 29, 2024
1 parent c339884 commit e7c1748
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 164 deletions.
4 changes: 1 addition & 3 deletions src/app.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { AppController } from './app.controller';
import {Request as ExpressRequest, Response} from 'express';

import { AppService } from './app.service';
import { UsersService } from './users/users.service';
import { JwtService } from '@nestjs/jwt';
import { AuthService } from './auth/auth.service';


describe('AppController', () => {
Expand All @@ -15,7 +13,7 @@ describe('AppController', () => {

const app: TestingModule = await Test.createTestingModule({
controllers: [AppController],
providers: [AppService, AuthService, UsersService, JwtService],
providers: [AppService, JwtService],
}).compile();

appController = app.get<AppController>(AppController);
Expand Down
4 changes: 2 additions & 2 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AuthModule } from './auth/auth.module';
import { UsersModule } from './users/users.module';


@Module({
imports: [AuthModule, UsersModule],
imports: [AuthModule],
controllers: [AppController],
providers: [AppService],
})
Expand Down
22 changes: 0 additions & 22 deletions src/auth/auth.controller.spec.ts

This file was deleted.

31 changes: 0 additions & 31 deletions src/auth/auth.controller.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/auth/auth.guard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AuthGuard } from './auth.guard';
import { UsersService } from '../users/users.service';
import { JwtService } from '@nestjs/jwt';
import { createMock } from '@golevelup/ts-jest';
import { ExecutionContext, UnauthorizedException } from '@nestjs/common';
Expand All @@ -10,7 +9,7 @@ describe('AuthGuard', () => {

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [UsersService, JwtService],
providers: [JwtService],
}).compile();

guard = new AuthGuard(new JwtService());
Expand Down
8 changes: 1 addition & 7 deletions src/auth/auth.module.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@

import { Module } from '@nestjs/common';
import { AuthService } from './auth.service';
import { UsersModule } from '../users/users.module';
import { JwtModule } from '@nestjs/jwt';
import { AuthController } from './auth.controller';
import { jwtConstants } from './constants';

@Module({
imports: [
UsersModule,
JwtModule.register({
global: true,
secret: jwtConstants.secret,
signOptions: { expiresIn: '60s' },
}),
],
providers: [AuthService],
controllers: [AuthController],
exports: [AuthService],

})
export class AuthModule {}
20 changes: 0 additions & 20 deletions src/auth/auth.service.spec.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/auth/auth.service.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/users/users.module.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/users/users.service.spec.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/users/users.service.ts

This file was deleted.

0 comments on commit e7c1748

Please sign in to comment.