[WebODF] RFC: Move to a standard JS test framework (e.g., jasmine)
Jos van den Oever
jos.van.den.oever at kogmbh.com
Mon Sep 15 10:13:44 CEST 2014
On 09/15/2014 10:05 AM, Philip Peitsch wrote:
> 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 ;-)
Simply using the test names as we have them now is fine initially. After
jasmine lands we can have a policy to use the behaviour driven testing
method and have an effort to improve the preexisting test descriptions.
> 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.
So we get
it("tests.xml, function () {
it("test1", function () {
}
it("test2", function () {
}
}
Having a test factory that creates the tests for the elements in the xml
is much easier to maintain. I dont quite get how 'each individual “it”
test is specified from the source XML'.
Cheers,
Jos
More information about the WebODF
mailing list