Skip to content

Releases: NagRock/ts-mockito

Added possibility to reset and resetCalls for multiple mock instances

08 Jun 19:46
Compare
Choose a tag to compare

Now we can use: reset(firstMock, secondMock, thirdMock), resetCalls(firstMock, secondMock, thirdMock)

Type check support for deepEqual matcher

13 Sep 11:07
Compare
Choose a tag to compare

Thanks to @bricka we got support for deepEqual matcher.

If provided arguments to deepEqual matcher are compatible no action is required.

But this update can cause compilation errors on existing code if provided values to deepEqual type is not compatible. For example if expected param has more fields than provided one.

For easy migration you can use Partial class.

Before:

const expectedParams = {
  sampleField: 'sampleValue',
};
verify(mock.test(deepEqual(expectedParams))).once();

From 2.5.0:

const expectedParams: Partial<MyArgumentType> = {
  sampleField: 'sampleValue',
};
verify(mock.test(deepEqual(expectedParams))).once();

Support for interfaces

20 Jul 21:18
Compare
Choose a tag to compare

It took a lot of time but... looks like we've got support for interfaces 🎉

Simply use generic type for mock function and omit argument for it:

let mockedInterface: MyInterface = mock<MyInterface>();

Great thanks for @johanblumenberg who created first implementation and pushed me to support interfaces. Thanks for your patience.

Fixed: Problem when library unintentionally tries to mock

27 Aug 12:52
Compare
Choose a tag to compare

Resolving / rejecting promises

27 Feb 10:39
Compare
Choose a tag to compare

Default export without self import

26 Feb 14:13
Compare
Choose a tag to compare
v2.2.10

Default export without self import #65

Fixed Maximum call stack size exceeded error #82

31 Jan 13:04
Compare
Choose a tag to compare
v2.2.9

Fixed Maximum call stack size exceeded error #82

Fixed issue #80 instance function had different behavior with and without Proxy support

23 Jan 16:08
Compare
Choose a tag to compare

Fixed bug #80 that instance function worked different if Proxy was supported or not
With Proxy support instance function always returned new object, without support it was always same instance. Now instance function always returns same object.

Fixed issue #66 spying on object with property with defined value caused error

17 Nov 19:05
Compare
Choose a tag to compare
v2.2.7

Fixed issue #66 spying on object with property with defined value cau…

Added default export to allow ts-mockito to be used with ember-browserify

17 Oct 08:08
Compare
Choose a tag to compare
v2.2.5

Added default export to allow ts-mockito to be used with ember-browse…