[Windmill-dev] JS test suite or test setup/teardown

Matthew Eernisse mde at osafoundation.org
Thu Dec 13 21:23:17 PST 2007


Windmill dudes,

Just a quick heads-up -- I've implemented setup/teardown for JS test 
namespace objects.

The API is, as we discussed:

someNamespace.setup
someNamespace.teardown

The setup/teardown can be either a function or array, just like tests, 
and will be executed the same way tests are.

The setup will happen before any tests in a namespace (and its 
sub-namespaces, if any), and the teardown will happen after.

You can hang other properties on the namespace object -- the framework 
will only try to run things that meet both the following criteria:

1. Either an array or function
2. Name is either 'setup' or 'teardown', or begins with 'test_'

You can set up a complex hierarchy of tests if you want to. The  tests 
(and the tests in any nested sub-namespaces) will be run in the order 
they are added to the object -- with the exception of setup/teardown, as 
mentioned above.

What is still missing:

The ability to run only the tests in a particular file, in a particular 
namespace -- or a single test.

I'll need to hash out with Mikeal what the best calling conventions are 
for making that work, but the framework code is already fairly well set 
up to handle it.


Matthew



More information about the Windmill-dev mailing list