You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect ts-jest/jest to correctly resolve the import from "./foo.js".
Actual behavior
Instead it throws this:
FAIL tests/checkEnvWithValidPort.test.ts
● Test suite failed to run
Cannot find module './logger.js' from 'src/lib/checkEnv.ts'
Require stack:
src/lib/checkEnv.ts
tests/checkEnvWithValidPort.test.ts
2 | import * as fs from "fs/promises"
3 | import * as dotenv from "dotenv";> 4 | import { logger } from "./logger.js";| ^
5 |
6 |export async functioncheckEnv(envPath: string): Promise<{ Port: number, JWTSecret: string }> {
7 | try {
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (src/lib/checkEnv.ts:4:1)
at Object.<anonymous> (tests/checkEnvWithValidPort.test.ts:2:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 2.309 s
Ran all test suites.
Because it doesnt recognise the import.
Debug log
doesnt work
Additional context
This seems to be related to #4013 and #4127
Also VSCode HATES absolute paths in TypeScript so this doesnt work.
Thanks for any Help!
in the tsconfig.json.
Im leaving this open, because in a larger codebease it is very tedious to change all the imports from import { bar } from "./foo.js" to import { bar } from "./foo.ts"
Version
29.1.0
Steps to reproduce
Instructions below
Expected behavior
When i write this (pseudocode):
I would expect ts-jest/jest to correctly resolve the import from "./foo.js".
Actual behavior
Instead it throws this:
Because it doesnt recognise the import.
Debug log
doesnt work
Additional context
This seems to be related to #4013 and #4127
Also VSCode HATES absolute paths in TypeScript so this doesnt work.
Thanks for any Help!
Environment
The text was updated successfully, but these errors were encountered: