Skip to content

Spying support

Compare
Choose a tag to compare
@NagRock NagRock released this 28 Sep 09:35
· 162 commits to master since this release

Thanks to @dreef3 we got new spying feature!

Usage:

const foo: Foo = new Foo();
const spiedFoo = spy(foo);

when(spiedFoo.getBar(3)).thenReturn('one');

console.log(foo.getBar(3)); // 'one'
console.log(foo.getBaz()); // call to a real method