flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesper Birkestrøm <jes...@bluebit.dk>
Subject Async testing with deferred
Date Thu, 17 Apr 2014 07:46:46 GMT
Hi

I am trying to write a test for my web service. I’m using flexunit and have implemented
my service using https://github.com/jonnyreeves/as3-async/.
How do you continue the test without any events triggered? What would be best practice in
this case?

    [Test(async, timeout="1000")]
    public function testRealBackend(member) : void {
	// TODO
	member.should().have.property(’token’);
    }    

    [Before(async)]
    public function setUp():void {
        AuthenticateService.login(‘username', ‘password')
            .completes(function(member:MemberModel) {
		//Continue with tests
            })
            .fails(function(e:Error) {
                throw new Error('Authentication backend not responding: ‘ + e.message);
            });
    }

Venlig hilsen/Best regards
Jesper Birkestrøm
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message