My NestJS application runs in the prod mode and dev mode. But I cannot execute an e2e test on the AppModule
. Basically I have too many 3rd party packages and it happens while importing ThrottlerStorageRedisService
and other 3rd party modules are OK.
I am not sure it was something related to Jest or NestJS. Just my guess something between your package and ioredis
is wrong. As you see in the screenshot the call stack error happened in that module.
I test this solution too, I import it as the last module, All other modules imported correctly but this module cause Maximum call stack size exceeded
error.
My e2e runs and I could write my e2e tests.
This error that you see occurred.
![Screenshot from it](https://user-images.githubusercontent.com/73785723/160068251-8b8ba58f-3248-46d0-ac29-d88c3d6dd19d.png)
"scripts": {
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:e2e": "NODE_ENV=test jest --config ./test/e2e.config.ts --watch",
},
"dependencies": {
"@nestjs-modules/mailer": "^1.6.1",
"@nestjs/bull": "^0.5.0",
"@nestjs/common": "^8.0.0",
"@nestjs/config": "^1.1.6",
"@nestjs/core": "^8.0.0",
"@nestjs/event-emitter": "^1.0.0",
"@nestjs/jwt": "^8.0.0",
"@nestjs/passport": "^8.0.1",
"@nestjs/platform-express": "^8.0.0",
"@nestjs/schedule": "^1.0.2",
"@nestjs/swagger": "^5.1.4",
"@nestjs/throttler": "^2.0.0",
"buffer": "^6.0.3",
"bull": "^4.6.2",
"cache-manager": "^3.6.0",
"cache-manager-redis-store": "^2.0.0",
"env-cmd": "^10.1.0",
"ioredis": "^4.28.5",
"nestjs-throttler-storage-redis": "^0.1.18",
"reflect-metadata": "^0.1.13",
},
"devDependencies": {
"@nestjs/cli": "^8.0.0",
"@nestjs/schematics": "^8.0.0",
"@nestjs/testing": "^8.0.0",
"@types/bcrypt": "^5.0.0",
"@types/bcryptjs": "^2.4.2",
"@types/bull": "^3.15.8",
"@types/cache-manager": "^3.4.2",
"@types/cron": "^1.7.3",
"@types/express": "^4.17.13",
"@types/jest": "^27.0.1",
"@types/node": "^16.0.0",
"@types/passport-jwt": "^3.0.6",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"eslint": "^7.30.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"jest": "^27.0.6",
"prettier": "^2.3.2",
"prisma": "^3.3.0",
"prisma-dbml-generator": "^0.8.3",
"supertest": "^6.1.3",
"ts-jest": "^27.0.3",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "^3.10.1",
"typescript": "^4.3.5"
},