Angular 4 Unit test error - Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'ng:///DynamicTestModule/LoginComponent.ngfactory.js'

前端 未结 4 1623
花落未央
花落未央 2021-02-18 15:03

I am writing some unit tests for my component and i am getting this cryptic error message. I found a similar question at Angular 2 unit testing - getting error Failed to load &#

4条回答
  •  独厮守ぢ
    2021-02-18 15:56

    This is a problem with the Angular Cli version 1.2.2 or newer. Run your test with --sourcemaps=false and you will get the right error messages.

    In Angular 4-5

    • ng test --sourcemaps=false
      
      or
    • ng test -sm=false
      

    In Angular 6+

    • ng test --source-map=false
      

    See details here: https://github.com/angular/angular-cli/issues/7296

提交回复
热议问题