DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.78k stars 661 forks source link

ES6 module support for Runner object API #8213

Open XieWren opened 3 weeks ago

XieWren commented 3 weeks ago

What is your Scenario?

I am using TypeScript for writing TestCafe tests, which favours ESM import syntax over the older CommonJS. I benefit a lot from being able to run tests programmatically through the Runner object.

For standardisation and optimisation, I would like to transpile my TS to ESM JS. TestCafe dropped the experimental flag from --esm in v2.5.0 for the CLI API, but there is no matching option within the Runner object.

What are you suggesting?

Add an option to enable ESM support in the Runner object, either in Runner.run method options, createTestCafe options, or as a separate method.

Alternatively, the runner could automatically handle ESM or CommonJS based on the file extension provided (.mjs vs .cjs)

What alternatives have you considered?

I tried using the latter of my suggestions, but it was not implemented.

Additional context

No response

github-actions[bot] commented 2 weeks ago

We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news.