Skip to content

*ByText options has incorrect type #921

Closed
@vovanezha

Description

@vovanezha
  • @testing-library/dom version: 7.28.1
  • Testing Framework and version: jest 26.6.1
  • DOM Environment: jsdom 16.4.0

Relevant code or config:

screen.getByText('hello', { ignore: 'my-selector' });

What you did:

I'm trying to use ignore option in getByText method

What happened:

Argument of type '{ ignore: string; }' is not assignable to parameter of type 'SelectorMatcherOptions'.
  Object literal may only specify known properties, and 'ignore' does not exist in type 'SelectorMatcherOptions'

Reproduction:

https://codesandbox.io/s/misty-pond-hg7s7?file=/src/__tests__/index.tsx:0-220

Problem description:

The option is described in official docs and exists in codebase, but not in the types

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions