-
-
Notifications
You must be signed in to change notification settings - Fork 719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] ESM imports cause errors #3181
Comments
I am not sure if this is related, but maybe … here is an esm-issue at the playwright project: cucumber/cucumber-js#1844 If you have a playwright setup that compiles via ts-node, you still can not use esm. |
@DerZyklop thanks, but unfortunately it doesn't help. |
that's true, currently it is not supported |
@DavertMik It would be interesting to accept the same configurations as Mocha. |
I can use import in my test without any error. import { generateCart } from "utils/CommonUtils"; |
@peterngtr How is your project configuration? |
My tsconfig.json
|
I think I also use this package which kills the errors require('import-export'); |
@peterngtr As you know,
Thanks for the help, anyway. The needed solution is probably something like Mocha does. Since CodeceptJS uses Mocha internally, I figure out that it can pass along the configuration. |
This is working now in test files. Closed for now. |
@peterngtr @kobenguyent thanks for your contribution and sorry to spam a closed issue, but it seems like the right solution that I fail to understand completely. Where exactly did you add
add to Still I get this error:
My project uses |
hi @openmindculture isn't it the case you could try to setup the e2e tests with TS?
Hope that answer your concern. |
Thanks @kobenguyent I will try. In the meantime I found another workaround and added another |
What are you trying to achieve?
Use EcmaScript Modules (ESM) imports in test files. Example:
What do you get instead?
Details
npx codeceptjs init
for any UI Helper,The text was updated successfully, but these errors were encountered: