[WebODF] RFC: Move to a standard JS test framework (e.g., jasmine)

Philip Peitsch P.Peitsch at qsrinternational.com
Mon Sep 15 10:05:10 CEST 2014


I know and like Jasmine and have used it a few times, see e.g. [1]. It
did not yet exist (at least not in my mind) when WebODF started
getting unit tests.

A few issues that will arise when making this move:

[snip]

2) Jasmine is a behaviour driven testing method. Each test results in
natural language statement that is confirmed of disproved by a test.
So porting is not just code porting but also coming up with nice
descriptions. This requires some creative thinking and will really
improve the readability of the code.

I would push to not tackle this part during the port. I’m a little worried
that such a task would end up bike-shedding and delaying the landing
of the patch :-). My initial idea would be simple to translate calls to the
new jasmine approach, and keep the test names relatively unchanged.

I am open to doing a rough fix-up though if reviewers promise to not
pick at the names I concoct ;-)


3) In some places tests are generated from xml files. I dont know if
Jasmine can handle that.

Jasmine does this quite easily. Basically, the outer-describe closure is
as per normal, and inside, each individual “it” test is specified from the
source XML. It should work largely unchanged from the current version.


Cheers,

Philip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://open.nlnet.nl/pipermail/webodf/attachments/20140915/a88eae6c/attachment.html>


More information about the WebODF mailing list