最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

angular - Testing modules not found - Stack Overflow

programmeradmin3浏览0评论

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/appponent.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"
  }
发布评论

评论列表(0)

  1. 暂无评论