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:mocha"! (Resolving: framework:mocha) #42

Closed
fakewaffle opened this Issue Aug 5, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@fakewaffle
Copy link

fakewaffle commented Aug 5, 2014

I'm pretty sure I am missing something obvious... Anything I need in karma.conf.js in addition to this?:

'frameworks' : [ 'mocha' ],

'client' : {
    'mocha' : {
        'ui' : 'tdd'
    }
}
$ ./node_modules/karma/bin/karma start

/Users/folder/node_modules/karma/node_modules/di/lib/injector.js:9
      throw error('No provider for "' + name + '"!');
            ^
Error: No provider for "framework:mocha"! (Resolving: framework:mocha)
    at error (/Users/folder/node_modules/karma/node_modules/di/lib/injector.js:22:68)
    at Object.parent.get (/Users/folder/node_modules/karma/node_modules/di/lib/injector.js:9:13)
    at get (/Users/folder/node_modules/karma/node_modules/di/lib/injector.js:54:19)
    at /Users/folder/node_modules/karma/lib/server.js:31:14
    at Array.forEach (native)
    at start (/Users/folder/node_modules/karma/lib/server.js:30:21)
    at invoke (/Users/folder/node_modules/karma/node_modules/di/lib/injector.js:75:15)
    at Object.exports.start (/Users/folder/node_modules/karma/lib/server.js:310:12)
    at Object.exports.run (/Users/folder/node_modules/karma/lib/cli.js:224:25)
    at Object.<anonymous> (/Users/folder/node_modules/karma/bin/karma:3:23)
@fakewaffle

This comment has been minimized.

Copy link

fakewaffle commented Aug 5, 2014

Looks like it was a missing:

'plugins' : [
    'karma-mocha'
]

@fakewaffle fakewaffle closed this Aug 5, 2014

@JustinYi922

This comment has been minimized.

Copy link

JustinYi922 commented Jun 14, 2017

I also installed karma-mocha under the prompt. However,it does not work.

14 06 2017 20:26:15.334:ERROR [plugin]: Cannot find plugin "karma-mocha".
Did you forget to install it?
npm install karma-mocha --save-dev
14 06 2017 20:26:15.341:ERROR [preprocess]: Can not load "webpack", it is not registered!
Perhaps you are missing some plugin?
/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:9
throw error('No provider for "' + name + '"!');
^

Error: No provider for "framework:mocha"! (Resolving: framework:mocha)
at error (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:22:12)
at Object.get (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:9:13)
at Injector.get (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:54:19)
at /usr/local/lib/node_modules/karma/lib/server.js:143:20
at Array.forEach (native)
at Server._start (/usr/local/lib/node_modules/karma/lib/server.js:142:21)
at Injector.invoke (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:75:15)
at Server.start (/usr/local/lib/node_modules/karma/lib/server.js:103:18)
at Object.exports.run (/usr/local/lib/node_modules/karma/lib/cli.js:280:26)
at Object. (/usr/local/lib/node_modules/karma/bin/karma:3:23)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
image

@grofit

This comment has been minimized.

Copy link

grofit commented Aug 24, 2017

Just incase anyone else gets this like I did, you need to add it to plugins but like this:

plugins: [
   require("my-plugin-name") // i.e karma-mocha, karma-webpack etc
]

oki2a24 added a commit to oki2a24/kanban-app that referenced this issue Jan 20, 2019

fix: 8.8.7 単体テストユーティリティの導入。Vue Test Utilsによる効率化。この状態で動かないのを修正する
エラーメッセージを検索して、対処していった。

プラグイン不足

- javascript - Vue-test-utils can't find `Set()`: ReferenceError: Can't find variable: Set - Stack Overflow https://stackoverflow.com/questions/53764988/vue-test-utils-cant-find-set-referenceerror-cant-find-variable-set
- javascript - karma plugin dependencies not being found - Stack Overflow https://stackoverflow.com/questions/32425580/karma-plugin-dependencies-not-being-found
- Error: No provider for "framework:mocha"! (Resolving: framework:mocha) · Issue #42 · karma-runner/karma-mocha karma-runner/karma-mocha#42 (comment)
- Reporter plugins not working with karma 1.1.1? · Issue #2246 · karma-runner/karma karma-runner/karma#2246 (comment)
- "Can not load "coverage", it is not registered!" error when running · Issue #59 · karma-runner/karma-coverage karma-runner/karma-coverage#59 (comment)

Chrome Headless を使用するために Chromium インストールとパスを設定
apt-get update
apt-get install chromium
hromium --version
export CHROME_BIN=/usr/bin/chromium

- [launcher]: No binary for Chrome browser on your platform. · Issue #62 · karma-runner/karma-chrome-launcher karma-runner/karma-chrome-launcher#62
- Dockerを使ってHeadless Chromeを動かしてみる - Qiita https://qiita.com/dd511805/items/dfe03c5486bf1421875a
- Puppeteer をDockerコンテナで利用する - Qiita https://qiita.com/HeRo/items/9be64b559692e12cc109

Chrome Headless の起動オプション設定

- ChromeHeadless can't run as root with --no-sandbox anymore · Issue #158 · karma-runner/karma-chrome-launcher karma-runner/karma-chrome-launcher#158 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment