Setting up the user section

In the previous chapter, we also had a user section for the application. In this chapter, we are going to extend those functionalities by adding the register and change password functionalities. We are going to reuse the existing code base and add the new features.

Describing the user model

We will create a test file specifically for the user model. This will come in handy for testing all its functionalities without booting up the entire application. Create a file called test/integration/user.model.test.js and add the following content:

'use strict'; /** * Important! Set the environment to test */ process.env.NODE_ENV = 'test'; const chai = require('chai'); const should = chai.should(); consst config = require('../../config/environments/test'); ...

Get MEAN Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.