Commit 954c7c8
committed
fix: add Jest docblock pragma for ts-node compatibility
Add @jest-config-loader-options docblock pragma to Jest config files
that import other .ts files. This ensures ts-node compiles these files
with allowImportingTsExtensions enabled, which is required for .ts
extension imports to work.
The issue occurs because Jest v30 uses ts-node to compile TypeScript
config files, and ts-node registers with module: 'CommonJS' by default,
which doesn't allow .ts extensions in imports. The docblock pragma
passes compiler options to ts-node, enabling the required setting.
This fix ensures compatibility across all Node 22.x versions, including
versions prior to 22.18.0 which don't have native TypeScript support.
Tested with Node 22.17.1 and 22.20.0.1 parent 8836ab4 commit 954c7c8
3 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
0 commit comments