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
There are 2 tests there. One that should pass because it uses callbacks, and one that should fail because it returns a promise. Needless to say, the one that should fail does indeed fail on native Jasmine 2.4.1.
However, the implementation of asyncTestFn means that you have essentially altered Jasmine's behaviour by making it wait for promises to resolve. If I copy/paste those JSFiddle tests into my editor and run them using protractor, both tests pass.
I think you need to be clear about this in the jasminewd documentation and possibly even the Protractor documentation. I have just spent 2 hours explaining to a colleague why we need the jasmine-promises module, only to be told that "jasmine supports returning promises". I know jasmine doesn't support returning promises. So I sat down to show him these failing tests in protractor and, lo-and-behold, they pass. I then had to sit and read through Jasmine's source code and couldn't find any support for promises. So I decided to do a console.log(beforeEach.toString()) and saw the aforementioned wrapper which indeed makes the test methods support promises.
We are not the only ones confused by this... see this issue as well: angular/protractor#1689
@juliemr correctly replies that Jasmine does not support promises (this is inside the context of a protractor issue) whereas @HenrikBechmann is also quite right, and it is protractor's use of jasminewd that is giving it that support.
Either jasminewd should not modify jasmine's behaviour (a bad idea because jasmine's behaviour sucks), or it should document that it does (and this should be more visible in the protractor documentation because a lot of protractor users probably haven't even heard of jasminewd)
The text was updated successfully, but these errors were encountered:
Hi guys
First, thanks for all your hard work on jasminewd
I have seen this issue #48 asking to support returning promises.
Native Jasmine 2.4.1 does not support returning promises. See this JSFiddle:
http://fiddle.jshell.net/dzeqLg0a/3/
There are 2 tests there. One that should pass because it uses callbacks, and one that should fail because it returns a promise. Needless to say, the one that should fail does indeed fail on native Jasmine 2.4.1.
However, the implementation of asyncTestFn means that you have essentially altered Jasmine's behaviour by making it wait for promises to resolve. If I copy/paste those JSFiddle tests into my editor and run them using protractor, both tests pass.
I think you need to be clear about this in the jasminewd documentation and possibly even the Protractor documentation. I have just spent 2 hours explaining to a colleague why we need the
jasmine-promises
module, only to be told that "jasmine supports returning promises". I know jasmine doesn't support returning promises. So I sat down to show him these failing tests in protractor and, lo-and-behold, they pass. I then had to sit and read through Jasmine's source code and couldn't find any support for promises. So I decided to do a console.log(beforeEach.toString()) and saw the aforementioned wrapper which indeed makes the test methods support promises.We are not the only ones confused by this... see this issue as well:
angular/protractor#1689
@juliemr correctly replies that Jasmine does not support promises (this is inside the context of a protractor issue) whereas @HenrikBechmann is also quite right, and it is protractor's use of jasminewd that is giving it that support.
Either jasminewd should not modify jasmine's behaviour (a bad idea because jasmine's behaviour sucks), or it should document that it does (and this should be more visible in the protractor documentation because a lot of protractor users probably haven't even heard of jasminewd)
The text was updated successfully, but these errors were encountered: