Skip to content

Type check support for deepEqual matcher

Compare
Choose a tag to compare
@NagRock NagRock released this 13 Sep 11:07
· 10 commits to master since this release

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