Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

  (email not shown publicly)
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Thursday September 08, 2005
06:42 PM

Integrating Perl and Javascript tests

[ #26650 ]

Want fame and fortune? Have more tuits than I do? Integrate Perl and Javascript tests. Here's how.

I'm writing Javascript tests for Bricolage 2.0 and realize I have a huge problem. The JS tests are run through a HTML document that passes a form object to a class:

JSAN.includePath = ['../../../www/js'];

var search_form = document.search_form;
var url         = new Kinetic.Search().buildURL(search_form);
var expected    = '';
is(url, expected, 'search_form should return the correct URL');

Now this is all well and good, but there's a serious problem here. The search forms are generated dynamically. I'm about to change how they work but I really don't want to have to keep remembering to update the form in my tests. It dawned on me that I could get around this by using HTTP::Server::Simple to generate forms and have the Javascript tests run against those. Thus, they're always running against real Perl code. I understand that Apache test may come close, but I don't know if it can run the Javascript tests.

Since I'd already be running a simple server, why not have the server run the real Perl test suite and pass those results to the Javascript Test.Builder? By running one server, I could run my Javascript and Perl tests at the same time. Cunning, eh?

Now if only I had the time to indulge in this ...

I'm sure you'd win many admirers if you have more time for this than I do :)

In fact, if you set it up so it can collect any valid TAP results, we could integrate just about any programming language tests with JavaScript. I don't know if this has ever been done before.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.