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

Cannot start karma #161

Closed
hadrienl opened this issue Jun 14, 2016 · 1 comment
Closed

Cannot start karma #161

hadrienl opened this issue Jun 14, 2016 · 1 comment

Comments

@hadrienl
Copy link

Hi,

I'm trying to start karma test with jspm to use it with this scaffold. But karma cannot start like I described it in this issue. So I tried to make karma-jspm work with an empty project. And it doesn't work neither.

I have the following package.js:

{
  "name": "test-jspm-karma",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel": "^6.5.2",
    "jspm": "^0.16.39",
    "karma": "^0.13.22",
    "karma-jspm": "^2.1.1",
    "karma-phantomjs-launcher": "^1.0.0",
    "phantomjs-prebuilt": "^2.1.7"
  }
}

and this karma.conf:

// Karma configuration
// Generated on Fri Dec 05 2014 16:49:29 GMT-0500 (EST)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',


    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jspm', 'jasmine'],

    plugins: ['karma-jspm', 'karma-phantomjs-launcher'],

    jspm: {
      // Edit this to your needs
      loadFiles: ['src/**/*.js', 'test/**/*.js']
    },


    // list of files / patterns to load in the browser
    files: [],


    // list of files to exclude
    exclude: [],


    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
      'test/**/*.js': ['babel'],
      'src/**/*.js': ['babel']
    },
    'babelPreprocessor': {
      options: {
        sourceMap: 'inline',
        modules: 'system',
        moduleIds: false,
        optional: [
          "es7.decorators",
          "es7.classProperties"
        ]
      }
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],


    // web server port
    port: 9876,


    // enable / disable colors in the output (reporters and logs)
    colors: true,


    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,


    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,


    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['PhantomJS'],


    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false
  });
};

Then, when I karma start :

karma start
(node:27514) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
WARN [plugin]: Cannot find plugin "karma-jspm".
  Did you forget to install it ?
  npm install karma-jspm --save-dev
/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:9
      throw error('No provider for "' + name + '"!');
      ^

Error: No provider for "framework:jspm"! (Resolving: framework:jspm)
    at error (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:22:12)
    at Object.parent.get (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:9:13)
    at get (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:54:19)
    at /usr/local/lib/node_modules/karma/lib/server.js:29:14
    at Array.forEach (native)
    at start (/usr/local/lib/node_modules/karma/lib/server.js:28:21)
    at invoke (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:75:15)
    at Object.exports.start (/usr/local/lib/node_modules/karma/lib/server.js:307:12)
    at Object.exports.run (/usr/local/lib/node_modules/karma/lib/cli.js:220:27)
    at Object.<anonymous> (/usr/local/lib/node_modules/karma/bin/karma:3:23)
@hadrienl
Copy link
Author

Well… I've tried with local binary (./node_modules/.bin/karma start) and it worked… so nevermind.

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

No branches or pull requests

1 participant