Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The adapter should prepend requirejs baseUrl if path is relative #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MortenHoustonLudvigsen
Copy link

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:

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
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant