emangor / boilerplate-nodejs-express-postgres

example of nodejs/express/postgres project
MIT License
8 stars 7 forks source link

add test framework? #1

Open chintanp opened 4 years ago

chintanp commented 4 years ago

@emangor this is a fine template that I am using. Wondering if there are any plans to add a test framework to the template.

emangor commented 4 years ago

@chintanp Im glad you like it and that's a good idea. It will probably be a few months before I have time to get to it.

chintanp commented 4 years ago

@emangor Could you define what should be tested here? And some possible ways to go about it? One of the test I have so far is testing that the express server is up. Like so: https://glebbahmutov.com/blog/how-to-correctly-unit-test-express-server/ This tests that I get a status of 200 when the right path is sought and 404 for incorrect paths. I want to further test the controller, model and utils, but cannot find any examples. Any help is appreciated.

emangor commented 4 years ago

@chintanp Sorry for the delay, life got in the way with an international move and this whole pandemic thing. Testing can turn into something quite large, you have unit, functional and integration testing. IMO it's best to start with unit testing at the foundation.

emangor commented 3 years ago

@chintanp been awhile - I added unit testing to the TypeScript version of this boilerplate: https://github.com/emangor/boilerplate-typescript-express-postgres