Skip to content

WZT006/node-unit-mvc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unit Testing Example with Jest and Sinon

This example is for the STSWENG course to illustrate how to mock the database connection with mongodb and mongoose. The example was based on this example from Talha Awan.

Alternatively, mongoose can also be mocked using mockingoose.

Requirements

Pre-Setup

  1. Fork this repository by clicking the Fork button up at the top of this page.
  2. Clone your copy of the repository git clone https://github.com/<YOUR_USERNAME>/node-unit-mvc.git

Running locally

  1. Navigate to the directory: cd node-unit-mvc
  2. Install the dependencies: npm install

Note: The only script set up for this project is the npm run test which will run jest.

Setting up the test

The post.test.js file will be built up during the class.

About

Unit testing using express and mongoose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%