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: No provider for "framework:jasmine"! (Resolving: framework:jasmine) #205

Open
onlywei opened this issue Apr 5, 2018 · 3 comments

Comments

@onlywei
Copy link

onlywei commented Apr 5, 2018

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?

@johnjbarton
Copy link
Contributor

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?

@mdb07a
Copy link

mdb07a commented May 3, 2018

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.

@johnjbarton
Copy link
Contributor

Your pull request to improve the readme would be welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants