Closed
Description
🐛 Bug Report
Filing a separate issue at @SimenB's suggestion.
After following the steps to get native ESM support, I'm running into the following error in a project that transpiles TypeScript files using @babel/preset-typescript
:
/home/dandv/jets/lib.test.ts:1
import { foo } from './lib';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Runtime._execModule (node_modules/jest-runtime/build/index.js:1074:58)
To Reproduce
git clone https://github.com/dandv/jest-typescript-es-modules.git
cd jest-typescript-es-modules
npm install
npm test
Expected behavior
Test passes.
Link to repl or repo (highly encouraged)
https://github.com/dandv/jest-typescript-es-modules
envinfo
System:
OS: Linux 5.3 Ubuntu 18.04.4 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
Binaries:
Node: 13.13.0 - /usr/bin/node
npm: 6.14.4 - ~/.local/bin/npm
npmPackages:
jest: ^25.4.0 => 25.4.0