views:

94

answers:

1

I'm building a small JavaScript application in Adobe AIR and I'm looking for some general advice for automated unit testing.

I'd like to be able to run a suite of unit tests from the shell (maybe from a Makefile or similar).

My initial thought was to use something lightweight like jsUnity to run test scripts from within Rhino. I could provide a mock browser environment with env.js. But I'd need stubs for the AIR runtime, which I couldn't find. (I suppose I could write them, but that would be tedious.)

Or is there support for this in AIR already, and I've just missed it?

Any general hints and tips on how to get started would be appreciated.

A: 

I'm using google closure.

Added a second application start file called run_tests.xml which references a test runner which in turn references all the tests in the air project.

You could use the test runner all_tests.html which is included in the closure project and change the alltests.js file to include your tests. Then copy them both to your app folder.

From the shell you can just type "adl run_tests.xml".

neshaug

related questions