karma-runner / karma-runner/karma
Feature request: Provide an "is debug" signal
- 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
Assessment
This issue has not been assessed yet.