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
I'm still using Jasmine 1.2 so perhaps things are different in Jasmine 2.0.
In your afterEach function, you should be able to access the current spec that just completed by using:
var currentSpec = jasmine.getEnv().currentSpec;
That will return an object that has many properties. One of them is how many of the embedded tests passed (results_.passedCount).
You could test against that value and perform your logging appropriately.
Good luck!