I get the following error every time I try to run test.
● Test suite failed to run
src/repositories/list_contacts/ListContactRepository.test.ts:4:37 - error TS2307: Cannot find module './ListContactRepository' or its corresponding type declarations.
4 import {ListContactRepository} from './ListContactRepository';
~~~~~~~~~~~~~~~~~~~~~~~~~
Earlier everything worked fine but this happened after I rename
src/repositories/quick_contacts/QuickListContactRepository.test.ts to
src/repositories/list_contacts/ListContactRepository.test.ts
And run git checkout -b list. After some changes I committed there and come back to previous branch by git checkout dev now I face this error whenever I try to run test.
This file src/repositories/list_contacts/ListContactRepository.test.ts doesn't even exist on my current branch. But jest keep complaining. Any suggestion to solve this will be appreciated.
In my case I solved the problem by modifying the import path :
import { MyService } from "src/app/mymodule/services/myservice.service";
to
import { MyService } from "../../../mymodule/services/myservice.service";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With