1 | var path = require('path');
|
2 |
|
3 | var createPattern = function(path) {
|
4 | return {pattern: path, included: true, served: true, watched: false};
|
5 | };
|
6 |
|
7 | var 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 |
|
17 | initMocha.$inject = ['config.files', 'config.client.mocha'];
|
18 |
|
19 | module.exports = {
|
20 | 'framework:mocha': ['factory', initMocha]
|
21 | };
|