0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Removed unnecessary checks in unit test suites

refs https://linear.app/tryghost/issue/CORE-104/decouple-frontend-routing-events-from-urlserver-events

- These modules have nothing to do with "events"! There's no reason to test for something that would not ever happen
This commit is contained in:
Naz 2021-10-14 14:00:22 +02:00 committed by naz
parent 597ec51afb
commit 3bca65d868
2 changed files with 0 additions and 14 deletions

View file

@ -1,7 +1,6 @@
const should = require('should');
const sinon = require('sinon');
const configUtils = require('../../../../utils/configUtils');
const events = require('../../../../../core/server/lib/common/events');
const urlUtils = require('../../../../../core/shared/url-utils');
const ParentRouter = require('../../../../../core/frontend/services/routing/ParentRouter');
@ -11,9 +10,6 @@ describe('UNIT - services/routing/ParentRouter', function () {
let next;
beforeEach(function () {
sinon.stub(events, 'emit');
sinon.stub(events, 'on');
sinon.stub(urlUtils, 'redirect301');
req = sinon.stub();

View file

@ -1,7 +1,6 @@
const should = require('should');
const sinon = require('sinon');
const configUtils = require('../../../../utils/configUtils');
const events = require('../../../../../core/server/lib/common/events');
const controllers = require('../../../../../core/frontend/services/routing/controllers');
const RSSRouter = require('../../../../../core/frontend/services/routing/RSSRouter');
const urlUtils = require('../../../../../core/shared/url-utils');
@ -9,9 +8,6 @@ const urlUtils = require('../../../../../core/shared/url-utils');
describe('UNIT - services/routing/RSSRouter', function () {
describe('instantiate', function () {
beforeEach(function () {
sinon.stub(events, 'emit');
sinon.stub(events, 'on');
sinon.spy(RSSRouter.prototype, 'mountRoute');
sinon.spy(RSSRouter.prototype, 'mountRouter');
@ -29,9 +25,6 @@ describe('UNIT - services/routing/RSSRouter', function () {
should.exist(rssRouter.router);
rssRouter.route.value.should.eql('/rss/');
events.emit.calledOnce.should.be.false();
events.on.calledOnce.should.be.false();
rssRouter.mountRoute.callCount.should.eql(2);
rssRouter.mountRoute.args[0][0].should.eql('/rss/');
@ -47,9 +40,6 @@ describe('UNIT - services/routing/RSSRouter', function () {
should.exist(rssRouter.router);
rssRouter.route.value.should.eql('/rss/');
events.emit.calledOnce.should.be.false();
events.on.calledOnce.should.be.false();
rssRouter.mountRoute.callCount.should.eql(2);
rssRouter.mountRoute.args[0][0].should.eql('/rss/');