-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
instanceof doesn't seem to work with class mocks #969
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In our tests we want to mock classes. When mocking them with the
createMock
function, theinstanceof
operator is not returning true when checking for the to be mocked class:I'm not sure if this is a bug or not, but it prevents us from using the mock as a direct substitute, because our code depends on the
instanceof
operator returningtrue
.Workaround is possible by using
Object.setPrototypeOf(myPerson, Person.prototype);
.The text was updated successfully, but these errors were encountered: