I'm following this example to set up some basic unit testing for a typescript project: https://dev.to/muhajirdev/unit-testing-with-typescript-and-jest-2gln
I have a main.ts exporting a isInternalLink function
and a main.spec.ts that tries to test it
but I get the following error:
C:\data\devel\apps\tmp\jest-typescript\src\main.spec.ts:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import { isInternalLink } from './main.js';
SyntaxError: Unexpected token {
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
This is the public repo with the complete example: https://gitlab.com/opensas/jest-typescript
Can anybody point me in the right direction, or provide a working example?