ES6 module support for Runner object API #8213
Labels
STATE: Issue accepted
An issue has been reproduced.
TYPE: enhancement
The accepted proposal for future implementation.
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
The text was updated successfully, but these errors were encountered: