Recently I got introduced to node.js and packages like express, mongodb and ejs. I have few questions :
As a learning purpose, I have created a github repo of user management which uses express, mongodb and ejs. I have all my functions in routes/users.js file. I need to write test cases all these functions. How to create a test driven programming with this example?
In my routes in app.js
file.
app.get('/login', user.login);
app.post('/login', user.loginSubmit);
I need to write different routes to login page renders and submit etc. If there are some ajax request also, then we have lots of routes in app.js
file when considering to routes of a single page. Is it like that or need to change my structure?