lundi 26 janvier 2015

How do I use Sinon with Typescript?

If I use sinon with typescript then how do I cast the sinon mock to an instance of my object?


For instance a SinonMock would be returned but my controller under test may require a specific service passed in to its constructor.



var myServiceMock: MyStuff.MyService = <MyStuff.MyService (sinon.mock(MyStuff.MyService));

controllerUnderTest = new MyStuff.MyController(myServiceMock, $log);


Can sinon be used with Typescript?


Thanks in advance!


Aucun commentaire:

Enregistrer un commentaire