kulshekhar / ts-jest

A Jest transformer with source map support that lets you use Jest to test projects written in TypeScript.

Home Page:https://kulshekhar.github.io/ts-jest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Paths mapping is broken in typescript >= 4.9.4

carlocorradini opened this issue · comments

Version

29.0.3

Steps to reproduce

  1. Clone https://github.com/carlocorradini/graphql-auth-directive/tree/deps
  2. Install dependencies: npm ci
  3. Test: npm test

Expected behavior

I expect that the paths (e.g. ~/utils) present in the code (from tsconfig.json) are correctly mapped and translated.

Actual behavior

Paths are not mapped and translated, resulting in jest failing: Could not locate module ...

Debug log

ts-jest.log

Additional context

With typescript v4.9.3 it works flawlessly:

  1. Clone https://github.com/carlocorradini/graphql-auth-directive/tree/01acf4a6c71e4abe196bf340800fc6ffd0500000
  2. Install dependencies: npm ci
  3. Test: npm test (IT WORKS!)

Environment

System:
  OS: Windows 10 10.0.19045
  CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Binaries:
  Node: 16.14.2 - D:\DATA\nodejs\node.EXE
  npm: 8.19.1 - D:\DATA\nodejs\npm.CMD
npmPackages:
  jest: ^29.3.1 => 29.3.1

Just adding a +1 to this.