Friday 24 January 2020

Architectural Question for Testing

I currently have an express server running and am using mocha for my tests. I am using Mongoose to connect with MongoDB.I want to have all my tests use a separate database for testing so that they don't conflict with the real database but I'm unsure of exactly how to set it up. I want to be able to test the routes of my express server and also make database queries in the tests to make sure everything ran as properly (post to "/create_user" route and query the database to make sure user is actually there).I'm unsure of exactly, generally speaking, how to set this up. I've tried a few different ways but none seem very efficient.Can anyone suggest a general idea of how would one go about this?Thanks!

Submitted January 24, 2020 at 05:58PM by the_night_question

No comments:

Post a Comment