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

Error - Can not load "coffee", it is not registered! #35

Open
AsmaGargouri opened this issue Jun 22, 2016 · 1 comment
Open

Error - Can not load "coffee", it is not registered! #35

AsmaGargouri opened this issue Jun 22, 2016 · 1 comment

Comments

@AsmaGargouri
Copy link

I installed the plugin with the command ; npm install --save-dev karma-coffee-preprocessor
I then configured my test config file as follows:

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

    basePath: '',
    frameworks: ['jasmine'],
    files: [
        '../bower_components/angular/angular.js',
        '../bower_components/angular-ui-router/release/angular-ui-router.js',
        '../bower_components/angular-mocks/angular-mocks.js',
        '../src/scripts/**/*.coffee',
        'unit-tests/**/*.js'
    ],

    exclude: [
    ],

    preprocessors: {
        '../src/scripts/**/*.coffee': ['coffee']
    },

    coffeePreprocessor: {
      options: {
        bare: true,
        sourceMap: false
      },
      transformPath: function(path) {
        return path.replace(/\.coffee$/, '.js')
      }
    },

    reporters: ['progress'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_DEBUG,
    autoWatch: true,
    browsers: ['PhantomJS'],
    singleRun: false,
    concurrency: Infinity
  })
}

But when I try to start my test I have this error :

 Can not load "coffee", it is not registered!
  Perhaps you are missing some plugin?
/opt/node/lib/node_modules/karma/node_modules/di/lib/injector.js:9
      throw error('No provider for "' + name + '"!');
      ^

Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)
    at error (/opt/node/lib/node_modules/karma/node_modules/di/lib/injector.js:22:12)
    at Object.parent.get (/opt/node/lib/node_modules/karma/node_modules/di/lib/injector.js:9:13)
    at get (/opt/node/lib/node_modules/karma/node_modules/di/lib/injector.js:54:19)
    at /opt/node/lib/node_modules/karma/lib/server.js:138:20
    at Array.forEach (native)
    at Server._start (/opt/node/lib/node_modules/karma/lib/server.js:137:21)
    at invoke (/opt/node/lib/node_modules/karma/node_modules/di/lib/injector.js:75:15)
    at Server.start (/opt/node/lib/node_modules/karma/lib/server.js:102:18)
    at Object.exports.run (/opt/node/lib/node_modules/karma/lib/cli.js:243:26)
    at Object.<anonymous> (/opt/node/lib/node_modules/karma/bin/karma:3:23)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:146:18)


Can anyone help me ?

@jakkor
Copy link

jakkor commented Aug 28, 2016

Add karma-coffee-preprocessor to plugins.
For me it was:
plugins: [
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-coffee-preprocessor'
]

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

2 participants