Ghost/test/utils/e2e-framework-mock-utils.js
Naz 309e14b8c9 Moved email stubbing logic into e2e-framework utils
refs https://github.com/TryGhost/Toolbox/issues/158

- Moving common mocking/stubbing/spying logic into an outside utils module allows test suites to keep agnostic towards which framework powers mocking etc. Should also substitute email service stubbing used in multiple places
- Bonus, got rid of should dependency, which is deprecated
2021-12-09 15:10:13 +04:00

13 lines
335 B
JavaScript

const sinon = require('sinon');
const mailService = require('../../core/server/services/mail/index');
const stubMail = () => {
return sinon
.stub(mailService.GhostMailer.prototype, 'send')
.resolves('Mail is disabled');
};
module.exports.stubMail = stubMail;
module.exports.restoreMocks = () => sinon.restore();