Unit Testing AS3 Code on the Flash CS4 Platform
I’m developing a project on the Flash CS4 platform and finally started unit testing my AS3 code. Not doing unit tests seems lazy and negligent. The only reliable unit testing framework I’ve found so far is asunit, which is open source. The Flash CS4 platform has been traditionally targeted at designers and not programmers so unit testing was somewhat neglected in the past.
Installation is very simple. Just unzip the archive and place the as3 folder anywhere on your system. Then in Flash CS4 go to Edit->Preferences and click on the button “Actionscript 3.0 Settings” at the bottom of the popup. You need to add both of the following paths under “Source path”:
as3/src/
as3/test/
IMPORTANT: Don’t just add as3/ otherwise the framework files won’t be found.
That’s all for the installation. For usage, the asunit website has enough information to get you started.