karma-runner / karma-runner/karma

Better documentation for the plugin API

Open
#2,850 8 comments 0 reactions 0 assignees View on GitHub
api type: docs
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Hey all, I am writing [Suman](https://github.com/sumanjs/suman), which is a test harness like Mocha and Jasmine, but much improved, especially for backend testing. I am looking to run Suman tests in the browser. I am almost there, but I want the Suman test harness to work with Karma. **Note** that Suman does _not_ use global variables, so I am hoping that Suman can call the Karma API, not the other way around.

I posted this question on SO:
https://stackoverflow.com/questions/46868214/how-do-i-make-a-karma-compliant-test-harness-for-the-browser

>
> My guess is that the Karma test runner does not hook in Mocha and Jasmine, rather the reverse.
>
> so I assume Mocha and Jasmine call something like this:
>
> `window.__karma__.testCasePassed(data);`
> `window.__karma__.testCaseFailed(data);`
>
> and then Karma will report these events.
>
> I am writing Suman and I want to figure out if I can make Suman Karma compliant.
>
> When I look through the Mocha and Jasmine codebase however, I am not seeing the evidence I am looking for.

My question is - does Karma have some documentation as to how to hook into Karma? I am hoping that Karma has an API that I can call. It would be to my dismay if Karma hooks into Mocha and Jasmine's globals, instead of Mocha and Jasmine calling Karma directly.

Contributor guide

Open the contributing guide

Research direction

Start with the linked Stack Overflow question and inspect how Karma, Mocha, and Jasmine integrate with one another. Document whether Karma exposes an API for external test harnesses and describe the supported integration path, or clearly state that no such API is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation, testing
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.