Testing NodeJS – Express with Mongoose

In the previous post I started testing the Node/Express application which I created before. So far we only added some tests to the Mongoose models and now I want to make sure, that the REST API keeps doing what I want it to do. In addition to using Mocha and Chai, which we looked at previously, now I will take a look at Supertest to make calls to Express and Sinon to stub calls.



Tagged with
Comment

Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’

When running ng test I got "Can't bind to 'ngModel' since it isn't a known property of 'input'", even though if I run the code with ng serve, there is no issue. This post is a hint to include core module dependencies, when setting up the TestBed in Angular 2.



Tagged with
Comment

Start testing NodeJS – Mongoose

Before continuing to create the REST API which I started and extended in previous posts, let’s take a look at testing. I should’ve started with this I guess, but maybe it’s not too late yet. In the previous posts at the end we tested the results manually either using Postman or cURL. These tests were of course nowhere near complete and if we broke something it remained hidden for too long. In this post I will create some tests for this NodeJS application, first focusing on the MongooseJS models, then in a next post taking a look at testing opportunities of the ExpressJS routes.



Tagged with
Comment