Angular-cli: ng test never exits karma when singleRun=true

Created on 30 Nov 2016  路  5Comments  路  Source: angular/angular-cli

OS?

OSX El Capitan (10.11.6)

Versions.

angular-cli: 1.0.0-beta.20-3
node: 6.9.1
os: darwin x64

Repro steps.

Generate a new application using the cli
change singleRun=true in the karma.conf.js
run ng test

After running successfully, the process will hang and never complete.
I reproduced this locally and also on my CI server using bitbucket pipelines

Mention any other details that might be useful.

Changing the angular-cli version to 1.0.0.beta19-3 in package.json fixes this problem, and the karma process exits immediately on successful testing. It seems to be introduced in beta20

Most helpful comment

@pblasco I also verified this.

OS?
macOS Sierra 10.12.1 (16B2657)

Versions.
angular-cli: 1.0.0-beta.21
node: 6.9.1
os: darwin x64

Repro steps.

Generate a new application using the cli
change singleRun=true in the karma.conf.js
run ng test

Moreover, I had another observation.
If you set autoWatch: false with singleRun: true, it doesn't even run the test cases.
The process hangs in both the cases and never completes.

It will be helpful if someone can verify the second scenario too.

All 5 comments

I also got the same issue. Then I am able to over come with "ng test --single-run".

Are you able to generate coverage report? for me coverage report generation is not working.

@pblasco I also verified this.

OS?
macOS Sierra 10.12.1 (16B2657)

Versions.
angular-cli: 1.0.0-beta.21
node: 6.9.1
os: darwin x64

Repro steps.

Generate a new application using the cli
change singleRun=true in the karma.conf.js
run ng test

Moreover, I had another observation.
If you set autoWatch: false with singleRun: true, it doesn't even run the test cases.
The process hangs in both the cases and never completes.

It will be helpful if someone can verify the second scenario too.

@sreenivasulun Your suggestion works fine to get single-run work as usual.

code coverage and lint were made optional in angular-cli version 1.0.0-beta.19

To get everything(single-run, code coverage report and linting) working as before, one can still use:

ng test --single-run --lint --code-coverage

Dupe of https://github.com/angular/angular-cli/issues/3554. This one was opened before, but I ended up replying to the other one first with some details about the cause.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brtnshrdr picture brtnshrdr  路  3Comments

jmurphzyo picture jmurphzyo  路  3Comments

jbeckton picture jbeckton  路  3Comments

5amfung picture 5amfung  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments