DEV Community

Discussion on: Testing Express Api with Jest and Supertest

Collapse
 
franciscomendes10866 profile image
Francisco Mendes

Thank you so much for the feedback, I'm glad you liked this article 👊

Collapse
 
j22pregbaha profile image
Joshua Pregbaha

Just one thing though. When you do this:
.expect((res) => {
res.body.data.length = 1;
res.body.data[0].email = "test@example.com";
})
This isn't confirming the response object properties. I was reading an article today on the same topic (rahmanfadhil.com/test-express-with...) and I think that suggests a more effective way to do it.

Thank you. Please never stop writing.