Skip to content

Commit ad21363

Browse files
authored
Replace the word 'Throw' with 'Throw error' (testing-library#864)
1 parent 4004dc4 commit ad21363

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

docs/queries/about.mdx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ test('should show login form', () => {
5151
- `getBy...`: Returns the matching node for a query, and throw a descriptive
5252
error if no elements match _or_ if more than one match is found (use
5353
`getAllBy` instead if more than one element is expected).
54-
- `queryBy...`: Returns the matching node for a query, and return `null`
55-
if no elements match. This is useful for asserting an element that is not
56-
present. Throws an error if more than one match is found (use `queryAllBy`
57-
instead if this is OK).
54+
- `queryBy...`: Returns the matching node for a query, and return `null` if no
55+
elements match. This is useful for asserting an element that is not present.
56+
Throws an error if more than one match is found (use `queryAllBy` instead if
57+
this is OK).
5858
- `findBy...`: Returns a Promise which resolves when an element is found which
5959
matches the given query. The promise is rejected if no element is found or
6060
if more than one element is found after a default timeout of 1000ms. If you
@@ -85,9 +85,9 @@ test('should show login form', () => {
8585
| `queryBy...` | Return `null` | Return element | Throw error | No |
8686
| `findBy...` | Throw error | Return element | Throw error | Yes |
8787
| **Multiple Elements** | | | | |
88-
| `getAllBy...` | Throw | Return array | Return array | No |
88+
| `getAllBy...` | Throw error | Return array | Return array | No |
8989
| `queryAllBy...` | Return `[]` | Return array | Return array | No |
90-
| `findAllBy...` | Throw | Return array | Return array | Yes |
90+
| `findAllBy...` | Throw error | Return array | Return array | Yes |
9191

9292
</details>
9393

@@ -176,9 +176,8 @@ All of the queries exported by DOM Testing Library accept a `container` as the
176176
first argument. Because querying the entire `document.body` is very common, DOM
177177
Testing Library also exports a `screen` object which has every query that is
178178
pre-bound to `document.body` (using the
179-
[`within`](dom-testing-library/api-within.mdx)
180-
functionality). Wrappers such as React Testing Library re-export `screen` so you
181-
can use it the same way.
179+
[`within`](dom-testing-library/api-within.mdx) functionality). Wrappers such as
180+
React Testing Library re-export `screen` so you can use it the same way.
182181

183182
Here's how you use it:
184183

@@ -403,11 +402,13 @@ const foo = container.querySelector('[data-foo="bar"]')
403402

404403
Do you still have problems knowing how to use Testing Library queries?
405404

406-
There is a very cool Browser extension for [Chrome](https://chrome.google.com/webstore/detail/testing-playground/hejbmebodbijjdhflfknehhcgaklhano/related) and [Firefox](https://addons.mozilla.org/en/firefox/addon/testing-playground/) named Testing Playground,
407-
and it helps you find the best queries to select elements. It allows you to
408-
inspect the element hierarchies in the Browser's Developer Tools, and provides you
409-
with suggestions on how to select them, while encouraging good testing
410-
practices.
405+
There is a very cool Browser extension for
406+
[Chrome](https://chrome.google.com/webstore/detail/testing-playground/hejbmebodbijjdhflfknehhcgaklhano/related)
407+
and [Firefox](https://addons.mozilla.org/en/firefox/addon/testing-playground/)
408+
named Testing Playground, and it helps you find the best queries to select
409+
elements. It allows you to inspect the element hierarchies in the Browser's
410+
Developer Tools, and provides you with suggestions on how to select them, while
411+
encouraging good testing practices.
411412

412413
## Playground
413414

0 commit comments

Comments
 (0)