docs.nestjs.com icon indicating copy to clipboard operation
docs.nestjs.com copied to clipboard

Monorepo testing section to include details about jest `moduleNameMapper` configuration needed for e2e jest config file in each application

Open sebastiangug opened this issue 3 years ago • 0 comments

The title pretty much includes all the details, I'll try to contribute it myself & make a pull request with this.

Essentially, when doing e2e testing in a monorepo you need to configure the moduleNameMapper property in the config file targeted by the test command, otherwise @app imports will not be resolved properly and initalisation will fail.

Took me a couple of hours to debug this although that might be just me sucking at realizing which jest configuration is being picked up & how module resolution is being handled for @app imports.

sebastiangug avatar Apr 05 '21 16:04 sebastiangug