karma-runner / karma-runner/karma
Test multiple globals with the same name
- 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
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