Abdullaziz Al Deen
Abdullaziz Al Deen

Reputation: 91

Nestjs Test Unit

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

Answers (2)

user17616096
user17616096

Reputation: 51

I found that I also had to install/update @nestjs/common

Upvotes: 0

Matahari Ramadhan
Matahari Ramadhan

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

Related Questions