Ignoring tests

While developing unit tests, there may be a case where a particular test is not relevant at the moment, but will be in the future. For example, a developer may run a number of tests successfully, however a few may fail because a specific feature is not scheduled to be completed until the next release. In this cases it may be natural to simply comment out the failing tests, this, however, may lead to problems down the road.

When it comes time to implement the missing piece of functionality, there is no way to tell exactly how many tests have been commented out from the test case. The [Ignore] Metadata will prevent this issue from occurring. Unlike commenting out a test, the tests decorated with the [Ignore] tag will still appear in the output reminding you to fix and/or complete these methods.

[edit] Ignoring Tests

When ignoring a test, the test will still be built, but will be skipped over when running all tests in the TestCase. The test will still be counted in the total tests count. To ignore a test, simply apply the [Ignore] metadata tag to the the test that will be ignored.

package tests
{
    public class MainCase
    {       
        [Test( description = "This test is not being ignored" )]
        public function mainTest():void{
            // test assertions  
        }

        [Ignore]
        [Test( description = "This test is being ignored" )]
        public function notMainTest():void{
            // test assertions  
        }

    }
}

Flash Builder Premium:

premiumTestViewIgnored.PNG

browserViewIgnored.PNG

Flash Builder Standard, Flex Builder 3, Flex Open Source SDK Running W/ UIListener

UIListenerIgnored.PNG