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?
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-mochafor running tests. However, I keep gettingI guess, I would need to pass something like
--compilers js:@babel/registertomocha. But how do I do that when usingts-mocha?