Added the ability to associate trace information with failing specs
This is meant to aid in debugging failures, particularly intermittent failures, in cases where interactive debugging or console.log aren't suitable.
This commit is contained in:
@@ -1318,6 +1318,16 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
currentSuite().setSuiteProperty(key, value);
|
||||
};
|
||||
|
||||
this.trace = function(msg) {
|
||||
var maybeSpec = currentRunnable();
|
||||
|
||||
if (!maybeSpec || !maybeSpec.trace) {
|
||||
throw new Error("'trace' was called when there was no current spec");
|
||||
}
|
||||
|
||||
maybeSpec.trace(msg);
|
||||
};
|
||||
|
||||
this.expect = function(actual) {
|
||||
if (!currentRunnable()) {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user