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?
views:
40answers:
2
A:
Get it by parsing the stacktrace:
var tempError:Error = new Error();
var stackTrace:String = tempError.getStackTrace();
St.Woland
2010-01-21 22:47:19
No, that's FlexUnit 1 -- which I specifically said in my question that I wasn't looking for.
Chris R
2010-01-21 22:49:13
check out the updated answer
St.Woland
2010-01-21 23:04:41
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
2010-08-09 14:48:31