Skip to content

Releases: NagRock/ts-mockito

Fixed ObjectPropertyCodeRetriever toString issue

14 Oct 17:35
Compare
Choose a tag to compare

Fixed a null pointer exception occuring in some specific cases.

Fixed ProxyHandler ES5 type error

13 Oct 08:33
Compare
Choose a tag to compare
v2.2.3

Fixed ProxyHandler ES5 type error

Fixed verifying call count

04 Oct 20:33
Compare
Choose a tag to compare

Fixed #48
Fixed verifying call count when not all optional arguments was given

Mocking properties

04 Oct 13:02
Compare
Choose a tag to compare

Thanks to @Markus-Ende we can now mock propertie that aren't getters.

Please note, that stubbing properties that don't have getters only works if Proxy object is available (ES6).

Spying support

28 Sep 09:35
Compare
Choose a tag to compare

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

Fixed mocking methods with optional arguments

01 Sep 13:25
Compare
Choose a tag to compare
v2.1.1

issue #36 - fixed mocking methods with optional arguments

Abstract and generic types mocking

10 Aug 18:44
Compare
Choose a tag to compare

Thanks to @dyong0 we can now mock abstract and generic classes via #31

Bug fix

11 Jul 08:31
Compare
Choose a tag to compare

Fixed #28

2.0.0 New API for stubbing and capturing

28 Apr 13:20
Compare
Choose a tag to compare

Added functionality to change getter value

13 Mar 12:44
Compare
Choose a tag to compare

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);