The video for this lesson is currently being updated, please read the transcript instead.

Assertions and Asynchronous Test Cases

In the last video, we set up a Mocha unit test and got it running. The thing is it doesn't actually test anything, yet.

To help us make some tests, we'll now add an assertion library called expect. Let's first install it:

$ npm i -D expect@23

With that installed, let's now require it at the top of the test file:

tests/unit/server/item.test.js

const expect = require("expect");

Using an assertion

To view the complete lesson you'll need to login or join this course.


Click to load comments...