Skip to content

Added mock resetting functionality

Compare
Choose a tag to compare
@NagRock NagRock released this 05 Jan 10:03
· 219 commits to master since this release

Now we can reset mocks using reset(mock); function.

Example:

let mockedFoo:Foo = mock(Foo);
let foo:Foo = instance(mockedFoo);
foo.getBar();
verify(mockedFoo.getBar()).once(); // getBar has been called once
reset(mockedFoo); // reset mock call counter
verify(mockedFoo.getBar()).never(); // getBar has not been called after reset