Closed juliemr closed 9 years ago
Got minijasminenode working with 2.0: https://github.com/juliemr/minijasminenode/tree/jasmine2
The only regression is that there is now no way to specify a timeout for only one spec :(
Raised an issue https://github.com/pivotal/jasmine/issues/483 to see if we can perhaps find a way around this.
See Karma's update for reference: https://github.com/karma-runner/karma-jasmine/commit/4e0b48aa3703db0d9b785fc32b720defd93156bd
And fixing iit/ddescribe: https://github.com/karma-runner/karma-jasmine/commit/07ddb36b4ca662c414ccbc5af29df8d2da1e5019
What's remaining to support updating Jasmine to 2.0? I'd be interested in working on this one.
Ah, I see #483, I'll look into it.
@BrianGeppert at this point I'm mostly waiting on Jasmine to update itself. They've said they're going to be adding an npm module, so to reduce churn later I was just waiting for that.
Makes sense. Thanks!
Is there any changes? :+1: for Jasmine 2.0.
Status update:
We've decoupled more of the protractor versus Jasmine system, so now there are three npm packages at play: protractor, jasminewd, and minijasminenode.
I've released minijasminenode2, which is an adapter for Jasmine 2.0 to node.js. It's available for download (npm install minijasminenode2
).
Getting JasmineWD to work with minijasminenode2 has proved difficult. We're losing some functionality, and there's no user-visible benefits. The full discussion is here: https://github.com/angular/jasminewd/pull/5. So, for the moment, we're going to hold off on updating JasmineWD or Protractor to use Jasmine 2.0. What we'll probably do is eventually make this a separate framework option, so folks happy with the status quo can continue without breaking changes and you can use --framework jasmine2
if you care about a particular feature from Jasmine 2.0.
The end user benefit from updating to Jasmine 2.0 is significant, as Jasmine 2.0 makes async tests sane. The 1.x branch has a pretty annoying syntax for that.
@panuhorsmalahti
The end user benefit from updating to Jasmine 2.0 is significant, as Jasmine 2.0 makes async tests sane. The 1.x branch has a pretty annoying syntax for that.
Yeah, that's true. I couldn't believe how terrible async testing was in 1.x with all this manual waiting etc.
Amen!
Sent from my Sony Xperia™ smartphone
---- Michał Gołębiowski wrote ----
@panuhorsmalahti
The end user benefit from updating to Jasmine 2.0 is significant, as Jasmine 2.0 makes async tests sane. The 1.x branch has a pretty annoying syntax for that.
Yeah, that's true. I couldn't believe how terrible async testing was in 1.x with all this manual waiting etc.
— Reply to this email directly or view it on GitHub.
...that said, Protractor has its own async handling so that may be not important here.
It's nice to be able to use the same Jasmine version in unit tests & e2e ones to not require context switch, though.
Any progress on this or has it been parked?
I'd love to see Jasmine 2's support for pending tests (in Jasmine 1.3 you cannot mark as a test as xit, but then it doesn't get returned in the results, whereas in Jasmine 2 it will be displayed in the results as pending).
This may sound trivial, but given our workflow it would save a lot of time.
Any suggestions of alternative ways to achieve the same effect would be gratefully received (an easy way to view pending tests without causing the test to fail and so polluting the terminal when you're trying to debug).
Is there a way to generate report using jasmine 2.0 ?
+1 on adding 2.0 support.
Is this still actively being looked at? Otherwise I might give it a shot.
Hi all,
Jasmine 2.0 is not on my todo soon (tm) list at the moment. (e.g., I'm not going to look at it in the next month). The issues at angular/jasminewd#5 are still relevant - if anyone wants to update that PR to address the missing features I'd take a look at it.
Just opining that if this project is looking at upgrading Jasmine support - it should go straight to 2.1. Support for beforeAll and afterAll without additional dependencies would be great
@gamebox Agreed, we'll just go to the latest.
The current plan is to support Jasmine 2.something as a different framework option, since there will be some loss of features. @hankduan
is there any progress with that? it would be great to have even jasmine 2.1, which has beforeAll().
@mhaligowski I have a jasmine 2.1.3 branch at https://github.com/xdissent/protractor/tree/jasmine-2 that works great but it depends on forks of jasminewd and minijasminenode2 (juliemr/minijasminenode#27, https://github.com/xdissent/jasminewd/tree/jasmine-2). It also alters the existing framework rather than adding an additional one as @juliemr mentioned. But if you just want jasmine 2 now (like me) it gets the job done. Anyway, jasminewd and minijasminenode2 must be updated before protractor can make a move.
jasmine2 is added into protractor via 1e60a95
As mentioned in https://github.com/angular/protractor/pull/1675, there are two caveats:
it
, fit
, etc does not work yet. Pending https://github.com/jasmine/jasmine/commit/a4faa80be464b1054293ac3179eb21b2ccc8c472done.fail('xyz')
because jasmine2 does not allow custom stacktrace. Filed an issue at https://github.com/jasmine/jasmine/issues/734So timeout for individual test has been fixed? I tried running my test with jasmine2. It gives me timeout error.
I'm not sure what is your question. Jasmine2 doesn't make timeouts all magically disappear. If your test doesn't finish without a specified time, or your app isn't load, etc, your test will still time out. See https://github.com/angular/protractor/blob/master/docs/timeouts.md
So I want to know how to setup timeout for individual test with jasmine2. Before I was doing it in this way : it(description, testFn, timeout_in_millis). And it worked when my jasmine version was <2. I upgraded jasmine version and now I get following error: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL
@nishakchaudhari : I started using protractor and jasmine 2 and I am also facing the same issue. Any work around for this??
upgrade jasmine version to 2.3.1 . jasmine 2.3.1 supports timeout for individual test .
How to update jasmine version. I am currently using 1.3.1 and protractor version is 2.1.0. Can anyone say that how to update jasmine version. I am new to this. Thanks..
how can I have beforeAll wait for async calls in Jasmine 2.0? Thanks.
This should be in sync with Karma, probably. See https://github.com/karma-runner/karma-jasmine/issues/15