karma-runner/karma

Feature request: Provide an "is debug" signal

Open

#2,809 创建于 2017年8月14日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (11,918 star) (1,703 fork)batch import
help wantedtype: feature

描述

@Krinkle is introducing Karma to the jQuery test suite, and it looks like our custom context file will be fairly complex. To avoid code duplication, I'd like to reuse it for a custom debug file, but we cannot because there's apparently no documented way to detect that it's being used for debug.

Expected behaviour

Something like an %IS_DEBUG% directive that gets replaced with true or false so debug-specific processing can happen dynamically.

Actual behaviour

We have to use something like /^[/]debug\b/.test(location.pathname), but I don't think /debug.html is actually part of your public API (though it is mentioned on the troubleshooting page).

贡献者指南

Feature request: Provide an "is debug" signal · karma-runner/karma#2809 | Good First Issue