Skip to content

Jest: Cannot assign to read only property '...' of object '...' #18758

Closed
@bvaughn

Description

@bvaughn

Right now in the React repo this test...

fit('blah', () => {
  expect(document.createElement('div')).toBe(document.createElement('div'));
});

...fails with the following meaningless error message:

TypeError: Cannot assign to read only property 'Symbol(impl)' of object '[object DOMImplementation]'

Screen Shot 2020-04-27 at 2 04 19 PM

Apparently @trueadm mentions that this broke sometime recently because of a change we made. (I don't have details.) Its a pretty confusing behavior though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions