Support for running WebdriverIO TypeScript tests on Node 20. Fixes #10901#11202
Conversation
|
@christian-bromann - I think to fully test |
|
@christian-bromann, @nextlevelbeard, @erwinheitzman - this PR is ready for your review. As always, your thoughts and feedback are welcome! |
| "copy": "cd packages/wdio-cli && npm run copy && cd ../../", | ||
| "generate": "run-s generate:*", | ||
| "generate:bidi": "npx ts-node-esm ./scripts/bidi/index.ts", | ||
| "generate:bidi": "node --loader ts-node/esm ./scripts/bidi/index.ts", |
There was a problem hiding this comment.
I thought these would be the same 🤔
There was a problem hiding this comment.
That's what I thought too, but:
npx ts-node-esm ./scripts/bidi/index.tsdoesn't work on Node 20node --loader ts-node/esm ./scripts/bidi/index.tsworks fine (plus has the added benefit of being consistent with the other scripts)
Have a look at generate:bidi failure on Node 20: https://github.com/webdriverio/webdriverio/actions/runs/6228506528/job/16905377436#step:5:65
and then the step behaving correctly after the change from npx to node --loader - https://github.com/webdriverio/webdriverio/actions/runs/6228656361/job/16905779299#step:5:64
I'm not sure where the difference comes from, but it looks like ESM support in Node 20 has changed a lot since 18
|
@christian-bromann @erwinheitzman - I can confirm WebdriverIO 8.16.12 works well with Node 20 and the latest Serenity/JS - https://github.com/serenity-js/serenity-js-cucumber-webdriverio-template/actions/runs/6276942410 🎉 |
Proposed changes
Enable WebdriverIO to run TypeScript-based test scenarios on Node 20.
This PR is a more targeted variation of #11173 and an improvement on #11178 aimed at resolving #10901.
Apart from fixing the issue, I also propose to introduce improvements to the WebdriverIO pipeline so that we can test integration with Node 20.
In particular, I made the following modifications to WebdriverIO pipeline to help ensure it works with Node 20:
generate:bidiscript improved to work with Node 20To help ensure that WebdriverIO works with TS-Node on Node 20:
wdio runcommand fixed to support TypeScript test suites on Node 20Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers