How do I debug a “[object ErrorEvent] thrown” error in my Karma/Jasmine tests?

后端 未结 17 2319
生来不讨喜
生来不讨喜 2020-12-04 09:51

I have several failing tests that only output [object ErrorEvent] thrown. I don\'t see anything in the console that helps me pinpoint the offending code. Is t

17条回答
  •  我在风中等你
    2020-12-04 09:53

    FYI: you can find the exact error thrown just by open DevTools Console once your tests are running.

    As a quickfix you can try to run your tests without sourcemaps:

    CLI v6.0.8 and above
    --source-map=false

    CLI v6.0.x early versions
    --sourceMap=false

    CLI v1.x
    --sourcemaps=false

    Shortcut ng test -sm=false might also work

    There is an open issue on that https://github.com/angular/angular-cli/issues/7296

    UPDATE: I had that issue as well, so I just migrated to the latest cli and make sure that all packages are updated in package.json also I fully reinstalled the node_modules so now the issue has gone.

提交回复
热议问题