In a create-react-app typescript project, I tried to write this just to test some stuff quickly:
// experiment.test.ts
The correct way is to tell TypeScript what you want. If you don't want isolatedModules create tsconfig.json inside your test directory and add:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"isolatedModules": false
},
}
Adding "isolatedModules": true to the config and then cheating TypeScript checker by adding empty export {} smells bad code to me.