NagRock / ts-mockito

Mocking library for TypeScript
MIT License
974 stars 93 forks source link

Add strict mocks to ts-mockito #153

Closed colinbreame-scout24 closed 5 years ago

colinbreame-scout24 commented 5 years ago

ts-mockito does not support strict mocks like the Java version, see https://github.com/mockito/mockito/issues/1097.

Strict mocks are a great way to ensure you have mocked everything you think you have, and to spot changes in behaviour.

NagRock commented 5 years ago

Hi, thanks for reporting this but I think this is not possible with current implementation. Because of interfaces and because in runtime with TS we don't have reflection tools, ts-mockito tries to handle as much functions / properties names as possible. Even those that doesn't exists in mocked class. I think that without TS compiler plugins public API it is impossible.