diff --git a/lib/jasmine.async.js b/lib/jasmine.async.js index fb54f88..fba4699 100644 --- a/lib/jasmine.async.js +++ b/lib/jasmine.async.js @@ -1,5 +1,5 @@ // Jasmine.Async, v0.1.0 -// Copyright (c)2012 Muted Solutions, LLC. All Rights Reserved. +// Copyright (c)2013 Muted Solutions, LLC. All Rights Reserved. // Distributed under MIT license // http://github.com/derickbailey/jasmine.async this.AsyncSpec = (function(global){ @@ -13,7 +13,12 @@ this.AsyncSpec = (function(global){ var complete = function(){ done = true; }; runs(function(){ - block(complete); + try{ + block.call(this,complete); + } catch ( error ){ + complete(); + throw error; + } }); waitsFor(function(){ diff --git a/lib/jasmine.async.min.js b/lib/jasmine.async.min.js index 1694f7d..78e409f 100644 --- a/lib/jasmine.async.min.js +++ b/lib/jasmine.async.min.js @@ -1,5 +1,5 @@ // Jasmine.Async, v0.1.0 -// Copyright (c)2012 Muted Solutions, LLC. All Rights Reserved. +// Copyright (c)2013 Muted Solutions, LLC. All Rights Reserved. // Distributed under MIT license // http://github.com/derickbailey/jasmine.async -this.AsyncSpec=function(a){function b(a){return function(){var b=!1,c=function(){b=!0};runs(function(){a(c)}),waitsFor(function(){return b})}}function c(a){this.spec=a}return c.prototype.beforeEach=function(a){this.spec.beforeEach(b(a))},c.prototype.afterEach=function(a){this.spec.afterEach(b(a))},c.prototype.it=function(c,d){a.it(c,b(d))},c}(this); \ No newline at end of file +this.AsyncSpec=function(e){function t(e){return function(){var t=!1,n=function(){t=!0};runs(function(){try{e.call(this,n)}catch(t){throw n(),t}}),waitsFor(function(){return t})}}function n(e){this.spec=e}return n.prototype.beforeEach=function(e){this.spec.beforeEach(t(e))},n.prototype.afterEach=function(e){this.spec.afterEach(t(e))},n.prototype.it=function(n,r){e.it(n,t(r))},n}(this); \ No newline at end of file diff --git a/src/jasmine.async.js b/src/jasmine.async.js index efffffe..5500b7d 100644 --- a/src/jasmine.async.js +++ b/src/jasmine.async.js @@ -9,7 +9,12 @@ this.AsyncSpec = (function(global){ var complete = function(){ done = true; }; runs(function(){ - block(complete); + try{ + block.call(this,complete); + } catch ( error ){ + complete(); + throw error; + } }); waitsFor(function(){