mardi 16 août 2016

Testing instantiating a new class with sinon

I have some code I want to test:

import {MyClass} from 'something';

export function doSomething{
  return (new MyClass()).functionCall();
}

Using sinon, how can I test that a new instance of MyClass was instantiated and that the call to functionCall() was actually called?

Aucun commentaire:

Enregistrer un commentaire