Skip to content

Commit 7d699f6

Browse files
author
Artemis330
committed
Remove non-existent parameter from getByText (#165)
1 parent 407db5e commit 7d699f6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/react-testing-library/cheatsheet.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,18 @@ Given the following HTML:
158158

159159
```javascript
160160
// Matching a string:
161-
getByText(container, 'Hello World') // full string match
162-
getByText(container, 'llo Worl', { exact: false }) // substring match
163-
getByText(container, 'hello world', { exact: false }) // ignore case
161+
getByText('Hello World') // full string match
162+
getByText('llo Worl', { exact: false }) // substring match
163+
getByText('hello world', { exact: false }) // ignore case
164164

165165
// Matching a regex:
166-
getByText(container, /World/) // substring match
167-
getByText(container, /world/i) // substring match, ignore case
168-
getByText(container, /^hello world$/i) // full string match, ignore case
169-
getByText(container, /Hello W?oRlD/i) // advanced regex
166+
getByText(/World/) // substring match
167+
getByText(/world/i) // substring match, ignore case
168+
getByText(/^hello world$/i) // full string match, ignore case
169+
getByText(/Hello W?oRlD/i) // advanced regex
170170

171171
// Matching with a custom function:
172-
getByText(container, (content, element) => content.startsWith('Hello'))
172+
getByText((content, element) => content.startsWith('Hello'))
173173
```
174174

175175
**[Get the printable cheat sheet][cheatsheet]**

0 commit comments

Comments
 (0)