Skip to content

Instanceof-Operator: (instance(mock(MyClass)) instanceof MyClass) is false. #37

@Hirschfuchs

Description

@Hirschfuchs

As mentioned in NagRock#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions