@@ -61,31 +61,35 @@ configure({ testIdAttribute: 'data-my-test-id' })
61
61
## Configuration options:
62
62
63
63
### ` computedStyleSupportsPseudoElements `
64
- Set to ` true ` if ` window.getComputedStyle ` supports pseudo-elements i.e. a second argument. If
65
- you're using testing-library in a browser you almost always want to set this to
66
- ` true ` . Only very old browser don't support this property (such as IE 8 and
67
- earlier). However, ` jsdom ` does not support the second argument currently. This
68
- includes versions of ` jsdom ` prior to ` 16.4.0 ` and any version that logs a
69
- ` not implemented ` warning when calling ` getComputedStyle ` with a second argument
70
- e.g. ` window.getComputedStyle(document.createElement('div'), '::after') ` .
71
- Defaults to ` false `
64
+
65
+ Set to ` true ` if ` window.getComputedStyle ` supports pseudo-elements i.e. a
66
+ second argument. If you're using testing-library in a browser you almost always
67
+ want to set this to ` true ` . Only very old browser don't support this property
68
+ (such as IE 8 and earlier). However, ` jsdom ` does not support the second
69
+ argument currently. This includes versions of ` jsdom ` prior to ` 16.4.0 ` and any
70
+ version that logs a ` not implemented ` warning when calling ` getComputedStyle `
71
+ with a second argument e.g.
72
+ ` window.getComputedStyle(document.createElement('div'), '::after') ` . Defaults to
73
+ ` false `
72
74
73
75
### ` defaultHidden `
76
+
74
77
The default value for the ` hidden ` option used by
75
78
[ ` getByRole ` ] ( api-queries.mdx#byrole ) . Defaults to ` false ` .
76
79
77
80
### ` showOriginalStackTrace `
78
- By default, ` waitFor ` will ensure that the stack trace
79
- for errors thrown by Testing Library is cleaned up and shortened so it's easier
80
- for you to identify the part of your code that resulted in the error (async
81
- stack traces are hard to debug). If you want to disable this, then
82
- set` showOriginalStackTrace ` to ` false ` . You can also disable this for a specific
83
- call in the options you pass to ` waitFor ` .
81
+
82
+ By default, ` waitFor ` will ensure that the stack trace for errors thrown by
83
+ Testing Library is cleaned up and shortened so it's easier for you to identify
84
+ the part of your code that resulted in the error (async stack traces are hard to
85
+ debug). If you want to disable this, then set` showOriginalStackTrace ` to
86
+ ` false ` . You can also disable this for a specific call in the options you pass
87
+ to ` waitFor ` .
84
88
85
89
### ` throwSuggestions ` (experimental)
86
- When enabled, if [ better queries ] ( https://testing-library.com/docs/guide-which-query ) are
87
- available the test will fail and provide a suggested query to use instead.
88
- Default to ` false ` .
90
+
91
+ When enabled, if [ better queries ] ( queries/about.mdx#priority ) are available the
92
+ test will fail and provide a suggested query to use instead. Default to ` false ` .
89
93
90
94
To disable a suggestion for a single query just add ` {suggest:false} ` as an
91
95
option.
@@ -95,14 +99,17 @@ screen.getByTestId('foo', { suggest: false }) // will not throw a suggestion
95
99
```
96
100
97
101
### ` testIdAttribute `
98
- The attribute used by [ ` getByTestId ` ] ( api-queries.mdx#bytestid ) and related queries. Defaults to
99
- ` data-testid ` .
102
+
103
+ The attribute used by [ ` getByTestId ` ] ( api-queries.mdx#bytestid ) and related
104
+ queries. Defaults to ` data-testid ` .
100
105
101
106
### ` getElementError `
102
- A function that returns the error used when
103
- [ ` getBy* ` ] ( api-queries.mdx#getby ) or [ ` getAllBy* ` ] ( api-queries.mdx#getallby )
104
- fail. Takes the error message and container object as arguments.
107
+
108
+ A function that returns the error used when [ ` getBy* ` ] ( api-queries.mdx#getby ) or
109
+ [ ` getAllBy* ` ] ( api-queries.mdx#getallby ) fail. Takes the error message and
110
+ container object as arguments.
105
111
106
112
### ` asyncUtilTimeout `
107
- The global timeout value in milliseconds used by ` waitFor `
108
- utilities. Defaults to 1000ms.
113
+
114
+ The global timeout value in milliseconds used by ` waitFor ` utilities. Defaults
115
+ to 1000ms.
0 commit comments