karma-runner / karma-runner/karma

[Question] Can you access preprocessor errors programatically?

Open
#2,064 9 comments 1 reaction 0 assignees View on GitHub
help wanted type: bug
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

I'm running karma programatically through the `Server` API and was wondering if there was a good way catch preprocessor errors when they occur.

Right now, if a preprocessor (babel for example) fails, I'll just see a message logged from Karma, but the server will still start up.

I'd like to be able to cancel the whole process, or at least catch the error when it occurs. I tried tracing my way through the source, and couldn't exactly understand what happens when a preprocessor invokes it's callback with an error: https://github.com/karma-runner/karma/blob/master/lib/preprocessor.js#L26

Any advice?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.