karma-runner/karma-requirejs — pull request #27 by MortenHoustonLudvigsen (2014-08-29 22:00:10+00:00)
Title: The adapter should prepend requirejs baseUrl if path is relative

The adapter should prepend requirejs baseUrl if path is relative and baseUrl is known.

With this change the test files can be added as relative paths. This solves the problem where requirejs does not add '.js' to absolute paths.

This can be done in main-test.js:

```javascript
var testFileRe = new RegExp("^/base/test/src/.*\\.js$");

var tests = [];

for (var file in __karma__.files) {
if (__karma__.files.hasOwnProperty(file)) {
if (testFileRe.test(file)) {
tests.push(file.replace(/^\/base\//, ""));
}
}
}

requirejs.config({
baseUrl: "/base",
deps: tests,
callback: __karma__.start
});
```