Skip to content

Karma hangs when using karma run #8566

@sanderkoenders

Description

@sanderkoenders

Versions

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.2.8 (e)
node: 8.8.1
os: linux x64
@angular/animations: 4.4.6
@angular/common: 4.4.6
@angular/compiler: 4.4.6
@angular/core: 4.4.6
@angular/forms: 4.4.6
@angular/http: 4.4.6
@angular/platform-browser: 4.4.6
@angular/platform-browser-dynamic: 4.4.6
@angular/router: 4.4.6
@angular/cli: 1.2.8
@angular/compiler-cli: 4.4.6
@angular/language-service: 4.4.6

Repro steps

  • Create a new project with ng new <projectname>
  • Open karma.conf.js and change autoWatch: true to autoWatch: false
  • Spawn the test server with karma start
  • Change styleUrls: ['./app.component.css'] to styleUrls: ['./app.comonent.css'] so the code is invalid and will trigger a webpack compilation error (typescript compile errors will have the same effect).
  • Karma server will now error, this is fine.
  • In another terminal, in the same directory execute karma run

Observed behavior

karma run now hangs untill the error is resolved.

Desired behavior

karma run should terminate with an error.

Mention any other details that might be useful (optional)

When configuring the project with the steps provided by the angular documentation this does not happen (https://angular.io/guide/webpack). This approach does not use the @Angular/cli so the problem seems to be in @Angular/cli

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions