Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Web Development with MongoDB and Node

You're reading from   Web Development with MongoDB and Node Build fast web applications for handling any kind of data

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher
ISBN-13 9781788395083
Length 330 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Bruno Joseph D'mello Bruno Joseph D'mello
Author Profile Icon Bruno Joseph D'mello
Bruno Joseph D'mello
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Welcome to JavaScript in the Full Stack FREE CHAPTER 2. Getting Up and Running 3. Node and MongoDB Basics 4. Introducing Express 5. Templating with Handlebars 6. Controllers and View Models 7. Persisting Data with MongoDB 8. Creating a RESTful API 9. Testing Your Code 10. Deploying with Cloud-Based Services 11. Popular Node.js Web Frameworks 12. Single Page Applications with Popular Frontend Frameworks

The tools of the trade


Let's start by taking a look at the various tools and libraries we will use to run and write our tests. There are three main concepts that we will need to cover before we can actually start writing real tests.

The first is a test runner, or the framework we use to run our suite of tests.

Most of the frameworks follow Test Driven Development (TDD), and their process relies on the following steps:

  1. It defines a unit test.
  2. It implements the unit.
  3. It executes the test and verifies that the test passes.

The second concept is the assertion library itself--the language we use to write our tests. A special version of using assertion language to design and build pieces of functionality incrementally, guided by an expected behavior, is Behavior Driven Development (BDD).

For both TDD and BDD, we can use the Mocha testing framework; however, we will be writing assertions using a special assertion library called Chai.js.

Finally, we'll take a look at the idea of spies and stubs, which are...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime