mercredi 6 juillet 2016

How to verify that a constructor was called using sinon

I need to assert whether a constructor was called using sinon. Below is how I can create a spy.

let nodeStub: any;
nodeStub = this.createStubInstance("node");

But how can I verify that this constructor was called with the relevant parameters? Below is how the constructor is actually called.

 node = new node("test",2);

Any help would be much appreciated.

Aucun commentaire:

Enregistrer un commentaire