ts-jest-resolver icon indicating copy to clipboard operation
ts-jest-resolver copied to clipboard

Support require without extension

Open rix0rrr opened this issue 2 years ago • 1 comments

All of our TypeScript code uses imports without extensions. Example:

import * as module from './module';

This works because our code is in CommonJS; at compile time, TypeScript will know to look for module.ts or module.d.ts, at run-time Node will look for module.js.

Currently, ts-jest-resolver will not handle paths without extensions correctly: it will only replace known extensions with different ones, not try to add extensions to unqualified files.

I can write a PR to add this behavior. Would you accept it if I did?

rix0rrr avatar Aug 23 '23 18:08 rix0rrr

Just do it.™

Creative-Difficulty avatar Aug 26 '23 14:08 Creative-Difficulty