In some frameworks, snippet code for mocha tests is auto-generated like this:
it('should return current day', () => {
return wrapped.run({}).then((response) => {
expect(response.statusCode).to.be.equal(200);
// more tests
});
});
Why is the return
needed? What is accomplished by returning a value from a mocha test?