computmaxer / karma-jspm

Other
74 stars 50 forks source link

SystemJS was not found #171

Open ghost opened 8 years ago

ghost commented 8 years ago

Hi. I having the following problem with karma-jspm. I setup the karma.conf.js file apparently properly and it's giving me the following error:

Uncaught Error: SystemJS was not found. Please make sure you have initialized jspm via installing a dependency with jspm, or by running 'jspm dl-loader'.

karma.conf.js:

module.exports = function(config) {
    config.set({
        basePath: "",
        frameworks: ["jasmine", "jspm"],
        jspm: {
            config: "extension/config.js",
            packages: "extension/jspm_packages/",
            serveFiles: ["extension/**/*.js"],
            loadFiles: ["extension/build/test/**/*.js"],
            paths: {
                "*": "base/extension/build/*",
                "github:*": "base/extension/jspm_packages/github/*",
                "npm:*": "base/extension/jspm_packages/npm/*",
                "vendor/*": "base/extension/vendor/*",
                "injected-css/*": "base/extension/inject/*"
            },
        },
        files: [],
        exclude: [],
        reporters: ["progress"],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        autoWatch: true,
        browsers: ["Chrome"],
        singleRun: false
    });
};

SystemJs config file is: extension/config.js and it's working fine (outside the test environment).

So, how I tell karma-jspm the way to find SystemJs?

Thanks.

Roshanjossey commented 7 years ago

I came across the same problem. I fixed it by taking the following steps

Would you like jspm to prefix the jspm package.json properties under jspm? [yes]:yes Enter server baseURL (public folder path) [./]: Enter jspm packages folder [./jspm_packages]: Enter config file path [./config.js]: Configuration file config.js doesn't exist, create it? [yes]: Enter client baseURL (public folder URL) [/]: Do you wish to use a transpiler? [yes]:yes Which ES6 transpiler would you like to use, Babel, TypeScript or Traceur? [babel]:

peteringram0 commented 7 years ago

What version of JSPM are you running? I am getting the same issue with the latest beta version

dwilson6 commented 7 years ago

Here's a PR to fix this issue with the jspm 0.17 beta 41 and karma-jspm: https://github.com/computmaxer/karma-jspm/pull/187