Skip to content

Commit a98c2d7

Browse files
committed
add configuration example code
1 parent e6d65df commit a98c2d7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/api-configuration.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,35 @@ Configuration options:
1717

1818
`testIdAttribute`: The attribute used by `getByTestId` and related queries.
1919
Defaults to `data-testid`. See [`getByTestId`](#getbytestid).
20+
21+
```html
22+
23+
```
24+
25+
<!--DOCUSAURUS_CODE_TABS-->
26+
27+
<!--Native-->
28+
29+
```js
30+
// setup-tests.js
31+
import { configure } from 'dom-testing-library'
32+
33+
configure({testIdAttribute: 'my-data-test-id'})`
34+
```
35+
36+
<!--React-->
37+
38+
```js
39+
// setup-tests.js
40+
import { configure } from 'react-testing-library'
41+
42+
configure({testIdAttribute: 'my-data-test-id'})`
43+
```
44+
45+
<!--Cypress-->
46+
47+
```
48+
The configuration object is not currently exposed to in Cypress Testing Library
49+
```
50+
51+
<!--END_DOCUSAURUS_CODE_TABS-->

0 commit comments

Comments
 (0)