karma-runner / karma-runner/karma

Feature request: Provide an "is debug" signal

Open
#2,809 1 comment 0 reactions 0 assignees View on GitHub
help wanted type: feature
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

@Krinkle is [introducing Karma to the jQuery test suite](https://github.com/jquery/jquery/pull/3744), 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](https://github.com/karma-runner/karma/blob/51b4f6461dfb22aafb86ddd1d640cf466d3ff3ae/lib/middleware/karma.js#L235-L240) 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](http://karma-runner.github.io/1.0/intro/troubleshooting.html)).

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.