Unit testing bug in the Skeleton Navigation app

A recent update of the Skeleton Navigation App introduced changes to how the JSPM config.js file is setup. More specifically it’s all about the paths.* setting. The listing below depicts the new change.

System.config({
  "paths": {
    "*": "dist/*.js",
    "github:*": "jspm_packages/github/*.js",
    "npm:*": "jspm_packages/npm/*.js",
    "aurelia-skeleton-navigation/*": "dist/*.js"
  }
});

So as you see it points now all general import requests towards the dist folder, containing the compiled ES5 version of your code.

Sadly though this interferes with the way how Karma is loading JSPM resources in order to execute the test suite. A current workaround is to modify the source of karma-jspm. In order to do so do the following:

  1. Open the file node_packages/karma-jspm/src/adapter.js
  2. At around line 38 after the config of the baseURL insert following override:
1
2
3
4
5
6
// Overriding * path mapping
System.config({
paths: {
'*': '*.js'
}
});

That should get you going in the meantime until an official solution is available.


Photo credit: dead fly via photopin (license)

Vildan Softic

Vildan Softic is a consultant and software developer from Austria. He is passionate about developing Single Page Applications, grinding LOB Apps with .NET and is pushing towards Node.JS development.