karma-runner / karma-runner/karma

Test multiple globals with the same name

Open
#1,438 5 comments 0 reactions 0 assignees View on GitHub
discuss type: backlog
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Is it currently possible to use one Karma config to test all implementations of some global?

Use case: test multiple strategies for some shim.

Found no easy way to do the following:

``` javascript
// src/a.js
function foo() { return 'a' }
// test/aSpec.js
expect(foo()).toBe('a');

// src/b.js
function foo() { return 'b' }
// test/bSpec.js
expect(foo()).toBe('b');
```

Contributor guide

Open the contributing guide

Research direction

Start by reviewing Karma's configuration and file-loading behavior for the example src/a.js, src/b.js, test/aSpec.js, and test/bSpec.js files. Determine whether one run can isolate implementations that define the same global, and identify the relevant tests for configuration or browser context setup. Done means documenting or implementing a supported way to test both strategies without global-name collisions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.