Testing ActionScript and Flex Applications
IntelliJ IDEA supports the versions 0.9 and 4 of FlexUnit, a unit testing framework for Flex and ActionScript applications and libraries.
For running FlexUnit tests, there is a dedicated run/debug configuration type ( FlexUnit).
The FlexUnit-specific tasks are briefly outlined below. For general instructions, see Testing.
Preparing for writing FlexUnit tests
Download and decompress the archive containing FlexUnit libraries.
(The corresponding archives (
.zip) are available, for example, on the FlexUnit Downloads page. The archive name, normally, starts with
The only file that you'll need is the core FlexUnit library (
.swc). Depending on the FlexUnit version, this file may be called
flexunit-core-flex-4.1.0-beta1.64-sdk220.127.116.1159.swcor something similar.
- Though this isn't really necessary, it might be useful to define the core FlexUnit library as a global or project library. This will let you use this library in many projects or modules. See Configuring Project and Global Libraries.
- Add the core FlexUnit library to dependencies of one or more of the build configurations. See Managing build configurations and their settings and Build Configuration Page for a Flash Module.
- Make one of these build configurations active. This will ensure that the code in your tests is highlighted properly. See Selecting an active build configuration.
Now you are ready to start developing your test sources.
Running or debugging FlexUnit tests
To run or debug your FlexUnit tests, you can create the necessary FlexUnit run/debug configurations and then use those. Note that the corresponding run/debug configurations should be based on the build configurations that have the core FlexUnit library among their dependencies. See Creating and Editing Run/Debug Configurations and Run/Debug Configuration: FlexUnit.
The other alternative is to run or debug you test package, class or method from within the editor, or the Project or Favorites tool window. (The Run and Debug commands, if appropriate, are available in the context menus.) In such cases you don't even need to create the run/debug configuration prior to running the tests.