UNPKG

865 BJavaScriptView Raw
1var JASMINE_CORE_PATTERN = /([\\/]karma-jasmine[\\/])/i;
2var createPattern = function (path) {
3 return { pattern: path, included: true, served: true, watched: false };
4};
5
6var initReporter = function (files, baseReporterDecorator) {
7 var jasmineCoreIndex = 0;
8
9 baseReporterDecorator(this);
10
11 files.forEach(function (file, index) {
12 if (JASMINE_CORE_PATTERN.test(file.pattern)) {
13 jasmineCoreIndex = index;
14 }
15 });
16
17 files.splice(++jasmineCoreIndex, 0, createPattern(__dirname + '/css/jasmine.css'));
18 files.splice(++jasmineCoreIndex, 0, createPattern(__dirname + '/lib/html.jasmine.reporter.js'));
19 files.splice(++jasmineCoreIndex, 0, createPattern(__dirname + '/lib/adapter.js'));
20};
21
22initReporter.$inject = ['config.files', 'baseReporterDecorator'];
23
24module.exports = {
25 'reporter:kjhtml': ['type', initReporter]
26};