Reputation: 91
Im try to test unit in Nestjs
But its showing error
Test suite failed to run
Cannot find module '@nestjs/core/inspector/graph-inspector' from '../node_modules/@nestjs/testing/testing-module.builder.js'
Require stack:
/Volumes/My Files/IdeaProjects/ChecklistApp/server/node_modules/@nestjs/testing/testing-module.builder.js
/Volumes/My Files/IdeaProjects/ChecklistApp/server/node_modules/@nestjs/testing/test.js
/Volumes/My Files/IdeaProjects/ChecklistApp/server/node_modules/@nestjs/testing/index.js
task/task.spec.ts
Upvotes: 4
Views: 4091
Reputation: 146
I have same problem with you, and i solved it. This problem is occurred because "@nestjs/core/inspector/graph-inspector" is missing but still referenced in "../node_modules/@nestjs/testing/testing-module.builder.js".
To solve this problem do following command:
npm i @nestjs/core && npm i @nestjs/testing
Note: above command will update the version of @nestjs/core and @nestjs/testing package to the latest version.
Upvotes: 8