eugene-sea / karma-cucumber-js

Karma adapter for running Cucumber.js features
10 stars 4 forks source link

No provider for "framework:cucumber-js"! (Resolving: framework:cucumber-js) #8

Closed JimLynchCodes closed 8 years ago

JimLynchCodes commented 8 years ago

Odd, I followed all of the steps, but when I run the command: `` I still get this error:

/Users/jim/Git-Projects/Flexbox-Push-Drawer-Example/node_modules/di/lib/injector.js:9 throw error('No provider for "' + name + '"!'); ^

Error: No provider for "framework:cucumber-js"! (Resolving: framework:cucumber-js) at error (/Users/jim/Git-Projects/Flexbox-Push-Drawer-Example/node_modules/di/lib/injector.js:22:12) at Object.parent.get (/Users/jim/Git-Projects/Flexbox-Push-Drawer-Example/node_modules/di/lib/injector.js:9:13) at get (/Users/jim/Git-Projects/Flexbox-Push-Drawer-Example/node_modules/di/lib/injector.js:54:19) at /Users/jim/Git-Projects/Flexbox-Push-Drawer-Example/node_modules/karma/lib/server.js:138:20 at Array.forEach (native) at Server._start (/Users/jim/Git-Projects/Flexbox-Push-Drawer-Example/node_modules/karma/lib/server.js:137:21) at invoke (/Users/jim/Git-Projects/Flexbox-Push-Drawer-Example/node_modules/di/lib/injector.js:75:15) at Server.start (/Users/jim/Git-Projects/Flexbox-Push-Drawer-Example/node_modules/karma/lib/server.js:102:18) at Object.exports.run (/Users/jim/Git-Projects/Flexbox-Push-Drawer-Example/node_modules/karma/lib/cli.js:243:26) at Object. (/Users/jim/Git-Projects/Flexbox-Push-Drawer-Example/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:148:18)

flexbox-push-drawer-example_ _-bash_ _157x24_and_eugene-sea_karma-cucumber-js__karma_adapter_for_running_cucumber_js_features_and_karma-c_conf_js_-_flexbox-push-drawer-example_-____git-projects_flexbox-push-drawer-example_

eugene-sea commented 8 years ago

Is this project present on GitHub? I need to look at it to help.

eugene-sea commented 8 years ago

If it is not present post here your karma.conf.js and output from karma with verbose logging ("--log-level=DEBUG")

JimLynchCodes commented 8 years ago

Hi. Thanks for the quick response! Unfortunately, I used your config file exactly (changing the js to ts though), but it still doesn't work; exact same error. Also, what is "./lib/index.js'"?

The project is on github here:https://github.com/JimTheMan/Flexbox-Push-Drawer-Example

Thanks.

flexbox-push-drawer-example_ _-bash_ _157x27

eugene-sea commented 8 years ago

You do not need "./lib/index.js".

The issue is with somewhat confusing karma behavior. If you specify at least one plugin in karma.conf.js then you need to specify all frameworks also in plugins section like this:

    frameworks: ['cucumber-js'],

    plugins: [
      'karma-chrome-launcher',
      'karma-cucumber-js'
    ],

If you do not have plugins section, then just frameworks section will be enough. In your case you could omit karma-chrome-launcher and so if you do not need any other plugins then just remove whole plugins section and it will work (just leave frameworks section).

eugene-sea commented 8 years ago

I have updated README.md to cover this case

JimLynchCodes commented 8 years ago

HUZZAAH!

I've been bouncing back and forth between this and the s9tpepper project trying to get one working. My problem was that in the plugins section I had 'karma-cucumberjs' instead of 'karma-cucumber-js'.

Phew, now that I have something working I can get down to the real work. :)

Anyway, thanks for writing this library and helping me out!