mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 16:14:25 +03:00
2c6d43a0c0
no issue - Split theme helpers into individual files for each - Do the same for tests - Have utils to share some things between them - Move assetHash onto config
33 lines
867 B
JavaScript
33 lines
867 B
JavaScript
// # Helper Test Utils
|
|
//
|
|
// Contains shared code for intialising tests
|
|
//
|
|
// @TODO refactor this file out of existence
|
|
// I believe if we refactor the handlebars instances and helpers to be more self-contained and modular
|
|
// We can likely have init functions which replace the need for this file
|
|
|
|
var hbs = require('express-hbs'),
|
|
_ = require('lodash'),
|
|
|
|
// Stuff we are testing
|
|
helpers = require('../../../server/helpers'),
|
|
config = require('../../../server/config'),
|
|
origConfig = _.cloneDeep(config.get()),
|
|
utils = {};
|
|
|
|
utils.loadHelpers = function () {
|
|
var adminHbs = hbs.create();
|
|
helpers.loadCoreHelpers(adminHbs);
|
|
};
|
|
|
|
utils.overrideConfig = function (newConfig) {
|
|
config.set(newConfig);
|
|
};
|
|
|
|
utils.restoreConfig = function () {
|
|
config.set(origConfig);
|
|
};
|
|
|
|
module.exports = utils;
|
|
module.exports.config = config;
|