Apache – Unit Testing Flex/Flash Libraries in FlashBuilder

apache-flexflashswcunit testing

For a normal Flash/Flex application I would include my Unit Tests in my application project (perhaps in a tests source folder alongside my main src folder). I'd then have two application entry points: the app, and it's tests.

How are people doing this for their Flex Library Projects? You know, the kind that produces a SWC file. As far as I can tell, you can't set an executable entry-point for these projects (to run the tests).

Best Answer

In Flash Builder Beta 1 onwards itself, you can write and execute Flexunit tests from a library project.

You can use the IDE integration feauture of FlexUnit, and select the project, folder , class or method from the context menu and use "Execute Flex Unit Tests". This will create the application file of the required syntax, run the application and show the results in the FB. You can even select from the result and run the tests are requried.

Related Topic