Howto mock a Worker ?

25 views
Skip to first unread message

David Mouton

unread,
Dec 4, 2012, 4:23:41 AM12/4/12
to haxe...@googlegroups.com
Hi all,
I'm writing some unit test.
I have one class wich use an instance of a Worker

public function new( worker:Worker, playerId:String)
   
{
        init
();
        _playerId
= playerId;
        _woker
= worker;
        _woker
.onmessage = worker_messageHandler;
   
}

Usually, i use an interface like IWorker to use a mock instead of a Worker, but Worker has no interface.
So i tried to extends Worker with my mock, but there is a JS error at runtime, maybe beacuse this is an extern clas or a native things.

Any idea ?
Reply all
Reply to author
Forward
0 new messages