he browser and mobile automation test framework  WebdriverIO recently  released a major update. Webdriver IO 7 is now written with TypeScript. TypeScript users may thus need to update their types, while JavaScript users should be largely unaffected. The new version also drops support for Node v10, upgrades the used Cucumber version to v7, and integrates better with Google Lighthouse.

Christian Bromann explained in the release note the reason behind the TypeScript rewrite:

As more and more contributors have joined the project, we’ve noticed that using pure JavaScript can be helpful to keep the entry barrier for contributions low, but that it ultimately decreases the quality of contributions overall. With the growing size of the code in the project, keeping up with all the different types that were thrown around was becoming more difficult for us as core contributors.

[…]

Our hope is that by moving to TypeScript, fewer bugs will be introduced during [the] continued development of the framework. It will help improve the quality of code contributions and the speed of development of certain features. It also brings more confidence in new versions that we ship to the user.

[…]

We have rewritten the complete code base and almost touched all files to add type safety and to fix a lot of bugs on the way.

WebdriverIO TypeScript users may, as a result, enjoy better type support across the API. The TypeScript configuration file tsconfig.json sees a few changes to reflect the changes in the type library. @wdio/sync (v6) should be replaced with webdriverio/sync, and webdriverio with webdriverio/async. In the latter case, the diff would be as follows:

// tsconfig.json
"types": [
"node",
- "webdriverio",
+ "webdriverio/async",
"@wdio/mocha-framework"
],

#development #typescript

WebdriverIO 7 Rewritten in Typescript, Released with Improved Lighthouse Integration
2.55 GEEK