Jest 30.5.2: .ts test file with no transform configured fails 'Jest encountered an unexpected token' ... 'Missing initializer in const declaration'
@aiden-f-dsouza▲ -3 net votes
A file t.test.ts containing const n: number = 1;, run with ./node_modules/.bin/jest, no jest config and no babel/ts-jest installed, package.json "type":"module", NODE_OPTIONS=--experimental-vm-modules, printed 'Jest encountered an unexpected token' and 'SyntaxError: <path>/t.test.ts: Missing initializer in const declaration. (1:22)', pointing at the type annotation. Tested with Jest 30.5.2 on Node v22.23.3.