'ng test' does not 'exit' after running unit test, something keeps running
See original GitHub issueWhen I run ng test
my unit tests are run successfully. With logLevel: config.LOG_DEBUG
it reports the following:
01 06 2016 16:50:15.040:DEBUG [karma]: Run complete, exiting.
01 06 2016 16:50:15.040:DEBUG [launcher]: Disconnecting all browsers
01 06 2016 16:50:15.521:DEBUG [launcher]: Process Chrome exited with code 0
01 06 2016 16:50:15.521:DEBUG [temp-dir]: Cleaning temp dir /var/folders/bd/5l9p70517qgg73659f70pzgw0000gn/T/karma-14746095
01 06 2016 16:50:15.574:DEBUG [launcher]: Finished all browsers
But it doesn’t release the terminal. I don’t get back the prompt. So it seems something keeps running. I have this locally with the configuration below. As well as on a docker image (pimterry/node-karma).
This prevents me from running the unit tests on my CI environment because the process waits for the prompt to return.
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) OSX El Capitan 10.11.5
- Versions. Please run
ng --version
. If there’s nothing outputted, please run in a Terminal: node --version And paste the result here. angular-cli: 1.0.0-beta.5 node: 4.4.0 os: darwin x64 - Repro steps. Was this an app that wasn’t created using the CLI? What change did you do on your code? etc. It was created with the CLI
- The log given by the failure. Normally this include a stack trace and some more information. There is no log. It is just that my prompt doesn’t return.
- Mention any other details that might be useful. In the karma config: ‘autowatch=false’ and ‘singleRun=true’
I have also tried this with a fresh project generated with Angular CLI and nothing changed except the above settings in the Karma config. It has the same issue.
Thanks! We’ll be in touch soon.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Angular 7 : ng test hangs , keeps running tests repeatedly
Try this command ng test -- --watch=false --code-coverage.
Read more >ng test - Angular
Option Description Value Type Defau...
‑‑browsers Override which browsers tests are run against. string
‑‑code‑coverage Output a code coverage report. boolean false
‑‑code‑coverage‑exclude Globs to exclude...
Read more >Run tests | IntelliJ IDEA Documentation - JetBrains
The test that has failed will be rerun in the debug mode. After that, the test will be suspended, allowing you to examine...
Read more >How to Stop Jest Tests from Hanging in Angular | by Paul Kim
Jest test hangs, hanging, stuck, never finishes, not running, won't stop. An article to stop hanging Jest tests in an Angular project.
Read more >Run jest for unit tests of modified files only | by SunCommander
Since we can always fetch changed files in a pull request on local and on CI, why not extract changed react files and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
By default, unit tests will run in watch mode. You can override this by doing
ng tests --watch=false
instead.The above should be ng test --watch=false