Create FlexUnit Tests Quickly in IntelliJ IDEA
First of all make sure that flexunit.swc is within your module dependencies:
and just press Ctrl+Shift+T (Cmd+Shift+T on Mac) or select Navigate | Test from main menu:
Options to generate
tearDown() as well as test method stubs are available in test creation dialog:
And here you are!
Adding more tests is easy as well. Press Alt+Insert (Ctrl+Enter on Mac) and select to generate test method:
Hint: To be sure that test classes and FlexUnit classes won’t occasionally appear in production SWF/SWC follow these two good style suggestions:
- configure dependency on FlexUnit library with ‘Test’ scope (as shown on the first screenshot)
- keep test classes in a separate source folder marked as test source folder:
Test with pleasure!