프로그래밍/Nest.js
[ Nest.js ] jest 이용한 e2e 테스트
L.Joey
2024. 9. 7. 23:46
라이브러리 설치
- Nest.js 를 이용하여 프로젝트를 생성하면 기본적으로 설치되어 있는 라이브러리
$ npm init
$ npm i -D jest ts-jest @jest/globals @types/jest
- API 테스트를 위해 설치해야하는 라이브러리
$ npm i supertest
테스트 파일의 형식
- ___.test.ts
- ___.spec.ts
실행 방법 ( pacakge.json 참고)
$ npm run test