Wednesday, 27 November 2019

Should I write both Unit and Integration tests for my web apis?

So, recently i got into testing web apis, following the structure of bulletproof nodejs repo, and I started making tests, mostly integration with supertest and jest. my question is: when i finish writing integration tests, should i write unit tests as well? I am asking this as i have services and routes separated and in some of routes i might even use two service.​also, i've got one "bonus" question for integration tests. currently i am creating new express app instance and importing my routes in test file(i have got routes and middlewares as loaders), and then i am using supertest to test my routes, is this the right approach?

Submitted November 27, 2019 at 12:20PM by warchild4l

No comments:

Post a Comment