Skip to content

404s from unclear karma.basePath karma-systemjs.config.baseURL and config.baseURL dependencies. #41

Description

@richburdon

I get 404s when my tests try to reference SystemJS modules (conf files below). E.g.,

Error: XHR error (404 Not Found) loading http://localhost:9876/lib/github/angular/bower-angular@1.4.4.js

But I have added these systemjs libs to the systemjs "file" def (below). Although it's not clear to me why I need to add any of this since it seems that all of the appropriate information can be gleaned from the config.js?

[karma.conf.js]

"basePath": "src/main/javascript",
"systemjs": {
  "configFile": "config.js",
  "files": [
    "app/testing/**/*.js",
    "lib/**/*.js",
    "lib/github/angular/bower-angular@1.4.4.js"     // Explicitly added but still 404!
  ],
  "config": {
    "baseURL": "../../..",             // To counteract basePath: "src/main/javascript"
    "paths": {
      "babel": "node_modules/babel-core/browser.js",
      "es6-module-loader": "node_modules/es6-module-loader/dist/es6-module-loader.js",
      "phantomjs-polyfill": "node_modules/phantomjs-polyfill/bind-polyfill.js",
      "system-polyfills": "node_modules/systemjs/dist/system-polyfills.js",
      "systemjs": "node_modules/systemjs/dist/system.js"

[config.js]

System.config({
"baseURL": "/js",
"defaultJSExtensions": true,
"transpiler": "babel",
"paths": {
"github:": "lib/github/",
"npm:": "lib/npm/"
}
});

System.config({
"map": {
"angular": "github:angular/bower-angular@1.4.4",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions