Angular 2 unit testing - getting error Failed to load 'ng:///DynamicTestModule/module.ngfactory.js'

前端 未结 10 2390
执念已碎
执念已碎 2020-12-23 11:04

I have angular 2 webpack application, all webpack,karma configuration created as per angular.io webpack guide. I am not using aot. I am writing jasmine unit test spec to te

10条回答
  •  半阙折子戏
    2020-12-23 11:52

    I just had this issue as well. It turned out to be a simple null reference error in my component in one of my *ngIf checks.

    I would suggest running ng serve and checking the component is working in the browser without any errors, or simply run ng test --source-map=false to get a more useful error message.

提交回复
热议问题