2019-02-22 10:55:17 +03:00
|
|
|
const { TerminalReporter } = require('jasmine-tagged')
|
2019-02-05 01:05:03 +03:00
|
|
|
|
2019-02-05 18:13:49 +03:00
|
|
|
class JasmineListReporter extends TerminalReporter {
|
2019-02-05 01:05:03 +03:00
|
|
|
fullDescription (spec) {
|
|
|
|
let fullDescription = spec.description
|
|
|
|
let currentSuite = spec.suite
|
|
|
|
while (currentSuite) {
|
|
|
|
fullDescription = currentSuite.description + ' > ' + fullDescription
|
|
|
|
currentSuite = currentSuite.parentSuite
|
|
|
|
}
|
|
|
|
return fullDescription
|
|
|
|
}
|
|
|
|
|
|
|
|
reportSpecStarting (spec) {
|
|
|
|
this.print_(this.fullDescription(spec) + ' ')
|
|
|
|
}
|
|
|
|
|
|
|
|
reportSpecResults (spec) {
|
|
|
|
const result = spec.results()
|
|
|
|
if (result.skipped) {
|
2019-02-05 18:40:52 +03:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
let msg = ''
|
|
|
|
if (result.passed()) {
|
2019-02-05 01:05:03 +03:00
|
|
|
msg = this.stringWithColor_('[pass]', this.color_.pass())
|
|
|
|
} else {
|
|
|
|
msg = this.stringWithColor_('[FAIL]', this.color_.fail())
|
|
|
|
this.addFailureToFailures_(spec)
|
|
|
|
}
|
|
|
|
this.printLine_(msg)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-05 18:13:49 +03:00
|
|
|
module.exports = { JasmineListReporter }
|