Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)
Hi guys, is the documentation for this wrong or something?
If I do this:
// karma.conf.js
module.exports = function(config) {
config.set({
frameworks: ['jasmine'],
});
}
I get the error:
Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)
But if I add karma-jasmine to plugins as well, it works:
// karma.conf.js
module.exports = function(config) {
config.set({
plugins: ['karma-jasmine'],
frameworks: ['jasmine'],
});
}
Why do I need it in both?
AFAICT, the 'plugins' entry is a list of npm modules, it tells karma what node modules to load. The frameworks entry is telling jasmine what to expect from some plugin. So your error occurs because you declared that you want to use jasmine framework but did not list an npm module in plugings that provides jasmine.
It appears that the design supports listing lots of plugins but then selecting one or more of them with frameworks. I don't understand why the existence of a plugin karma-jasmine is not enough.
But you reported this a documentation bug: which page are you reading that is incorrect?
The version that @onlywei reported as not working is taken almost directly from the "Configuration" section of the karma-jasmine README.md, which tells the user to populate the "frameworks" section but doesn't mention the plugins anywhere.
Your pull request to improve the readme would be welcomed.