mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Removed unnecessary use of rewire
refs: https://github.com/TryGhost/Ghost/commit/e68cb8b31 - I found that some of the places we use rewire are totally unnecessary - Rewire seems to mess with coverage sometimes - It's also a code smell in general so I've ripped it out where possible
This commit is contained in:
parent
45de9b0efc
commit
a31069d49d
5 changed files with 4 additions and 9 deletions
|
@ -1,12 +1,11 @@
|
|||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const rewire = require('rewire');
|
||||
const imageLib = require('../../../../core/server/lib/image');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const config = configUtils.config;
|
||||
|
||||
const getAssetUrl = rewire('../../../../core/frontend/meta/asset-url');
|
||||
const getAssetUrl = require('../../../../core/frontend/meta/asset-url');
|
||||
|
||||
describe('getAssetUrl', function () {
|
||||
afterEach(function () {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const rewire = require('rewire');
|
||||
const registry = rewire('../../../../../core/frontend/services/routing/registry');
|
||||
const registry = require('../../../../../core/frontend/services/routing/registry');
|
||||
|
||||
describe('UNIT: services/routing/registry', function () {
|
||||
let getRssUrlStub;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const rewire = require('rewire');
|
||||
const Promise = require('bluebird');
|
||||
const errors = require('@tryghost/errors');
|
||||
const db = require('../../../../../core/server/data/db');
|
||||
const exporter = rewire('../../../../../core/server/data/exporter');
|
||||
const exporter = require('../../../../../core/server/data/exporter');
|
||||
const schema = require('../../../../../core/server/data/schema');
|
||||
const models = require('../../../../../core/server/models');
|
||||
const schemaTables = Object.keys(schema.tables);
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
const sinon = require('sinon');
|
||||
const should = require('should');
|
||||
const rewire = require('rewire');
|
||||
const nock = require('nock');
|
||||
const externalRequest = rewire('../../../../core/server/lib/request-external');
|
||||
const externalRequest = require('../../../../core/server/lib/request-external');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
|
||||
// for sinon stubs
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
const rewire = require('rewire');
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
|
|
Loading…
Reference in a new issue