Book Image

MEAN Web Development - Second Edition

By : Amos Q. Haviv
Book Image

MEAN Web Development - Second Edition

By: Amos Q. Haviv

Overview of this book

The MEAN stack is a collection of the most popular modern tools for web development that helps you build fast, robust, and maintainable web applications. Starting with the MEAN core frameworks, this pragmatic guide will explain the key concepts of each framework, how to set them up properly, and how to use popular modules to connect it all together. By following the real-world examples shown in this tutorial, you will scaffold your MEAN application architecture, add an authentication layer, and develop an MVC structure to support your project development. You will learn the best practices of maintaining clear and simple code and will see how to avoid common pitfalls. Finally, you will walk through the different tools and frameworks that will help expedite your daily development cycles. Watch how your application development grows by learning from the only guide that is solely orientated towards building a full, end-to-end, real-time application using the MEAN stack!
Table of Contents (18 chapters)
MEAN Web Development Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Installing Mocha


Mocha is basically a Node.js module that provides command-line capabilities to run tests. The easiest way to use Mocha is to first install it as a global node module using npm. To do so, just issue the following command in your command-line tool:

$ npm install –g mocha

As usual, this will install the latest version of Mocha in your global node_modules folder. When the installation process is successfully finished, you'll be able to use the Mocha utility from your command line. Next, you'll need to install the Should.js and SuperTest assertion libraries in your project.

Note

You may experience some trouble installing global modules. This is usually a permission issue, so use sudo or super user when running the global install command.

Installing the Should.js and SuperTest modules

Before you can start writing your tests, you will need to install both Should.js and SuperTest using npm. To do so, change your project's package.json file as follows:

{
  "name": "MEAN",
  "version"...