Search code examples
apache-flexunit-testingflash-builderpuremvctest-suite

Flash Builder: Change default suite for unit tests?


What are the steps to change your default suite when running unit tests in Flash Builder 4 with PureMVC?


Solution

  • In order to change or add to the test suites, I had to change the test suite in the listener for the startup event on the mediator for the application component.

    override public function handleNotification( note:INotification ):void
    {
        switch ( note.getName() )
        {
            case NotificationConstants.STARTUP_SUCCESS:
    
                flexUnitApplication.testRunner.runWithFlexUnit4Runner(currentRunTestSuite(), "MyTests");
                break;
        }
    }
    
    private function currentRunTestSuite():Array
    {
        var testsToRun:Array = new Array();
        testsToRun.push(MyTestSuite);
        return testsToRun;
    }