Created
May 28, 2020 14:58
-
-
Save agirorn/99b8850ccfed7968a3f999894ce9d6d9 to your computer and use it in GitHub Desktop.
Custom jasmine reporter (prints name, file, line number and status of each spec being run).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jasmineSlowReporter = require('jasmine-slow-reporter'); | |
jasmine.getEnv().addReporter(jasmineSlowReporter); | |
jasmineSlowReporter.threshold = process.env.TEST_SLOW_THRESHOLD || 50; | |
class CustomReporter { | |
specStarted(spec) { | |
const { | |
fullName, | |
_jasmineSlowReporter: { | |
filename, | |
line, | |
}, | |
} = spec; | |
console.log('=>', fullName); | |
console.log(` ${filename}#${line}`); | |
} | |
specDone(spec) { | |
const { status } = spec; | |
console.log(` status: ${status}`); | |
} | |
} | |
jasmine.getEnv().addReporter(new CustomReporter()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment