Ts Mockito Versions Save

Mocking library for TypeScript

v2.2.4

6 years ago

Fixed a null pointer exception occuring in some specific cases.

v2.2.3

6 years ago

v2.2.2

6 years ago

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

v2.2.1

6 years ago

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

v2.2.0

6 years ago

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

v2.1.1

6 years ago

v2.1.0

6 years ago

Thanks to @dyong0 we can now mock abstract and generic classes via https://github.com/NagRock/ts-mockito/pull/31

v2.0.2

6 years ago

Fixed #28

v2.0.0

7 years ago

All changes described in migration guide

v1.2.0

7 years ago

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