분류 전체보기

    [초기설정] 테스트가 끝난 후 데이터베이스 내용 drop하기

    [초기설정] 테스트가 끝난 후 데이터베이스 내용 drop하기

    참고TypeORM 0.3.0 부터 Connection이 deprecated되고 DataSource 써야한다. test/user.e2e-spec.tsimport { INestApplication } from "@nestjs/common";import { Test, TestingModule } from "@nestjs/testing";import { DataSource, getConnection } from "typeorm";import { AppModule } from "../src/app.module";describe("UserModule (e2e)", () => { let app: INestApplication; let dataSource: DataSource; beforeAll(async () ..

    [초기설정] E2E 설정 구성, 경로 변경하기

    [초기설정] E2E 설정 구성, 경로 변경하기

    예제 : User 모듈의 end-to-end test/user.e2e-spec.tsimport { Test, TestingModule } from "@nestjs/testing";import { INestApplication } from "@nestjs/common";import * as request from "supertest";import { AppModule } from "../src/app.module";describe("UserModule (e2e)", () => { let app: INestApplication; beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ // ..

    [초기설정] E2E 테스트를 설정하는 예제 코드 설명

    [초기설정] E2E 테스트를 설정하는 예제 코드 설명

    유저 E2E 파일 예시test/user.e2e-spec.tsimport { Test, TestingModule } from "@nestjs/testing";import { INestApplication } from "@nestjs/common";import * as request from "supertest";import { AppModule } from "../src/app.module";describe("UserModule (e2e)", () => { let app: INestApplication; beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ // 기본적으로 전체 모듈인 ..

    E2E (End-to-End)

    E2E (End-to-End)

    🧐 E2E (End-to-End)- 애플리케이션의 기능을 처음부터 끝까지 전체적으로 검증 하는 것  E2E (End-to-End)테스트는 애플리케이션의 시작부터 끝까지 전체 워크플로우를 테스트하는 방법이다.이 테스트는 사용자가 애플리케이션을 실제로 어떻게 사용하는지를 시뮬레이션하여, 모든 구성 요소가 함께 올바르게 작동하는지 확인한다.간단히 말해, E2E 테스트는 애플리케이션의 기능을 처음부터 끝까지 전체적으로 검증하는 것이다.  장점신뢰성: 실제 사용자 흐름을 테스트하여 애플리케이션이 기대대로 작동하는지 보장한다.통합 확인: 모든 구성 요소가 함께 작동하는지 확인하여 통합 문제를 조기에 발견할 수 있다.  단점시간 소요: 테스트 실행 시간이 길어질 수 있다.복잡성: 설정 및 유지 관리가 복잡할 수 있..