Test
![[nestjs] spec과 unit testing](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FmDG3F%2Fbtq0iB7kWDz%2FAAAAAAAAAAAAAAAAAAAAAO9gXPfk5mopAn9lXP4XYu_lz_4_hoXsBmUydkM0ZIv7%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3Dgmi8Pmo%252FCRslE1mXzl8Dxc8%252B21U%253D)
[nestjs] spec과 unit testing
nestjs구조를 보면 거의 모든 controller.ts와 service ts파일에 spec.ts파일이 같이 붙어 있는 것을 볼 수 있습니다. spec.ts파일은 테스트를 위한 파일입니다. import { Test, TestingModule } from '@nestjs/testing'; import { SchoolController } from './school.controller'; describe('SchoolController', () => { let controller: SchoolController; beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ controllers: [SchoolC..