Ghost/core/test/utils/channelUtils.js
Hannah Wolfe 050f1751c4 Simplify config for channels (#9158)
refs #5091

- remove the use of functions
- remove unnecessary quotes from tag filter
- move channel config to be a JSOn file called config.channels.json
- accept external config
- new channelUtils for tests
- remove channelConfig.get 
- refactor so tests work as expected
- refactor away duplicate 'name' value
2017-10-24 17:18:35 +01:00

15 lines
479 B
JavaScript

var defaultChannels = require('../../server/controllers/frontend/config.channels.json');
// This is a function to get a fake or test channel
// It's currently based on the default config in Ghost itself
module.exports.getTestChannel = function getTestChannel(channelName) {
var channel = defaultChannels[channelName];
channel.name = channelName;
return channel;
};
module.exports.getDefaultChannels = function getDefaultChannels() {
return defaultChannels;
};