Commit 65d1d60
committed
fix: typescript compilation when checking libs
When the skipLibCheck Typescript compiler option is set to false
compilation fails. This is due to the global WebdriverIO.Element
interface being extended with ElementBase: the compiler complains that
the types of $, execute and executeAsync are not identical to those
found in the webdriverio package.
To fix the compilation the WebdriverIO.Element interface either needs to
be extended with identical types as those used in the webdriverio
package or we stop extending it with ElementBase entirely.
The first option is not realistic as at build time we don't know which
version of the webdriverio package the end user will have installed. We
can however stop extendng the interface: WebdriverIO.Element is only
extended with ElementBase to allow an element to be passed to the within
method internally, if instead we coerce the WebdriverIO.Element to be an
ElementBase we no longer need to extend the interface.
This does not cause any loss in type safety either as we were
effectively coercing the type to be the same as ElementBase when we
extended the WebdriverIO.Element interface anyways.
Change the test tsconfigs to have skipLibCheck set to false so that the
typecheck script catches these types of bugs in future.1 parent 4c0d55c commit 65d1d60
File tree
4 files changed
+7
-5
lines changed- src
- test
- async
- sync
4 files changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
0 commit comments