dividab / tsconfig-paths

Load node modules according to tsconfig paths, in run-time or via API.
MIT License
1.8k stars 100 forks source link

how to use with node test runner and typescript? #256

Closed pikadun closed 10 months ago

pikadun commented 10 months ago

https://nodejs.org/api/test.html#runoptions

register({
  baseUrl: __dirname,
  paths: <tsconfig.json.compilerOptions.paths>
})

run({
  files: ['some.spec.ts']
})

It will throw an error "MODULE_NOT_FOUND"