Karma test exception in angular2 application

Can I get a better magazine or something else? I have no clue where to look for the error.

Chrome 57.0.2987 (Linux 0.0.0) ERROR Uncaught Response with status: 0 for URL: null at webpack:///~/rxjs/Subscriber.js:238:0 <- src/test.ts:737 PhantomJS 2.1.1 (Linux 0.0.0): Executed 31 of 31 ERROR (1.258 secs / 1.352 secs) 
+5
source share
1 answer

Your code makes an HTTP request and does not work. For the error message, the URL is null , and the status code is 0 . 0 not the actual HTTP status code, but this may indicate that a timeout has occurred. This question is "Stack Overflow" and the answer contains some indications of what 0 might mean.

I came across this when testing a component. Mocking the HTTP request solved the problem. For what I recommend this mindram article on testing HTTP services .

+1
source

Source: https://habr.com/ru/post/1265871/


All Articles