[6a3a178] | 1 | var JASMINE_CORE_PATTERN = /([\\/]karma-jasmine[\\/])/i;
|
---|
| 2 | var createPattern = function (path) {
|
---|
| 3 | return { pattern: path, included: true, served: true, watched: false };
|
---|
| 4 | };
|
---|
| 5 |
|
---|
| 6 | var initReporter = function (karmaConfig, baseReporterDecorator) {
|
---|
| 7 | var jasmineCoreIndex = 0;
|
---|
| 8 |
|
---|
| 9 | const files = karmaConfig.files;
|
---|
| 10 |
|
---|
| 11 | baseReporterDecorator(this);
|
---|
| 12 |
|
---|
| 13 | if (karmaConfig.jasmineHtmlReporter) {
|
---|
| 14 | const config = karmaConfig.jasmineHtmlReporter;
|
---|
| 15 | if (config.suppressAll) {
|
---|
| 16 | this.onSpecComplete = () => void 0;
|
---|
| 17 | this.onRunComplete = () => void 0;
|
---|
| 18 | }
|
---|
| 19 | if (config.suppressFailed) {
|
---|
| 20 | this.specFailure = () => void 0;
|
---|
| 21 | }
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | files.forEach(function (file, index) {
|
---|
| 25 | if (JASMINE_CORE_PATTERN.test(file.pattern)) {
|
---|
| 26 | jasmineCoreIndex = index;
|
---|
| 27 | }
|
---|
| 28 | });
|
---|
| 29 |
|
---|
| 30 | files.splice(++jasmineCoreIndex, 0, createPattern(__dirname + '/css/jasmine.css'));
|
---|
| 31 | files.splice(++jasmineCoreIndex, 0, createPattern(__dirname + '/lib/html.jasmine.reporter.js'));
|
---|
| 32 | files.splice(++jasmineCoreIndex, 0, createPattern(__dirname + '/lib/adapter.js'));
|
---|
| 33 | };
|
---|
| 34 |
|
---|
| 35 | initReporter.$inject = ['config', 'baseReporterDecorator'];
|
---|
| 36 |
|
---|
| 37 | module.exports = {
|
---|
| 38 | 'reporter:kjhtml': ['type', initReporter]
|
---|
| 39 | };
|
---|