Skip to content

[TypeScript] missing ignore option in ByText queries #407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wild-lotus opened this issue Nov 28, 2019 · 1 comment
Closed

[TypeScript] missing ignore option in ByText queries #407

wild-lotus opened this issue Nov 28, 2019 · 1 comment
Assignees

Comments

@wild-lotus
Copy link

  • 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.

@eps1lon eps1lon self-assigned this Nov 29, 2019
@kentcdodds
Copy link
Member

Hi @CarlosGines, thanks for the issue.

We don't host the TS definitions in this repository. Could you post this to DefinitelyTyped (and perhaps make a pull request to fix this). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants