@@ -158,18 +158,18 @@ Given the following HTML:
158
158
159
159
``` javascript
160
160
// 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
164
164
165
165
// 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
170
170
171
171
// Matching with a custom function:
172
- getByText (container, (content , element ) => content .startsWith (' Hello' ))
172
+ getByText ((content , element ) => content .startsWith (' Hello' ))
173
173
```
174
174
175
175
** [ Get the printable cheat sheet] [ cheatsheet ] **
0 commit comments