karma-runner/karma

[Question] Can you access preprocessor errors programatically?

開放

#2,064 建立於 2016年4月20日

 (9 則留言) (1 個反應) (0 位負責人)JavaScript (1,703 個分叉)batch import
help wantedtype: bug

倉庫指標

星標
 (11,918 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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?

貢獻者指南