When I attempt to start a config file, I am presented with the error message "no provider for "framework:jasmine"!.
Here are the steps I took to install karma:
I created a folder called C:\Karma
npm install karma --save-dev
npm install karma-jasmine karma-chrome-launcher --save-dev
npm install -g karma-cli
I verified that the folder contains the following
node_modules\karma
node_modules\karma-chrome-launcher
node_modules\karma-jasmine
node_modules\jasmine-core
My config file is in another directory so I navigate there and type
karma start karma-fw.conf.js
At this point I am presented with the framework error
Any help would be GREATLY appreciated! Thanks!
@pjlasl can you post your config file?
Thanks
Hope this helps
// Karma configuration
// Generated on Mon Oct 13 2014 07:50:03 GMT-0500 (Central Daylight Time)
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: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.js',
'https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-resource.js',
'https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.11.0/ui-bootstrap-tpls.min.js',
'https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-mocks.js',
'src/main/**/*.js',
'src/test/**/*Spec.js'
],
// 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 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: ['Chrome'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});
};
The bizarre thing about all this is that a co-worker of mine is using it without a hitch...
@pjlasl Thanks!
What structure of the project?(where located karma.conf and node_modules, and where you run karma start)
Can you run karma in verbose mode karma start --log-level=DEBUG.
Seems karma can't find project node_modules.
@pjlasl any updates? Is this still an issue?
@Dignifiedquire Sorry for the delayed reply. It is working. I had to load karma and all supporting tools where my project resided to get it to work properly.
I struggled with the exact same problem. After investigating I realized that karma was running globally using '/usr/' directory as the base folder.
A solution that worked for me was to replace karma with karma-cli:
npm remove -g karma
npm install -g karma-cli
Most helpful comment
I struggled with the exact same problem. After investigating I realized that karma was running globally using '/usr/' directory as the base folder.
A solution that worked for me was to replace karma with karma-cli:
npm remove -g karmanpm install -g karma-cli