Add config option which stops jasmine from capturing exceptions in a test

This commit is contained in:
Alex Kwiatkowski
2012-04-15 17:34:31 -04:00
parent 7bbcf51d45
commit 2385acedd8
4 changed files with 153 additions and 103 deletions

View File

@@ -12,11 +12,16 @@ jasmine.Block = function(env, func, spec) {
this.spec = spec;
};
jasmine.Block.prototype.execute = function(onComplete) {
try {
jasmine.Block.prototype.execute = function(onComplete) {
if (!jasmine.CATCH_EXCEPTIONS) {
this.func.apply(this.spec);
} catch (e) {
this.spec.fail(e);
}
else {
try {
this.func.apply(this.spec);
} catch (e) {
this.spec.fail(e);
}
}
onComplete();
};