[OpenLayers-Dev] Re: Jasmine and EnvJS
Eric Lemoine
eric.lemoine at camptocamp.com
Tue Sep 27 17:54:34 EDT 2011
On Tue, Sep 20, 2011 at 9:59 PM, Eric Lemoine
<eric.lemoine at camptocamp.com> wrote:
> Hi
>
> During the FOSS4G code sprint I spent some time playing around with
> the Jasmine testing framework and EnvJS. I tried the latter in an
> attempt to run tests outside the browser. For those interested I've
> gathered notes on a wiki page:
> <http://trac.osgeo.org/openlayers/wiki/Future/Jasmine>. I hope to be
> able to continue working on that.
Some news on the Jasmine front.
I now have Jasmine tests for OpenLayers that run both in the browser
and headlessly using PhantomJS (http://www.phantomjs.org/). PhantomJS
is a headless WebKit; it is cool, simple to use, and it works great
with Jasmine (as long as you have QtWebKit > 4.6).
Some links and information:
- My "jasmine" branch: <https://github.com/elemoine/openlayers/tree/jasmine>.
- The "tests/jasmine" directory this branch adds:
<https://github.com/elemoine/openlayers/tree/jasmine/tests/jasmine>.
Includes the Jasmine lib, test files (known as spec files in Jasmine
jargon), and a PhantomJS script for running the tests with PhantomJS.
The README.txt includes instructions for running the tests with
PhantomJS.
- The OpenLayers.Map tests I've written so far (not that much):
<https://github.com/elemoine/openlayers/blob/jasmine/tests/jasmine/spec/Map.spec.js>.
- OpenLayers with Jasmine In Action:
<http://elemoine.github.com/openlayers/tests/jasmine/SpecRunner.html>.
Check "Show" in the top-right corner of the page to display more
details about the tests.
All this is pretty early-stage, but it looks promising to me.
What do you think? Is this work worth pursuing? Would people like to
write, or agree with writing, new tests with Jasmine? Is hoping that
the community could help move existing tests to Jasmine just a dream
of mine?
I'm planning to complete the OpenLayers.Map tests, and give some love
to my PhantomJS script.
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Dev
mailing list