Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Rejecting with a promise is not fully tested #59
For simplicity, it uses
However, all 872 specs of your test suite pass, whether or not I 'adopt the state' of a 'thenable' passed as an argument to the
What is the correct behavior?
Thanks a lot,
@Ziriax It will probably be hard for us to comment, since we don't understand your code nearly as well as you do. If you could provide some sort of minimal test case that shows a potential problem, such as a particular test not matching a part of the Promises/A+ spec, that'd be extremely helpful.
Sorry for not making my question clear enough. I don't understand my own code that much either ;-) I tweaked it until all the specs passed, some of them were really hard to get right.
Let me try to explain my question in detail, with an example.
Consider the following code:
What should be the correct output?
If I keep my promise implementation as initially pasted, I get the output:
However, if I modify my
In this case
Only one of the two behaviors can be correct, but I don't know which one.
So this means that I have two different implementations, both of them passing all the tests, but with different behavior.
The test suite doesn't seem to dictate the correct behavior, or at least not in the context of my own simple promise implementation.
What confused me in the A+ spec was
It's not clear to me what to do when the reason
Thanks a lot,
That means you found a bug in the test coverage; nice!
You should follow the spec, and reject