[WebODF] RFC: Move to a standard JS test framework (e.g., jasmine)
Philip Peitsch
philip.peitsch at gmail.com
Mon Sep 15 11:08:15 CEST 2014
> 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);
});
});
});
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://open.nlnet.nl/pipermail/webodf/attachments/20140915/5b3c63a8/attachment.html>
More information about the WebODF
mailing list