darshan k
darshan k

Reputation: 19

Testing modules not found

I am currently learning angular with angular 19. when i tried to run my test with ng test i got the following error :

Error: src/app/app.component.spec.ts:26:5 - error TS2304: Cannot find name 'expect'.

26     expect(compiled.querySelector('h1')?.textContent).toContain('Hello, SlotBookingPortal');
      ~~~~~~

for all the component but in my package.json i do have all the dependencies :

"devDependencies": {
    "@angular-devkit/build-angular": "^19.1.7",
    "@angular/cli": "^19.1.7",
    "@angular/compiler-cli": "^19.1.6",
    "@types/jasmine": "~5.1.0",
    "@types/jest": "^29.5.14",
    "@types/mocha": "^10.0.10",
    "jasmine-core": "~5.1.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~5.5.2"
  }

Upvotes: -1

Views: 20

Answers (0)

Related Questions