diff --git a/lib/config.js b/lib/config.js index 15a533283..b175b93ab 100644 --- a/lib/config.js +++ b/lib/config.js @@ -131,7 +131,8 @@ var parseConfig = function(configFilePath, cliOptions) { type: 'html', dir: 'coverage/' }, - loggers: [ constant.CONSOLE_APPENDER ] + loggers: [ constant.CONSOLE_APPENDER ], + plugins: [] }; var ADAPTER_DIR = __dirname + '/../adapter'; diff --git a/lib/server.js b/lib/server.js index 65a80f518..3d24c8472 100644 --- a/lib/server.js +++ b/lib/server.js @@ -229,17 +229,26 @@ start.$inject = ['injector', 'config', 'launcher', 'emitter', 'preprocess', 'fil exports.start = function(cliOptions, done) { - var injector = new di.Injector([ - ['done', 'value', done || process.exit], - ['emitter', 'type', EventEmitter], - ['launcher', 'type', Launcher], - ['config', 'value', cfg.parseConfig(cliOptions.configFile, cliOptions)], - ['preprocess', 'factory', preprocessor.createPreprocessor], - ['fileList', 'type', FileList], - ['webServer', 'factory', ws.createWebServer], - ['reporter', 'factory', reporter.createReporters], - ['capturedBrowsers', 'type', browser.Collection] - ]); + var config = cfg.parseConfig(cliOptions.configFile, cliOptions); + var modules = [{ + logger: ['value', logger], + done: ['value', done || process.exit], + emitter: ['type', EventEmitter], + launcher: ['type', Launcher], + config: ['value', config], + preprocess: ['factory', preprocessor.createPreprocessor], + fileList: ['type', FileList], + webServer: ['factory', ws.createWebServer], + reporter: ['factory', reporter.createReporters], + capturedBrowsers: ['type', browser.Collection] + }]; + + // register all plugins + config.plugins.forEach(function(plugin) { + modules.push(require('../plugins/' + plugin)); + }); + + var injector = new di.Injector(modules); injector.invoke(start); };