|
|
@ -1,5 +1,8 @@ |
|
|
|
// This is a workaround for https://github.com/karma-runner/karma-teamcity-reporter/issues/86
|
|
|
|
// This is a workaround for https://github.com/karma-runner/karma-teamcity-reporter/issues/86
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// logger is needed only to log cases when `browser.id` is not in browserResults
|
|
|
|
|
|
|
|
const logger = require('../../../build/js/node_modules/karma/lib/logger') |
|
|
|
|
|
|
|
|
|
|
|
const kotlinReporterModule = require("../../../build/js/packages_imported/kotlin-test-js-runner/1.6.10/karma-kotlin-reporter"); |
|
|
|
const kotlinReporterModule = require("../../../build/js/packages_imported/kotlin-test-js-runner/1.6.10/karma-kotlin-reporter"); |
|
|
|
|
|
|
|
|
|
|
|
const KotlinReporter = kotlinReporterModule['reporter:karma-kotlin-reporter'][1]; |
|
|
|
const KotlinReporter = kotlinReporterModule['reporter:karma-kotlin-reporter'][1]; |
|
|
@ -7,19 +10,30 @@ const KotlinReporter = kotlinReporterModule['reporter:karma-kotlin-reporter'][1] |
|
|
|
const NewReporter = function(baseReporterDecorator, config, emitter) { |
|
|
|
const NewReporter = function(baseReporterDecorator, config, emitter) { |
|
|
|
KotlinReporter.call(this, baseReporterDecorator, config, emitter); |
|
|
|
KotlinReporter.call(this, baseReporterDecorator, config, emitter); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const consoleLog = logger.create("NewReporter-KotlinReporter"); |
|
|
|
|
|
|
|
|
|
|
|
const onBrowserLogOriginal = this.onBrowserLog; |
|
|
|
const onBrowserLogOriginal = this.onBrowserLog; |
|
|
|
const onSpecCompleteOriginal = this.onSpecComplete; |
|
|
|
const onSpecCompleteOriginal = this.onSpecComplete; |
|
|
|
|
|
|
|
const onBrowserStartOriginal = this.onBrowserStart; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.onBrowserStart = (browser) => { |
|
|
|
|
|
|
|
consoleLog.info("onBrowserStart: id = " + browser.id); |
|
|
|
|
|
|
|
onBrowserStartOriginal(browser); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.onBrowserLog = (browser, log, type) => { |
|
|
|
this.onBrowserLog = (browser, log, type) => { |
|
|
|
if (!this.browserResults[browser.id]) { |
|
|
|
if (!this.browserResults[browser.id]) { |
|
|
|
this.initializeBrowser(browser); |
|
|
|
consoleLog.info("onBrowserLog: force onBrowserStart id=" + browser.id); |
|
|
|
|
|
|
|
this.onBrowserStart(browser); |
|
|
|
} |
|
|
|
} |
|
|
|
onBrowserLogOriginal(browser, log, type); |
|
|
|
onBrowserLogOriginal(browser, log, type); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.onSpecComplete = function (browser, result) { |
|
|
|
this.onSpecComplete = function (browser, result) { |
|
|
|
if (!this.browserResults[browser.id]) { |
|
|
|
if (!this.browserResults[browser.id]) { |
|
|
|
this.initializeBrowser(browser); |
|
|
|
consoleLog.info("onSpecComplete: force onBrowserStart id=" + browser.id); |
|
|
|
|
|
|
|
this.onBrowserStart(browser); |
|
|
|
} |
|
|
|
} |
|
|
|
onSpecCompleteOriginal(browser, result); |
|
|
|
onSpecCompleteOriginal(browser, result); |
|
|
|
} |
|
|
|
} |
|
|
|