Skip to content

Don't block karma on webpack compilation errors #11170

Description

@nicojs

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Area

- [x] devkit
- [ ] schematics

Versions

$ node --version
v10.1.0
$ npm --version
6.0.1

Windows 10

Repro steps

  1. Create a fresh angular project
  2. Open up your karma.conf.js file and set autoWatch: false
  3. Run karma using npx karma run from the src directory (in another console, ). Specs should pass. Executed 3 of 3 SUCCESS
  4. Now go to the "app.component.ts" file and change styleUrls: ['./app.component.css'] to styleUrls: [''].
  5. Rerun karma using npx karma run. The karma process hangs and is not reporting the error (however, the AngularCompilerPlugin itself does report it).

This can be annoying for users using the Webstorm IDE. It starts angular with singleRun=false, watch=false. It uses karma run in order to kick of a test run and choose which tests to run. The result is that the tests hang in webstorm:

image

I'm investigating using ng test straight up for supporting mutation testing with Stryker. For this new approach to work, it would help a lot if the normal karma way of reporting errors is used.

The log given by the failure

-none-

Desired functionality

The compile error is reported via a karma event. We could use the "normal" error event for this: 'browser_error'. Otherwise we can create a new one: 'compiler_error' or something.

Furthermore, a compiler error should not result in a blocked karma run. Instead, it should finish up the run like normal, using the normal 'run_complete' event.

Mention any other details that might be useful

If we can fix this issue, we should be able to close #8744

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions