Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Preprocessor failure should cancel (not even start) the execution #550

hlship opened this Issue · 5 comments

4 participants


When I have errors in my CoffeeScript, I see two problems:

1) The compilation error is reported without a line number, making it hard to chase down the problem.

INFO [watcher]: Changed file "/Users/hlship/workspaces/annadale/nexus/client/novate-console/src/test/unit/".
ERROR []: unexpected INDENT
  at /Users/hlship/workspaces/annadale/nexus/client/novate-console/src/test/unit/
Chrome 26.0 (Mac) LOG: '{\n  "a": 1,\n  "b": 2\n}'
Chrome 26.0 (Mac): Executed 5 of 5 SUCCESS (0.457 secs / 0.068 secs)

2) The test runner reports success for the tests that did run; however, the test run should be a failure if any sources could not be compiled. In the above, the 5 tests that ran passed, but there were another 7 that never executed due to the compilation error.

This is in Karma 0.8.5.

@vojtajina vojtajina referenced this issue in karma-runner/karma-coffee-preprocessor

Better error reporting #4


Totally. I created a separate issue for the coffee-preprocessor plugin (to report line numbers).

Any failure during preprocessing should fail the whole run. Probably even not run.


Just updated the issue title.

nc commented




@vojtajina vojtajina closed this issue from a commit
@vojtajina vojtajina feat(preprocessor): allow preprocessor to cancel test run
Now a preprocessor can return an error, which
  - stops preprocessing (does not trigger other preprocessors),
  - cancels the test run.

This changes the preprocessor API - preprocessor's `done` function accepts two arguments:
  - an error (`null` if no error),
  - content.

The change is done in a backwards compatible way - if a preprocessor calls `done` with a single
string argument, it is treated as no error.

Closes #550
@vojtajina vojtajina closed this in 4d669bf

I fixed this in the coffee preprocessor, but it will be available with Karma 0.12, as this is a breaking change (it's in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.