You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I was testing my little Promise/A+ library against the 2.0.0 test suite and after some fiddling it finally passed all tests. Then I got back to testing to see how it's working in the wild and I found this issue; here is my contrived test case:
new Promise(function (resolve, reject) {
var val = Math.random();
if (val >= 0.5) {
resolve(val);
}
else {
reject(new Error('Value "' + val + '" too low.'));
}
})
.then(function (value) {
console.log(' promise.then.resolved', arguments);
return 100 * value;
})
.then(null, function (reason) {
console.warn(' next.promise.then.rejected', arguments);
return 'error handled';
});
What I would have expected is:
val >= 0.5 -> log('promise.then.resolved')
val < 0.5 -> warn('next.promise.then.rejected')
but instead I saw the first promise resolved after val >= 0.5 but the rejection of val < 0.5 didn't propagate to the next promise so in this case there would be no activity.
val >= 0.5 -> log ...
val < 0.5 -> ...
I was wondering if this is the expected behavior; is it just me not getting the specs or is this a bug in the test suite?
Right now I've fixed this in my lib and the tests still pass - don't know what to make of it...
thx
The text was updated successfully, but these errors were encountered:
Hi there, I was testing my little Promise/A+ library against the 2.0.0 test suite and after some fiddling it finally passed all tests. Then I got back to testing to see how it's working in the wild and I found this issue; here is my contrived test case:
What I would have expected is:
val >= 0.5 -> log('promise.then.resolved')
val < 0.5 -> warn('next.promise.then.rejected')
but instead I saw the first promise resolved after val >= 0.5 but the rejection of val < 0.5 didn't propagate to the next promise so in this case there would be no activity.
val >= 0.5 -> log ...
val < 0.5 -> ...
I was wondering if this is the expected behavior; is it just me not getting the specs or is this a bug in the test suite?
Right now I've fixed this in my lib and the tests still pass - don't know what to make of it...
thx
The text was updated successfully, but these errors were encountered: