GJS Porting (Advice?)

48 views
Skip to first unread message

Devin Ekins

unread,
Sep 27, 2013, 12:34:20 PM9/27/13
to jasmine...@googlegroups.com
I am planning on porting Jasmine to GJS as it seems to be the best JS testing framework out there.  I am somewhat new to Jasmine and will need to become very familiar with it soon.

Aside from basic familiarity, are there any specific challenges I should be aware of once I start my attempt to port Jasmine to GJS?  Any advice in general?

Rajan Agaskar

unread,
Sep 27, 2013, 6:00:15 PM9/27/13
to jasmine...@googlegroups.com
If GJS is 'pure' javascript, or syntax compatible w/ pure js, I imagine it should 'just work'. I believe the only browser specific stuff we have it there is around setTimeout, etc. Let us know what you find. 

Thanks!
R.


On Fri, Sep 27, 2013 at 9:34 AM, Devin Ekins <devinj...@gmail.com> wrote:
I am planning on porting Jasmine to GJS as it seems to be the best JS testing framework out there.  I am somewhat new to Jasmine and will need to become very familiar with it soon.

Aside from basic familiarity, are there any specific challenges I should be aware of once I start my attempt to port Jasmine to GJS?  Any advice in general?

--
You received this message because you are subscribed to the Google Groups "Jasmine Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jasmine-js-de...@googlegroups.com.
To post to this group, send email to jasmine...@googlegroups.com.
Visit this group at http://groups.google.com/group/jasmine-js-dev.
For more options, visit https://groups.google.com/groups/opt_out.

Devin Ekins

unread,
Oct 18, 2013, 12:24:30 PM10/18/13
to jasmine...@googlegroups.com
I'm having trouble just getting Jasmine running in my environment.  Is Jasmine always run inside of an actual (or virtual) browser environment?  My goal is just to run it via the command line, but after cloning it from github, I'm not sure how to set it up for use on arbitrary files without using Rhino and env.js (which I'd prefer to avoid, unless it is a one-time setup cost.)

Any places I should be looking for a browserless setup?

Davis W. Frank

unread,
Oct 18, 2013, 12:34:59 PM10/18/13
to jasmine...@googlegroups.com
Do you mean "browser-less" or do you mean "headless browser"?

The Jasmine Ruby gem and gruntjs (grunt-contrib-jasmine) both run Jasmine suites in Phantom, a headless webkit.

Is that what you're looking for?

--dwf
--
thx,
--dwf

Devin Ekins

unread,
Oct 18, 2013, 12:52:50 PM10/18/13
to jasmine...@googlegroups.com
Excellent question.  It got me to revisit what a "headless browser" meant.  (I misunderstood it the first time around!)  

I would prefer using as few (additional) frameworks as possible.  A headless browser as I now understand it would be fine, but the recommendation for Spidermonkey ports of Jasmine were using Rhino and env.js, which requires Java.  Will I have to run the JVM every time I want to run the headless browser for any use of Jasmine?  If there is a solution that doesn't require me to use the JVM, I'd be happier. 

Thank you for your patience.

Devin Ekins

unread,
Oct 18, 2013, 12:56:31 PM10/18/13
to jasmine...@googlegroups.com
Hah! PhantomJS should do exactly what I want.  Thank you for pointing me in that direction.

Devin Ekins

unread,
Oct 25, 2013, 1:58:14 PM10/25/13
to jasmine...@googlegroups.com
So I'm trying to do this with no browser, headless or not.  

Thus, I need to set up an environment for it to run in.  I'm attempting to mimic https://github.com/pivotal/jasmine/blob/master/spec/node_suite.js .  Given my extremely limited familiarity with Jasmine's source code, this has proven challenging.  I have tests running and always failing with little more than a stack trace given as output.  Every test that is run contains a stack trace that loops through a few calls:

@./ConsoleReporterSpec.js:216
  attemptSync@lib/jasmine-core/jasmine.js:1488
  QueueRunner.run@lib/jasmine-core/jasmine.js:1476
  Env/queueRunnerFactory@lib/jasmine-core/jasmine.js:498
  Spec.execute@lib/jasmine-core/jasmine.js:302
  Suite.execute/wrapChildAsAsync/<@lib/jasmine-core/jasmine.js:1701
  attemptAsync@lib/jasmine-core/jasmine.js:1498
  QueueRunner.run@lib/jasmine-core/jasmine.js:1474
  QueueRunner.run/attemptAsync/next@lib/jasmine-core/jasmine.js:1495
  complete@lib/jasmine-core/jasmine.js:325
  clearStack@lib/jasmine-core/jasmine.js:490
  QueueRunner.run@lib/jasmine-core/jasmine.js:1483
  Env/queueRunnerFactory@lib/jasmine-core/jasmine.js:498
  Spec.execute@lib/jasmine-core/jasmine.js:302
  Suite.execute/wrapChildAsAsync/<@lib/jasmine-core/jasmine.js:1701

Now you can already see that this is repeating a pattern after a while.  Every test repeats this pattern one more time than the last.  Now I currently haven't replaced any "timer" code (which I know I'll need to do at some point.)  Is that part of the issue as it is part of that wrapChildAsAsync method?  Or can you already tell some other obvious mistake must have been made?  I'll post source code if necessary, but not just yet.

Davis W. Frank

unread,
Oct 25, 2013, 2:24:42 PM10/25/13
to jasmine...@googlegroups.com
At this point, yes, you need to post some code that demonstrates the error.

Note that node is not officially supported yet. But will be soon after 2.0 ships.

--dwf


--
You received this message because you are subscribed to the Google Groups "Jasmine Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jasmine-js-de...@googlegroups.com.
To post to this group, send email to jasmine...@googlegroups.com.
Visit this group at http://groups.google.com/group/jasmine-js-dev.
For more options, visit https://groups.google.com/groups/opt_out.



--
thx,
--dwf

Devin Ekins

unread,
Oct 25, 2013, 2:29:40 PM10/25/13
to jasmine...@googlegroups.com
Alright, I'll attempt to reproduce the error with a minimal amount of code.  Currently, I have a bit of a mess -- just trying to get something working (spiking) rather than crafting a well engineered test runner.  I'll post back here later today.

Devin Ekins

unread,
Oct 25, 2013, 5:45:34 PM10/25/13
to jasmine...@googlegroups.com
The following gist contains a test runner that fails in the manner I specified earlier.  It contains the nodejs version of the driver in commented-out form above the ported code I wrote. (It alternates between nodejs and gjs code, but the sections where no change seemed necessary does not contain a commented out duplicate.)


Thank you for any assistance.


On Friday, September 27, 2013 10:34:20 AM UTC-6, Devin Ekins wrote:
Reply all
Reply to author
Forward
0 new messages