UNPKG

605 BJavaScriptView Raw
1var path = require('path');
2
3var createPattern = function(path) {
4 return {pattern: path, included: true, served: true, watched: false};
5};
6
7var initMocha = function(files, mochaConfig) {
8 var mochaPath = path.dirname(require.resolve('mocha'));
9 files.unshift(createPattern(__dirname + '/adapter.js'));
10 files.unshift(createPattern(mochaPath + '/mocha.js'));
11
12 if (mochaConfig && mochaConfig.reporter) {
13 files.unshift(createPattern(mochaPath + '/mocha.css'));
14 }
15};
16
17initMocha.$inject = ['config.files', 'config.client.mocha'];
18
19module.exports = {
20 'framework:mocha': ['factory', initMocha]
21};