res._isEndCalled() 는 테스트를 못해보나요?
미해결
따라하며 배우는 TDD 개발 [2023.11 업데이트]
it('should return 404 when productId is not exist', async () => { const res = await request(app).get('/products/610a7f33b63caa3699ed9911'); expect(res.statusCode).toBe(404); // expect(res._isEndCalled()).toBeTruthy(); // 이건 왜 안될까요? }); 단위 테스트에서 수행하던 res._isEndCalled()는 node-mocks-http에서 createResponse()를 통해서 생성된 경우에만 테스트가 가능한 걸까요?
- node-mocks-http
- mongoose
- jest
- tdd
- mongodb
- supertest
- express
- nodejs
사리곰탕
댓글 1
좋아요 0
조회수 250





