karma-runner / karma-runner/karma

Relative paths in karma.conf.js and test-main.js for requirejs

Open
#1,710 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

It seems that in the `karma.conf.js`, the files array will not accept relative paths above the `basePath`. It also seems like the requirejs config the `baseUrl` is not accepting relative paths, altho maybe that's because I'm getting messed up with the whole `/base` thing (see issue https://github.com/karma-runner/karma/issues/1607).

I think it is best to try to handle relative paths as people are used to (with node's require and so on), so any unexpected hurdles to this should be removed if at all possible.

There's a related unanswered Stackoverflow question: [Karma and RequireJS getting files outside base url](http://stackoverflow.com/questions/29824193/karma-and-requirejs-getting-files-outside-base-url?rq=1).

If the answer is `wontfix`, that's understandable I suppose and I can close this.

Contributor guide

Open the contributing guide

Research direction

Start by examining karma.conf.js and test-main.js, focusing on how basePath, the files array, and RequireJS baseUrl handle paths outside the base directory. Reproduce the reported behavior using the linked Karma issue and Stack Overflow question as context. Done means establishing whether relative paths can work as requested or documenting a clear wontfix outcome.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.