O'Reilly logo

Web Application Development with MEAN by Robert Onodi, Adrian Mejia, Amos Q. Haviv

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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'); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required