karma-runner / karma-runner/karma
Debug karma.error is not a function
- Dominant language
- JavaScript
- Stars
- 12k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
### Expected behavior
When karma is run in debug and a karma adapter calls `__karma__.error`, the error message should be printed on the console.
### Actual behavior
When karma is run in debug, debug.html defines the `window.__karma__` object but does not include an error function. Then, when a karma adapter calls `__karma__.error`, the error message printed is `karma.error is not a function` which occludes the real error.
There is at least one [occurrence](https://github.com/rolaveric/karma-systemjs/issues/40) reported in the wild.
### Enviroment Details
- Karma version (output of `karma --version`): 0.13.22
- Relevant part of your `karma.config.js` file
> frameworks: ['jspm', ...]
or other adapter which calls karma.error.
### Steps to reproduce the behaviour
1. Mock an adapter which alway calls window.**karma**.error with a message.
2. Start karma on any test suite in debug.
3. The intended error message is not printed on the console.
Contributor guide
Research direction
Start with debug.html, where the window.__karma__ object is defined, and compare its available callbacks with the adapter API. Reproduce the issue using an adapter that calls window.__karma__.error in debug mode, then verify that the adapter's intended error message appears in the console instead of a missing-function error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100