Here is the code, let's call it mycode.ts:
import { Tracer } from 'dd-trace';
import got from 'got';
....
export class MyClass {...}
And then in test, let call it mycode.test.ts, I just load the file
import { MyClass } from './mycode';
I get the following error:
({"Object.":function(module,exports,require,__dirname,__filename,jest){import create from './create.js'; ^^^^^^ Test suite failed to run
Jest encountered an unexpected token
...
SyntaxError: Cannot use import statement outside a module
1 | import { Tracer } from 'dd-trace';
> 2 | import got from 'got';
| ^
Any idea what is wrong?
use this instead
and then