This repo demonstrates the need for webdriverio/expect-webdriverio#962 for the latest version of WebDriver.IO 7.
This repository was bootstrapped using @wdio/cli
with TypeScript enabled and with the default sample tests.
A few dependencies were changed manually to resolve all necessary peer dependencies.
This was tested on VSCode 1.78.0 and macOS Ventura 13.3.1, with the following npm dependencies:
expect-webdriverio@3.6.0
(via@wdio/mocha-framework@7.30.2
)- Node.js v16.14.2
typescript@5.0.2
webdriverio@7.31.1
When viewing example.e2e.ts
in VSCode, lines 9-10 have the following error hint:
'await' has no effect on the type of this expression.ts(80007)
In example.e2e.ts
, matchers from expect-webdriverio
should be asynchronous and ts(80007)
should
not occur.
The code change from webdriverio/expect-webdriverio#962
can be easily applied with patch-package
. To apply the new types in VSCode:
- Run the
fixme
script viayarn fixme
to modify yournode_modules
code. - Reload your workspace with the
Developer: Reload Window
command in the VSCode command palette. This command will restart your editor's TypeScript language service.