source: trip-planner-front/node_modules/karma-jasmine-html-reporter/src/index.js@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[6a3a178]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 (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
35initReporter.$inject = ['config', 'baseReporterDecorator'];
36
37module.exports = {
38 'reporter:kjhtml': ['type', initReporter]
39};
Note: See TracBrowser for help on using the repository browser.