Skip to content

Added functionality to change getter value

Compare
Choose a tag to compare
@NagRock NagRock released this 13 Mar 12:44
· 204 commits to master since this release

Now we can change getter value:

// Creating mock
let mockedFoo:Foo = mock(Foo);

// stub getter before execution
when(mockedFoo.sampleGetter).thenReturn('three');

// Getting instance
let foo:Foo = instance(mockedFoo);

// prints three
console.log(foo.sampleGetter);