Hi Jerome,
I feel sorry that you have not ask earlier. I have been involved with
Javascript development for a while now, and since we have a large code base
in JS, I have had to find a good development workflow, and I want it to be
maven based. Hopelessly, I have not found what I really wanted and I had
finally written my own based on existing pieces I have found.
Javascript Maven Tools (
http://mojo.codehaus.org/javascript-maven-tools/)
was the best maven integration I found, but unfinished, with some issues and
limitations, and using a junit like testing that is not really smart for
javascript IMHO. So I have searched for better javascript testing frameworks
and the RSpec-style JavaScript DSL used by screw-unit have catch me, but I
have finally used its latest incarnation, which is called Jasmine (
http://pivotal.github.com/jasmine/).
In screw-unit, I really dislike the JQuery dependency (especially since I
use a prototypejs based framework), and the storage of test results in DOM
elements. This works great in a browser, but it completely disallow headless
testing and could fails simply due to DOM issue unrelated with your own
test. Jasmine was written by the same guys who have written screw-unit, with
these issues in mind. Jasmine does not have any unnecessary dependency. If
what you are testing is not DOM related, you do not need a DOM for your
test. It also provide the best I have found to test asynchronous behaviors
with simplicity. And for maven integration you have the Jasmine Maven Plugin
(
http://searls.github.com/jasmine-maven-plugin/).
For a complete JS workflow, I have merged the javascript-maven-tool and the
jasmine-maven-plugin (which has evolved afterward). What my implementation
basically provide, is a really full JS dependency management using maven for
both packaging and testing. The plugins use htmlunit to provided different
kind of browser environment, allowing tests to be done in each of them.
There are still some area to improve and documentation has to be written,
but I use it already for several project that could be taken as example. You
could find tools on github:
https://github.com/softec/javascript-maven-toolsand some usages in our
other repositories.
I really do not like the idea of starting now something based on screw-unit,
since Jasmine is the evolution of screw-unit, I see no reason to continue
using screw-unit now, so I am currently -1 for it. At least, I would suggest
to use Jasmine, and its maven plugin, you have my +1 for that. If you want
more, I would be obviously pleased to help you using my own
maven-javascript-tools.
Denis
On Fri, Aug 5, 2011 at 20:27, Roman Muntyanu <rmuntyan(a)softserveinc.com>wrote;wrote:
Sorry for jumping into dev's discussion and for
the off-topic, just can't
stand the desire :)
>* The result page kind of look nice (yes, that
count!)
When I was looking for a wiki, this was reason number one - and that's
how
XWiki won. Guess it's all about the look and the feel
-----Original Message-----
From: devs-bounces(a)xwiki.org [mailto:devs-bounces@xwiki.org] On Behalf Of
Jerome Velociter
Sent: Friday, August 05, 2011 19:55 PM
To: XWiki Developers
Subject: [xwiki-devs] JavaScript unit tests
Hello devs,
I've pushed some javascript tests for the suggest widget to a branch of
xwiki-platform.
I've used screw-unit (
https://github.com/nathansobo/screw-unit) as test
framework.
The system allow to write tests such as
https://github.com/xwiki/xwiki-platform/blob/f684ca0671a354f1e7476cd788a2df…
; and to run them in a test suite (a simple HTML page that runs all tests).
It is integrated with xwiki-platform-web build so that whenever a test
fails, the build fails.
To be completely honest, I didn't do a lengthy market research to see if
there would be more appropriate alternatives. Screw unit got my attention
for the following reasons :
* Tests are elegant and simple
* You can nest feature "descriptions" (specifications) down several levels,
so it's easy to have a good organization
* It has a working maven integration
* The result page kind of look nice (yes, that count!)
I'd like to integrate them in master
WDYT ?
My +1
Jerome.
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Denis Gervalle
SOFTEC sa - CEO
eGuilde sarl - CTO