라이브러리 설치

- 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

 

+ Recent posts