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
it('should permit comments in project file',function(){returnloadFile(projectFile).should.be.ok;});
This test always pass, while is obvious that the promise is being rejected. What am I missing?
I read about issue #56 but this doesn't seem the case ( or is it?? ) as I'm rejecting with a proper Error.
If I change the code to use eventually:
it('should permit comments in project file',function(){returnloadFile(projectFile).should.eventually.be.ok;});
the test fails, but if I update the code to resolve the promise:
You are not using Chai as Promised here at all. You are using just plain Chai. .should.be.ok tests if the object is truthy. All promises are objects, and so are automatically truthy.
You are not using Chai as Promised here at all. You are using just plain Chai. .should.be.ok tests if the object is truthy. All promises are objects, and so are automatically truthy.
This clarifies a lot the use of eventually ( I misunderstood the Readme ).
Cleaning up my code to create a valid example file I found the error that confused me in the beginning, and was a simple typo ( a P instead of p in one of the test cases, that obviously was always failing :( )
Thanks for the help! Everything is working great now. Closing
Hello, thanks for this library!
I'm stuck in trying to make chai-as-promised work. For some reason tests always pass or always fail, regardless promise result.
"promised" code:
Test code:
This test always pass, while is obvious that the promise is being rejected. What am I missing?
I read about issue #56 but this doesn't seem the case ( or is it?? ) as I'm rejecting with a proper Error.
If I change the code to use
eventually
:the test fails, but if I update the code to resolve the promise:
the test now always fails...
Any help is appreciated :)
The text was updated successfully, but these errors were encountered: