Skip to content

Cannot mock property name #4

@Socolin

Description

@Socolin

Hello,

This give me the following error

const frameMock = TypeMoq.Mock.ofType<HTMLIFrameElement>();
frameMock.setup(x => x.id = TypeMoq.It.isAnyString()).verifiable();
frameMock.setup(x => x.name = TypeMoq.It.isAnyString()).verifiable();

TypeError: 'set' on proxy: trap returned falsish for property 'name'

I'm getting the same error if I don't setup this mock and I directly call

frameMock.object.name = 'abc';

It's working on any other properties like id, src etc.. but not name

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