Sinon spy not registering

59 views Asked by At

What's the correct syntax for this?

// In source-code
function Foo() {
    var bar = new Bar();
}

// In tests
var spy = sinon.spy(Bar);
var foo = new Foo();
console.log(spy.callCount);

I expect spy.callCount to be 1, but it is 0.

Is this possible without modifying the source?

0

There are 0 answers