Skip to content

[TypeScript] missing ignore option in ByText queries #407

Closed
@wild-lotus

Description

@wild-lotus
  • DOM Testing Library version: 6.3.0
  • @types/testing-library__dom version: 6.10.0
  • node version: 12.13.0
  • yarn version: 1.19.1

Relevant code or config:

const element = getByText(container, text, { ignore: 'script, style, a' }

What you did:

I tried to use the ignore option in a *ByText query using TypeScript.

What happened:

I get this TypeScript error: 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/dom-testing-library-template-eldsw

Problem description:

Type definitions seem to be missing ignore option for *ByText queries.

Suggested solution:

Adding the missing types.

Metadata

Metadata

Assignees

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