Skip to content

docs: added showSuggestions #477

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

Merged
merged 5 commits into from
May 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/dom-testing-library/api-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ for you to identify the part of your code that resulted in the error (async
stack traces are hard to debug). If you want to disable this, then set
`showOriginalStackTrace` to `false`. You can also disable this for a specific
call in the options you pass to `waitFor`.
`throwSuggestions`: (experimental) When enabled, if [better queries](https://testing-library.com/docs/guide-which-query) are available
the test will fail and provide a suggested query to use instead. Default to `false`.

To disable a suggestion for a single query just add `{suggest:false}` as an option.
```js
screen.getByTestId("foo", {suggest:false}); // will not throw a suggestion
```

`testIdAttribute`: The attribute used by [`getByTestId`](api-queries#bytestid)
and related queries. Defaults to `data-testid`.
Expand Down