diff --git a/src/app.controller.spec.ts b/src/app.controller.spec.ts index 366aa5a..3f48269 100644 --- a/src/app.controller.spec.ts +++ b/src/app.controller.spec.ts @@ -1,6 +1,5 @@ import { Test, TestingModule } from "@nestjs/testing"; import { AppController } from "@/app.controller"; -import { AppService } from "@/app.service"; import { SkillsService } from "@/skills/skills.service"; import { ExperiencesService } from "@/experiences/experiences.service"; import { SkillDto } from "@/skills/skills.types"; @@ -12,7 +11,6 @@ import { IntroDto } from "@/intro/intro.types"; describe("AppController", () => { let appController: AppController; - let appService: AppService; let skillsService: SkillsService; let experiencesService: ExperiencesService; let educationService: EducationService; @@ -21,29 +19,16 @@ describe("AppController", () => { beforeEach(async () => { const app: TestingModule = await Test.createTestingModule({ controllers: [AppController], - providers: [AppService, SkillsService, ExperiencesService, EducationService, IntroService], + providers: [SkillsService, ExperiencesService, EducationService, IntroService], }).compile(); appController = app.get(AppController); - appService = app.get(AppService); skillsService = app.get(SkillsService); experiencesService = app.get(ExperiencesService); educationService = app.get(EducationService); introService = app.get(IntroService); }); - describe("root", () => { - it("Should call AppService", () => { - jest.spyOn(appService, "sayHello").mockImplementation(() => "Hello World!"); - appController.sayHello(); - expect(appService.sayHello).toBeCalled(); - }); - - it('should return "Hello World!"', () => { - expect(appController.sayHello()).toBe("Hello World!"); - }); - }); - describe("getSkills", () => { it("Should return an Array of SkillDtos", () => { const result: SkillDto[] = SkillDto.asDto([ diff --git a/src/app.controller.ts b/src/app.controller.ts index 6ce76f9..2a6891d 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -1,6 +1,5 @@ import { Controller, Get } from "@nestjs/common"; -import { AppService } from "@/app.service"; -import { ApiExcludeEndpoint, ApiExtraModels, ApiOkResponse, ApiTags, getSchemaPath } from "@nestjs/swagger"; +import { ApiExtraModels, ApiOkResponse, ApiTags, getSchemaPath } from "@nestjs/swagger"; import { SkillsService } from "@/skills/skills.service"; import { ExperiencesService } from "@/experiences/experiences.service"; import { SkillDto } from "@/skills/skills.types"; @@ -14,19 +13,12 @@ import { IntroService } from "@/intro/intro.service"; @ApiExtraModels(SkillDto, ExperienceDto, EducationDto, IntroDto) export class AppController { constructor( - private readonly appService: AppService, private readonly skillsService: SkillsService, private readonly experiencesService: ExperiencesService, private readonly educationService: EducationService, private readonly introService: IntroService ) {} - @Get() - @ApiExcludeEndpoint() - sayHello(): string { - return this.appService.sayHello(); - } - @Get("skills") @ApiTags("Skills") @ApiOkResponse({ diff --git a/src/app.module.ts b/src/app.module.ts index 3789347..c7a955e 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,6 +1,5 @@ import { Module } from "@nestjs/common"; import { AppController } from "@/app.controller"; -import { AppService } from "@/app.service"; import { SkillsService } from "@/skills/skills.service"; import { ExperiencesService } from "@/experiences/experiences.service"; import { EducationService } from "@/education/education.service"; @@ -9,6 +8,6 @@ import { IntroService } from "@/intro/intro.service"; @Module({ imports: [], controllers: [AppController], - providers: [AppService, SkillsService, ExperiencesService, EducationService, IntroService], + providers: [SkillsService, ExperiencesService, EducationService, IntroService], }) export class AppModule {} diff --git a/src/app.service.ts b/src/app.service.ts deleted file mode 100644 index c60c7bc..0000000 --- a/src/app.service.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Injectable } from "@nestjs/common"; - -@Injectable() -export class AppService { - sayHello(): string { - return "Hello World!"; - } -} diff --git a/test/app.e2e-spec.ts b/test/app.e2e-spec.ts index db59aa7..f6d4734 100644 --- a/test/app.e2e-spec.ts +++ b/test/app.e2e-spec.ts @@ -1,7 +1,7 @@ import { Test, TestingModule } from "@nestjs/testing"; import { INestApplication } from "@nestjs/common"; import * as request from "supertest"; -import { AppModule } from "./../src/app.module"; +import { AppModule } from "@/app.module"; describe("AppController (e2e)", () => { let app: INestApplication; @@ -15,7 +15,4 @@ describe("AppController (e2e)", () => { await app.init(); }); - it("/ (GET)", () => { - return request(app.getHttpServer()).get("/").expect(200).expect("Hello World!"); - }); });