Is it possible to do something only if a Jasmine test fails? Juxtaposed with afterEach() which executes after an it() regardless of outcome, I\'m l
Here's a hack to re-enable jasmine.getEnv().currentSpec in Jasmine 2 (sort of, result isn't the full spec object, but contains id, description, fullName, failedExpectations, and passedExpectations):
jasmine.getEnv().addReporter({
specStarted(result) {
jasmine.getEnv().currentSpec = result;
},
specDone() {
jasmine.getEnv().currentSpec = null;
}
});