๐ง E2E (End-to-End) - ์ ํ๋ฆฌ์ผ์ด์
์ ๊ธฐ๋ฅ์ ์ฒ์๋ถํฐ ๋๊น์ง ์ ์ฒด์ ์ผ๋ก ๊ฒ์ฆ ํ๋ ๊ฒ
E2E (End-to-End)
- ํ ์คํธ๋ ์ ํ๋ฆฌ์ผ์ด์ ์ ์์๋ถํฐ ๋๊น์ง ์ ์ฒด ์ํฌํ๋ก์ฐ๋ฅผ ํ ์คํธํ๋ ๋ฐฉ๋ฒ์ด๋ค.
- ์ด ํ ์คํธ๋ ์ฌ์ฉ์๊ฐ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ค์ ๋ก ์ด๋ป๊ฒ ์ฌ์ฉํ๋์ง๋ฅผ ์๋ฎฌ๋ ์ด์ ํ์ฌ, ๋ชจ๋ ๊ตฌ์ฑ ์์๊ฐ ํจ๊ป ์ฌ๋ฐ๋ฅด๊ฒ ์๋ํ๋์ง ํ์ธํ๋ค.
- ๊ฐ๋จํ ๋งํด, E2E ํ ์คํธ๋ ์ ํ๋ฆฌ์ผ์ด์ ์ ๊ธฐ๋ฅ์ ์ฒ์๋ถํฐ ๋๊น์ง ์ ์ฒด์ ์ผ๋ก ๊ฒ์ฆํ๋ ๊ฒ์ด๋ค.
์ฅ์
- ์ ๋ขฐ์ฑ: ์ค์ ์ฌ์ฉ์ ํ๋ฆ์ ํ ์คํธํ์ฌ ์ ํ๋ฆฌ์ผ์ด์ ์ด ๊ธฐ๋๋๋ก ์๋ํ๋์ง ๋ณด์ฅํ๋ค.
- ํตํฉ ํ์ธ: ๋ชจ๋ ๊ตฌ์ฑ ์์๊ฐ ํจ๊ป ์๋ํ๋์ง ํ์ธํ์ฌ ํตํฉ ๋ฌธ์ ๋ฅผ ์กฐ๊ธฐ์ ๋ฐ๊ฒฌํ ์ ์๋ค.
๋จ์
- ์๊ฐ ์์: ํ ์คํธ ์คํ ์๊ฐ์ด ๊ธธ์ด์ง ์ ์๋ค.
- ๋ณต์ก์ฑ: ์ค์ ๋ฐ ์ ์ง ๊ด๋ฆฌ๊ฐ ๋ณต์กํ ์ ์๋ค.
์์ ์ฝ๋ ์ค๋ช
- NestJS ํ
์คํธ ์ ํธ๋ฆฌํฐ ๋ฐ ๋ชจ๋ ๋ก๋
- @nestjs/testing, supertest, AppModule ๋ฑ์ ๊ฐ์ ธ์จ๋ค.
- @nestjs/testing, supertest, AppModule ๋ฑ์ ๊ฐ์ ธ์จ๋ค.
- ํ
์คํธ ํ๊ฒฝ ์ค์
- beforeEach ๋ธ๋ก์์ NestJS ์ ํ๋ฆฌ์ผ์ด์
์ธ์คํด์ค๋ฅผ ์์ฑํ๊ณ ์ด๊ธฐํํ๋ค.
- beforeEach ๋ธ๋ก์์ NestJS ์ ํ๋ฆฌ์ผ์ด์
์ธ์คํด์ค๋ฅผ ์์ฑํ๊ณ ์ด๊ธฐํํ๋ค.
- ํ
์คํธ ์คํ:
- ๊ฐ ํ
์คํธ๋ ๋
๋ฆฝ์ ์ผ๋ก ์ ํ๋ฆฌ์ผ์ด์
์ ํน์ ๊ธฐ๋ฅ์ ๊ฒ์ฆํ๋ค.
- ๊ฐ ํ
์คํธ๋ ๋
๋ฆฝ์ ์ผ๋ก ์ ํ๋ฆฌ์ผ์ด์
์ ํน์ ๊ธฐ๋ฅ์ ๊ฒ์ฆํ๋ค.
describe("UserModule (e2e)", () => { let app: INestApplication; beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [AppModule], }).compile(); app = module.createNestApplication(); await app.init(); }); // ์ถ๊ฐ์ ์ธ ํ
์คํธ ์ผ์ด์ค๋ค์ ์์ฑํ์ฌ E2E ํ
์คํธ๋ฅผ ์งํ });
'Frontend > E2E' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Resolver ํ ์คํธ ์ฌ์ฉ๋ฒ ์์ (0) | 2024.07.15 |
---|---|
[์ด๊ธฐ์ค์ ] ํ ์คํธ๊ฐ ๋๋ ํ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ด์ฉ dropํ๊ธฐ (0) | 2024.07.15 |
[์ด๊ธฐ์ค์ ] E2E ์ค์ ๊ตฌ์ฑ, ๊ฒฝ๋ก ๋ณ๊ฒฝํ๊ธฐ (0) | 2024.07.15 |
[์ด๊ธฐ์ค์ ] E2E ํ ์คํธ๋ฅผ ์ค์ ํ๋ ์์ ์ฝ๋ ์ค๋ช (0) | 2024.07.15 |