diff --git a/lib/chai-as-promised.js b/lib/chai-as-promised.js index c6808e0..78dfb0e 100644 --- a/lib/chai-as-promised.js +++ b/lib/chai-as-promised.js @@ -105,7 +105,6 @@ var that = this; var derivedPromise = getBasePromise(that).then( function (value) { - that._obj = value; assertIfNegated(that, "expected promise not to be fulfilled but it was fulfilled with #{act}", { actual: value }); @@ -115,6 +114,7 @@ assertIfNotNegated(that, "expected promise to be fulfilled but it was rejected with #{act}", { actual: reason }); + return reason; } ); @@ -125,7 +125,6 @@ var that = this; var derivedPromise = getBasePromise(that).then( function (value) { - that._obj = value; assertIfNotNegated(that, "expected promise to be rejected but it was fulfilled with #{act}", { actual: value }); @@ -183,9 +182,8 @@ expected = desiredReason; } - that._obj = value; - assertIfNotNegated(that, assertionMessage, { expected: expected, actual: value }); + return value; }, function (reason) { if (Constructor) { @@ -223,6 +221,7 @@ desiredReason, reason); } + return reason; } );