mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 06:25:51 +03:00
bc97de5fe9
no issue - provide a single point for accessing config in unit tests - create a single way to set and restore config - ensure that restore deletes top level optional keys that are now undefined - use this._config in check deprecations, otherwise the config gets cached - solves issues with interdependent tests
21 lines
564 B
JavaScript
21 lines
564 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'),
|
|
|
|
// Stuff we are testing
|
|
helpers = require('../../../server/helpers'),
|
|
utils = {};
|
|
|
|
utils.loadHelpers = function () {
|
|
var adminHbs = hbs.create();
|
|
helpers.loadCoreHelpers(adminHbs);
|
|
};
|
|
|
|
module.exports = utils;
|