上QQ阅读APP看书,第一时间看更新
Generic ErrorEvents
Error events are generic errors that hide the underlying cause:
[object ErrorEvent] thrown
To expose the root cause of a generic error, implement a new test:debug script:
- Implement test:debug, as shown, in package.json:
package.json
...
"scripts": {
...
"test:debug": "ng test --sourcemaps=false",
...
}
- Execute npm run test:debug
- Now the Karma runner will likely reveal the underlying issue
- If necessary, follow the stack trace to find the child component that may be causing the issue
If this strategy is not helpful, you may be able to glean more information on what's going wrong by break point debugging your unit tests.