For some reason, addAsync chaining in a flexunit test as described in this article utterly fails to work when I try to do it.
public function testWhatever():void {
var cont:EventDispatcher = new EventDispatcher();
cont.addEventListener("continue", addAsync(verifyFirst, 1000));
cont.dispatchEvent(new Event("continue"));
}
private function verifyFirst(e:Event):void {
var cont:EventDispatcher = new EventDispatcher();
cont.addEventListener("continue", addAsync(verifySecond, 1000));
cont.dispatchEvent(new Event("continue"));
}
private function verifySecond(e:Event):void {
assertTrue(true);
}
If I run this test, verifyFirst gets called but verifySecond does not. I'm assuming this is a bug in flexunit ... is there a workaround?