github NagRock/ts-mockito v2.5.0
Type check support for deepEqual matcher

latest releases: v2.6.1, v2.6.0
5 years ago

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

Don't miss a new ts-mockito release

NewReleases is sending notifications on new releases.