Open retwere opened 7 months ago
I ended up doing
// @ts-expect-error - imports are relative to parent directory, not the mock directory
import { xxx } from '../utils'
is there any other way to circumvent this "issue" ? it's worth noting that the autocomplete (lint) is broken because of this. I wonder how other devs are doing... 🤔
I have several files in my
__mocks__
directory that import other files. In this example, I have filessrc/foo.ts
,src/fooHelper.ts
, andsrc/__mocks__/foo.ts
. I want to be able to use thefooHelper
in my mock offoo
.src/__mocks__/foo.ts:
This results in an error:
The problem is fixed if I change the mock to import
./fooHelper
instead of../fooHelper
:src/__mocks__/foo.ts:
However, this results in errors in my unit tests and typescript build.