Search code examples
unit-testingngrx

On ' npm test login.component.spect.ts ' , it says Cannot find module '@app/store/user/user.actions' from 'login.component.ts'


I am new to Ngrx and its UnitTesting , Can anyone help me with the best tutorial or link to learn I am facing an error , On ' npm test login.component.spect.ts ' , it says
Cannot find module '@app/store/user/user.actions' from 'login.component.ts' , in Testbed how to import actions and reducer file

Though i've imported the action and reducer file in spec and Ts file , still i am getting an above error.


Solution

  • You probably have to define your paths inside the tsconfig.spec.json. If you're using jest you also have to define some moduleNameMappers.