[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 11:14:15 CEST 2014
On 09/15/2014 11:08 AM, Philip Peitsch wrote:
>> 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'.
>>
>
>
> With jasmine you nest the describe blocks to group sets tests[1].
> So, integrating some XML-based tests could be done like:
>
> describe("Operation transform matrix tests", function () {
> it("constructs successfully", function() { ... }); it("cleans up
> all things on teardown", function() { ... });
>
> describe("XML-based transform tests", function() { var xmlFile =
> runtime.readFileSync(...), tests = parseTests(xmlFile);
>
> tests.forEach(function(test) { it(test.name, test.func); }); });
> });
>
That is very nice and simple. I was not sure it() was that flexible,
but it's absolutely logical to use it like that.
I see no remaining roadblocks.
Cheers,
Jos
More information about the WebODF
mailing list