Home > Blockchain >  Karma test runner not closing after done
Karma test runner not closing after done

Time:06-20

I am working with the Angular test for the first time and after running the tests, Karma does not end or close.

I am assuming that it is on watch mode? Because it shows me success, etc. How do I turn this off? I intend to push the code into a pipeline; if tests keep running, the pipeline will fail.

ng test --include='src/app/shared/components/primary-auto-complete/primary-auto-complete.component.spec.ts'
✔ Browser application bundle generation complete.
17 06 2022 14:32:01.027:WARN [karma]: No captured browser, open http://localhost:9876/
17 06 2022 14:32:01.319:INFO [karma-server]: Karma v6.3.19 server started at http://localhost:9876/
17 06 2022 14:32:01.320:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
17 06 2022 14:32:01.325:INFO [launcher]: Starting browser ChromeHeadless
17 06 2022 14:32:02.273:INFO [Chrome Headless 102.0.5005.115 (Windows 10)]: Connected on socket gY4oj1GnRzQj1pvnAAAB with id 59347942
Chrome Headless 102.0.5005.115 (Windows 10): Executed 1 of 1 SUCCESS (0.117 secs / 0.075 secs)
TOTAL: 1 SUCCESS

This is where it gets stuck. Any help is appreciated!

CodePudding user response:

There is a watch flag. Plus you might want to have additional flags when running it in a pipeline:

ng test --source-map=false --browsers=ChromeHeadless --watch=false

More details, see:

  • Related