computmaxer / karma-jspm

Other
74 stars 50 forks source link

Karma start breaks with No provider for "framework:jspm"! #46

Closed Bretto closed 9 years ago

Bretto commented 9 years ago

C:\github\List-Selection-Component\node_modules\karma\node_modules\di\lib\injector.js:16 throw error('No provider for "' + name + '"!'); ^ Error: No provider for "framework:jspm"! (Resolving: framework:jspm)

Bretto commented 9 years ago

fixed just add:

plugins:[
            'karma-jasmine',
            'karma-coverage',
            'karma-jspm',
            'karma-chrome-launcher'
        ],
kristianmandrup commented 9 years ago

Add where exactly? karma.conf.js ??

Bretto commented 9 years ago

yes add it to the karma.conf.js

dmackerman commented 9 years ago

Yep, you need to first add it to the plugins array in karma.conf. Should be added to the README.

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

computmaxer commented 9 years ago

Is this plugins option actually required? I'm having no issues without it...

metamatt commented 9 years ago

Seems to me that you can run without plugins at all, but if you do define it (because you're bringing in other plugins) then you also need 'karma-jspm' in the list. If you have a list of plugins that doesn't include karma-jspm, then you get the error mentioned here.

timkindberg commented 9 years ago

I'm having this problem with jspm@0.16.0-beta.3 using TypeScript. I've added to my plugins array and specified some settings.

    frameworks: ['jspm', 'mocha', 'sinon', 'sinon-chai'],
    jspm: {
      loadFiles: [
        'node_modules/angular/angular.js',
        'node_modules/angular-mocks/angular-mocks.js',
        'test/**/*.js'
      ],
      serveFiles: [
        'src/**/*.js'
      ]
    },
/Users/tk65110/repos/clicklist_web/client/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 (/Users/tk65110/repos/clicklist_web/client/node_modules/karma/node_modules/di/lib/injector.js:22:68)
    at Object.parent.get (/Users/tk65110/repos/clicklist_web/client/node_modules/karma/node_modules/di/lib/injector.js:9:13)
    at get (/Users/tk65110/repos/clicklist_web/client/node_modules/karma/node_modules/di/lib/injector.js:54:19)
    at /Users/tk65110/repos/clicklist_web/client/node_modules/karma/lib/server.js:29:14
    at Array.forEach (native)
    at start (/Users/tk65110/repos/clicklist_web/client/node_modules/karma/lib/server.js:28:21)
    at invoke (/Users/tk65110/repos/clicklist_web/client/node_modules/karma/node_modules/di/lib/injector.js:75:15)
    at Object.exports.start (/Users/tk65110/repos/clicklist_web/client/node_modules/karma/lib/server.js:307:12)
    at Object.exports.run (/Users/tk65110/repos/clicklist_web/client/node_modules/karma/lib/cli.js:220:27)
    at Object.<anonymous> (/Users/tk65110/repos/clicklist_web/client/node_modules/karma/bin/karma:3:23)
npm ERR! Test failed.  See above for more details.
timkindberg commented 9 years ago

Sorry I had it in frameworks but not plugins... I keep thinking those are the same thing :(

hadrienl commented 8 years ago

I have the same problem since I upgraded jspm from 0.15.x to 0.16.x. Karma can't start anymore with this error : "Error: No provider for "framework:jspm"! (Resolving: framework:jspm)".

I've tried with this plugins list, but I didn't have plugins before. It didn't helps. Here is my full config :

// 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', 'es6-shim'],

    jspm: {
      // Edit this to your needs
      loadFiles: [
        'jspm_packages/github/angular/bower-angular@1.4.0/angular.js',
        'src/components/**/*.js',
        'src/config/**/*.js',
        'src/mocks/**/*.js',
        'src/app.js',
        'src/**/*.html'
      ]
    },

    // 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'],
      '**/*.html': ['ng-html2js']
    },
    'babelPreprocessor': {
      options: {
        sourceMap: 'inline',
        modules: 'system',
        moduleIds: false,
        optional: [
          "es7.decorators",
          "es7.classProperties"
        ]
      }
    },

    ngHtml2JsPreprocessor: {
      stripPrefix: 'src',
      prependPrefix: 'dist',
      moduleName: 'mocked-templates'
    },

    // 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_ERROR,

    // 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
  });
};
hadrienl commented 8 years ago

Nope ?