The assertions will be done using the expect library. We'll make some assertions about the res variable. We'll assert that it equals, using toBe, the number 25, which is 5 times 5. We'll also use toBeA to assert something about the type of the value:
it('should async square a number', (done) => {
utils.asyncSquare(5, (res) => {
expect(res).toBe(25).toBeA('number');
});
});
In this case, we want to make sure that the square is indeed a number, as opposed to a Boolean, string, or object. With this in place, we do need to call done and then save the file:
it('should async square a number', (done) => {
utils.asyncSquare(5, (res) => {
expect(res).toBe(25).toBeA('number');
done();
});
});

You're getting an error timeout, the 2,000 milliseconds has exceeded. This is when Mocha cuts off your test. If you see this, this usually means two things:
- You have an async function that never actually calls the callback, so you're call to done never gets fired.
- You just never called done.
In our case, we have 5 tests passing and it took 2 seconds to do that. This is fantastic:

We now have a way to test synchronous functions and asynchronous functions. This will make testing a lot more flexible. It'll let us test essentially everything inside of our applications.