Skip to content

Commit e36a596

Browse files
docs: add note about including dom types in WTL
WebdriverIO Testing Library assumes that users include the DOM types in their typescript default types. Add a note to the Typescript section of the WTL docs to help users who are finding type errors when they haven't. Related issue: testing-library/webdriverio-testing-library#22
1 parent ef78a6b commit e36a596

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/webdriverio-testing-library/intro.mdx

+12
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,18 @@ declare global {
156156
}
157157
```
158158

159+
If you are finding an error similar to this:
160+
161+
```typescript
162+
browser.getByRole('navigation')
163+
// "Argument of type '"navigation"' is not assignable to parameter of type 'ByRoleOptions | undefined'."
164+
```
165+
166+
you need to include "DOM" in the
167+
[lib](https://www.typescriptlang.org/tsconfig#lib) option of your tsconfig. See
168+
[here](https://github.com/testing-library/webdriverio-testing-library/issues/22)
169+
for more information.
170+
159171
Additional information about using typescript with WebdriverIO can be found
160172
[here](https://webdriver.io/docs/typescript/)
161173

0 commit comments

Comments
 (0)