Skip to content

Global custom query setup example breaks screen #1486

Description

@bogden1

The setup example for adding custom queries globally for (at least) React seems to break screen-specific functionality such as screen.debug().

If I understand correctly (via testing-library/dom-testing-library#516 (comment)) this bit:

const customScreen = within(document.body, allQueries)

should be something like this:

const customScreen = { ...screen, ...within(document.body, allQueries) };

And of course that means you have to import screen, too.

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