IntelliJ IDEA 2017.3 Help

Testing ActionScript and Flex Applications

This feature is only supported in the Ultimate edition.

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 (icon flexunit FlexUnit).

The FlexUnit-specific tasks are briefly outlined below. For general instructions, see Performing Tests.

Preparing for writing FlexUnit tests

To prepare for writing FlexUnit tests, you should add the core FlexUnit library to dependencies of the corresponding build configuration, and make this build configuration active.

Now you are ready to start developing your test sources.

  1. 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 flexunit.)

    The only file that you'll need is the core FlexUnit library (.swc). Depending on the FlexUnit version, this file may be called FlexUnit.swc, flexunit-4.0.0.swc, flexunit-4.1.0-8-as3_4.1.0.16076.swc, flexunit-core-flex-4.1.0-beta1.64-sdk4.0.0.14159.swc or something similar.

  2. 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.
  3. Add the core FlexUnit library to dependencies of one or more of the build configurations. See To manage build configurations and their settings, follow these steps and Build Configuration Page for a Flash Module.
  4. Make one of these build configurations active. This will ensure that the code in your tests is highlighted properly. See To select an active build configuration, follow these steps.

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.

Last modified: 6 March 2018

See Also

Language and Framework-Specific Guidelines: