1

As part of an Angular app I am trying to debug Jasmine test cases run by Karma in VSCode. I have referenced the below links and made the following changes

http://blog.mlewandowski.com/Debugging-Karma-tests-with-VSCode.html

Debug Tests in NG Test

Karma.conf.js

browsers: ['chromeDebug'],
singleRun: false,
customLaunchers: {
  chromeDebug: {
    base: 'Chrome',
    flags: [ '--remote-debugging-port=9333' ]
  }
},

Behavior

While running ng test the browser is launched but the [web-server] is not running and serving the files. Below is the comparison between the logs

Default - without using customLaunchers

[36m01 04 2018 10:08:37.837:DEBUG [web-server]: [39mInstantiating middleware
[36m01 04 2018 09:43:11.281:DEBUG [web-server]: 
[39mserving: /Users/.../Documents/Workspace/xyz-web-app/node_modules/
karma/static/client.html

Debug - while using custLaunchers

[36m01 04 2018 10:08:37.578:DEBUG [plugin]: [39mLoading inlined plugin (defining launcher:chromeDebug).
[36m01 04 2018 10:08:37.837:DEBUG [web-server]: [39mInstantiating middleware
[33m01 04 2018 10:09:07.786:WARN [karma]: [39mNo captured browser, open http://localhost:9333/
[33m01 04 2018 10:10:48.118:WARN [launcher]: [39mChrome have not captured in 120000 ms, killing.

During the Debug more since the [web-server] is not able to server the files [web-server]: [39mserving: /Users/.../Documents/Workspace/xyz-web-app/node_modules/ karma/static/client.html

I have tried to increase captureTimeout with little success. I believe if the issue might be with additional configuration required for customLunchers. Any suggestions or direction on the fixing this will be much appreciated. Thanks

maxkart
  • 619
  • 5
  • 21
  • First, without the changes, does ng test work ? Second, you added a link (https://github.com/Microsoft/vscode-recipes/tree/master/Angular-CLI ) Did you try that ? Because the first link is 1 year old and the second is updated 11 days ago – CornelC Apr 02 '18 at 11:11
  • ng test works fine with default Chrome, its only when I use the customLaunchers I am facing the issue – maxkart Apr 02 '18 at 19:24

0 Answers0