ts-mockito
ts-mockito copied to clipboard
Instanceof-Operator: (instance(mock(MyClass)) instanceof MyClass) is false.
trafficstars
As mentioned in https://github.com/NagRock/ts-mockito/issues/204 it is not possible to use the „instanceof“ operator on an instance of a mock. There are workarounds but the native functionality would be nice.
Example:
const mockedInstanceOfMyClass = instance(mock(MyClass)) console.log(mockedInstanceOfMyClass instanceof MyClass) // false, should be true
Can you provide with a code sample of usage? I want to provide the solution but it depends on the ergonomics of the usage.