Removed models dependency from Webhook Service test

no issue

- There's no need to init whole models module in this test. Simplified mocks are easier to understand without any "magic" that's going on behind model's module "init()" call
This commit is contained in:
Naz 2022-04-14 16:12:05 +08:00
parent 0139c9c3ad
commit 4dcb229b35

View File

@ -1,12 +1,15 @@
const errors = require('@tryghost/errors');
const should = require('should');
const sinon = require('sinon');
const createWebhookService = require('../../../../../core/server/services/webhooks/webhooks-service');
const models = require('../../../../../core/server/models');
describe('Webhook Service', function () {
before(models.init);
const models = {
Webhook: {
getByEventAndTarget: () => {},
add: () => {}
}
};
afterEach(function () {
sinon.restore();