TypeScript compilation failure and Karma test execution?

Viewed 2692

I'm currently using Karma + Jasmine to run the tests on my TypeScript-based project, and I want to 'break the tests' when TypeScript compilation fail in karma watch mode.

I'm using standard Karma configuration and compiling TS using webpack preprocessor (which compiles TS files). Everything works perfectly fine, except that seeing all tests pass when a compilation error occurs is highly misleading (karma rerun previous tests even if webpack compilation fails).

It seems rather trivial, but after an hour or two of looking at documentation and searching Google I'm desperately looking for a solution, which I didn't find.

Is there a solution involving karma, jasmine, webpack and TypeScript that can break the tests when a compilation error occurs without breaking the watch mode?

edit : Precision on the watch mode added.

2 Answers
Related