라이브러리 설치
- 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
'프로그래밍 > Nest.js' 카테고리의 다른 글
[ Nest.js ] error, Jest did not exit one second after the test run has completed. (0) | 2024.08.27 |
---|---|
[ Nest.js] 의존성 주입을 사용하는 이유와 장점 (0) | 2024.08.17 |
[ Nest.js ] 대량의 데이터 삭제시 두가지 softDelete 방식 비교 (0) | 2024.07.23 |
[ Nest.js ] update vs createQueryBuilder vs query : 다량의 데이터 업데이트 속도 비교 (0) | 2024.07.22 |
[ Nest.js ] insert vs save : 둘 이상의 데이터 저장시 속도비교 (1) | 2024.07.22 |