When your mocked function doesn't have a return value, you can use the EmptyResult constant instead of passing in undefined.
describe("When using the 'EmptyResult' constant, it", () => {
let context;
it("should return with an empty result.", function (done) {
new Scenario(this)
.mockThisFunction("DbProxy", "save", DbProxy)
.withEntryPoint(context.entryPointObject, context.entryPointFunction)
.withInputParams([context.inputParams])
.shouldBeCalledWith("DbProxy", "save", [param1, param2, param3])
.doesReturnWithPromise("DbProxy", "save", Maddox.constants.EmptyResult)
.test(function (err, response) {
Maddox.compare.equal(err, undefined);
Maddox.compare.equal(response, testContext.expectedResponse);
done();
}).catch(function (err) {
done(err);
});
});
});