Re: Testing Javascript

[email protected] Thu, 26 Jun 2008 07:13:00 -0000
Newsgroups gmane.comp.python.quotient.dev
Message-ID <20080626071300.25821.931905709.divmod.xquotient.10229@joule.divmod.com>
On 12:28 am, [email protected] wrote:
>Sometime back in 2006 I worked on some Javascript testing stuff with
>Divmod. I'm vaguely interested in what's happened with it, but that's
>not the main point of this email.
>
>What I'd really like to know is what's your overall strategy to
>testing Javascript on your websites. What tools do you use? Do you
>have it integrated into your main buildbot runs? Is it fast? What are
>your main gripes with what you've got?

As far as I know, not much has changed in the test support code that you =

wrote.  We're still using it.  It's integrated into our buildbot runs =

(although our buildbot is a complete mess at the moment, a disaster area =

that I hope Allen will get to fixing soon).

It's perfectly fast; we've never had a problem with speed, AFAIK.

My main gripe with it is that it's a poor integration environment.  The =

JavaScript test environment is radically different from a browser, and =

we don't have enough test support code that emulates different browser =

behaviors.  Ideally, any test that touched the "document" or "window" =

object would be run multiple times, with behaviors for each browser.

There's also the fact that it's unreasonably difficult to get something =

approximating the actual DOM structures that the code will be operating =

on into the test environment.  For the cleanliness of the tests this is =

actually a good thing; it forces the code to be more independent of the =

resources it's operating on.  However, it also makes the tests less =

realistic, because it forces you to replicate a minimal representation =

of the data dependencies and there's no way to make sure that it's an =

accurate minimal representation.

Is that what you're looking for?