Tuesday 30 October 2018

Best practices TDD for RESTful API

I am currently in the process of developing an API for a blog server using NodeJS. For this project I will be using the following stack:NodeJS 10 LTSTypescriptPostgreSQLRestify or ExpressKnexJSI've got the whole plan worked out, except one thing, writing tests.For this project I would like to use the TDD approach, but I can't really find the best practices for this.It should be possible to run the tests using a separate database locally (not the local dev DB), and run the tests using GitLab CI within Docker.The NodeJS app will serve only as the middleman for reading posts, authors etc. using a public API endpoint, and as a protective layer to protect the protected API endpoint (for placing new posts, deleting them, etc)My question is: what would be the best and cleanest approach for this? And what kind of tests should be written?Thanks in advance.

Submitted October 30, 2018 at 05:10PM by lucianonooijen

No comments:

Post a Comment