Skip to content
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

How to pass babel transpiling to mocha? #81

Open
christian-schwaderer opened this issue Sep 14, 2022 · 0 comments
Open

How to pass babel transpiling to mocha? #81

christian-schwaderer opened this issue Sep 14, 2022 · 0 comments

Comments

@christian-schwaderer
Copy link

I have a mixed JavaScript/TypeScript project. For running, the JavaScript files are getting transpiled via babel-node.

Now, I'm trying to set-up ts-mocha for running tests. However, I keep getting

src/index.js:3

import 'whatever';

^^^^^^

SyntaxError: Cannot use import statement outside a module

I guess, I would need to pass something like --compilers js:@babel/register to mocha. But how do I do that when using ts-mocha?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant