-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Unable to use babel to run typescript tests #5588
Comments
(replaced absolute path in error with |
Why do you need Babel to use TypeScript? Please have a look at our boilerplate projects to see how things get set up: https://webdriver.io/docs/boilerplate.html#pako88wdio-mocha-typescripthttpsgithubcompako88wdio-mocha-typescript |
Thanks @christian-bromann I did look at the boilerplate projects - but couldn't find anything using babel with typescript. Preference for babel instead of ts-node is just for reuse as I already use babel for my project's jest tests and it works fine. Would like to reuse and avoid having an additional redundant dependency if possible. |
@mohanraj-r I honestly not sure if this is a WebdriverIO issue. I am happy to add some documentation around this but there is not much we can do on the WebdriverIO side to fix this configuration issue. I recommend to reach out in our support channel on |
Environment:
Config of WebdriverIO
Describe the bug
Babel Setup · WebdriverIO describes that we should be able to use
'@babel/register'
touse Babel to compile your test files
.But TypeScript Setup · WebdriverIO uses
'ts-node/register'
and doesn't mention how to use'@babel/register'
as an option.I already have a
babel.config.js
that lets me use jest to run my typescript unit test filesI would like to reuse babel to run wdio tests as well instead of using
ts-node
. But I get the following error instead with babel:To Reproduce
Steps to reproduce the behavior:
@babel/register
mochaOpts
replacerequire: ['ts-node/register'],
withrequire: ['@babel/register'],
Expected behavior
@babel/register
as described in Babel Setup · WebdriverIObabel
as an optionLog
Included in description above
Additional context
NA
The text was updated successfully, but these errors were encountered: