3

I get the below messages after executing command ng test. It runs with out any errors but doesn't execute test cases. Any idea why it's not executing the tests?

My project is upgraded from Angular 2 to 4, 5 & now 6. Is it because the karma library has not upgraded properly?

I have created new Angular 6 project and tried ng test it works there but doesn't work on my project. I have deleted the node_modules folder and installed it by npm install, but it is still not working. Any other sugessions?

10% building modules 1/1 modules 0 active(node:9836) DeprecationWarning: Tapable.plugin is deprecated. Use new API on  .hooks instead
28 06 2018 11:23:24.302:WARN [karma]: No captured browser, open http://localhost:9876/
28 06 2018 11:23:24.399:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
28 06 2018 11:23:24.402:INFO [launcher]: Launching browser Chrome with unlimited concurrency
28 06 2018 11:23:24.426:INFO [launcher]: Starting browser Chrome 95% emitting CopyPlugi
28 06 2018 11:24:31.561:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
28 06 2018 11:24:42.702:WARN [karma]: No captured browser, open http://localhost:9876/
28 06 2018 11:24:43.272:INFO [launcher]: Trying to start Chrome again (1/2).
28 06 2018 11:24:48.951:INFO [Chrome 67.0.3396 (Windows 7 0.0.0)]: Connected on socket VC2A92U8dwahjxB5AAAA with id 78549298
Chrome 67.0.3396 (Windows 7 0.0.0): Executed 0 of 41 SUCCESS (0 secs / 0 secs)
28 06 2018 11:25:16.507:WARN [Chrome 67.0.3396 (Windows 7 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
Chrome 67.0.3396 (Windows 7 0.0.0) ERROR
Chrome 67.0.3396 (Windows 7 0.0.0) ERROR Disconnected, because no message in 10000 ms.
Chrome 67.0.3396 (Windows 7 0.0.0): Executed 0 of 41 DISCONNECTED (10.004 secs / 0 secs)
Chrome 67.0.3396 (Windows 7 0.0.0) ERROR
Chrome 67.0.3396 (Windows 7 0.0.0): Executed 0 of 41 DISCONNECTED (10.004 secs / 0 secs)

I got this working by removing ngx-translation import. But its not fix as with out importing translation I wont be able to proceed further.

Anyone implemented the ngx-translation in Unit test cases.

2
  • Try opening a browser to localhost:9876 after you run ng test and see if that works. The output above indicates it has no captured browser to run the tests in. If that doesn't work, can you provide some working code so others can debug? Commented Jul 2, 2018 at 4:49
  • It actually opens browser and prints Security in it and doesnt execute test cases. Do you any idea like why it prints Security? Commented Jul 3, 2018 at 7:07

2 Answers 2

2

This happens when jasmine goes in to a loop. Actually because of my translate service, It was going in the loop and which was causing karma not to run any test cases and exit, giving error 0 of 43 test executed.

Sign up to request clarification or add additional context in comments.

Comments

0

Just for the information: To find the exact issue about this, run the test case with -sm=false.

C:\Angular>ng test -sm=false

I was stuck in this for a while. Above command gave me the exact issue needs to be resolved. Hope it will be helpful to others getting this issue.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.