Removed rewire dependency in update check tests

refs https://github.com/TryGhost/Team/issues/728

- Rewire is usually a sign of massive module that is impossible to unit test without mocking big parts of that module. With a refactored UpdateCheckService and a brand new test coverage there is no need to use rewire and leave the "smell"
This commit is contained in:
Naz 2021-06-01 17:18:05 +04:00
parent a78e034643
commit 83296c5c7e

View File

@ -1,12 +1,11 @@
const should = require('should');
const rewire = require('rewire');
const sinon = require('sinon');
const moment = require('moment');
const uuid = require('uuid');
const configUtils = require('../../utils/configUtils');
const urlUtils = require('../../utils/urlUtils');
const packageInfo = require('../../../package.json');
let ghostVersion = rewire('../../../core/server/lib/ghost-version');
const ghostVersion = require('../../../core/server/lib/ghost-version');
const UpdateCheckService = require('../../../core/server/update-check-service');