views:

40

answers:

2

In FlexUnit 1 it is possible to access the name of the currently-running test using the TestCase.getName() method because all tests subclass TestCase. In FlexUnit 4, however, there's no base class for tests; the tests are identified by annotations. So, how can I replicate the getName() functionality in FlexUnit 4?

A: 

Get it by parsing the stacktrace:

var tempError:Error = new Error();
var stackTrace:String = tempError.getStackTrace();
St.Woland
No, that's FlexUnit 1 -- which I specifically said in my question that I wasn't looking for.
Chris R
check out the updated answer
St.Woland
A: 

You can do this with FlexUnit 4.1 beta 2 or later. See the answer from Michael Labriola at http://forums.adobe.com/thread/692994?tstart=0.

Yaba