[Cosmo-dev] [Proposal] Use Windmill for JS Unit testing
br at osafoundation.org
Fri Mar 30 15:16:35 PST 2007
On Mar 30, 2007, at 4:01 PM, Mikeal Rogers wrote:
> Can anyone tell me why jsunit is so overly complex?
> Honestly I think the easiest thing to do would be replace jsunit
> with something easier to use and write tests in.
> - There is no reason that unit test suites can't just be a
> single .js file
They are already.
> - There is no reason that we can't cut out most of the setup steps
> to write tests by just loading a page in windmill before running
> tests, setting up all the regular application environment
No, we need to be able to run the unit test without windmill, or any
server, just in a browser.
> - Replacing the assertion module jsunit uses (http://
> www.jsunit.net/) is about an hour long task and could free us of
> all this cruft.
> I really just don't get this. You _must_ run these tests in the
> browser, so why go so far out of your way to not load the regular
> application environment before running the unit tests, instead you
> have to setup half of the application environment yourself in the
Well, yes. That's not the problem of JsUnit, that's our problem -
sometimes we haven't been able to separate concerns properly, and our
sometimes code depends on other code being initialized. We are trying
to minimize this.
> I might just be totally missing the point but I don't see any
> reason for unit tests to be html pages, the code below should be
> enough to define a unittest.
They don't have to be...and they actually aren't. Not sure what
you're looking at, but you should check out as an example:
More information about the cosmo-dev