tsconfig-paths icon indicating copy to clipboard operation
tsconfig-paths copied to clipboard

jest e2e test

Open wmvm0 opened this issue 3 years ago • 2 comments

How do use this in unit tests ?

Cannot find module '@apps/funning/jd/pet/dto/enum' from 'src/apps/funning/jd/pet/service/impl/pet.service.ts'

Cannot resolve the configured path

wmvm0 avatar Jun 17 '21 01:06 wmvm0

I also face this problem. Do you solve this?

spk-cpsamut avatar Jan 22 '22 13:01 spk-cpsamut

As a workaround, you can add this to your jest config:

  moduleNameMapper: {
    '@apps/(.*)': '<rootDir>/src/apps/$1',
  },

Of course, replace apps with whatever you need to point to

AndyClausen avatar Feb 21 '22 17:02 AndyClausen