{"action":"created","issue":{"url":"https://api.github.com/repos/karma-runner/karma/issues/1435","labels_url":"https://api.github.com/repos/karma-runner/karma/issues/1435/labels{/name}","comments_url":"https://api.github.com/repos/karma-runner/karma/issues/1435/comments","events_url":"https://api.github.com/repos/karma-runner/karma/issues/1435/events","html_url":"https://github.com/karma-runner/karma/issues/1435","id":85745614,"number":1435,"title":"Issues in creating a new karma plugin. ","user":{"login":"antoaravinth","id":1241511,"avatar_url":"https://avatars.githubusercontent.com/u/1241511?v=3","gravatar_id":"","url":"https://api.github.com/users/antoaravinth","html_url":"https://github.com/antoaravinth","followers_url":"https://api.github.com/users/antoaravinth/followers","following_url":"https://api.github.com/users/antoaravinth/following{/other_user}","gists_url":"https://api.github.com/users/antoaravinth/gists{/gist_id}","starred_url":"https://api.github.com/users/antoaravinth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoaravinth/subscriptions","organizations_url":"https://api.github.com/users/antoaravinth/orgs","repos_url":"https://api.github.com/users/antoaravinth/repos","events_url":"https://api.github.com/users/antoaravinth/events{/privacy}","received_events_url":"https://api.github.com/users/antoaravinth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-06T12:27:40Z","updated_at":"2015-06-09T06:46:18Z","closed_at":null,"body":"Hi I'm trying to create an karma plugin. Looks like I'm missing something down the line. \r\n\r\nMy `package.json` is\r\n\r\n```\r\n{\r\n  \"name\": \"testing\",\r\n  \"version\": \"0.0.1\",\r\n  \"description\": \"Test\",\r\n  \"main\": \"index.js\",\r\n  \"scripts\": {\r\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\r\n  },\r\n  \"keywords\": [\r\n    \"grooscript\",\r\n    \"karma-grooscript\"\r\n  ],\r\n  \"devDependencies\": {\r\n    \"karma\": \"^0.12.36\",\r\n    \"grooscript\" : \"1.1.1\"\r\n  }\r\n}\r\n```\r\n\r\nand my `index.js` is:\r\n\r\n```\r\nvar path = require('path');\r\n\r\nvar pattern = function(file) {\r\n    return {pattern: file, included: true, served: true, watched: false};\r\n};\r\n\r\nvar framework = function(files) {\r\n    files.unshift(pattern(path.join(__dirname, 'adapter.js')));\r\n    files.unshift(pattern(path.resolve(require.resolve('grooscript'), '../grooscript.js')));\r\n};\r\n\r\nframework.$inject = ['config.files'];\r\nmodule.exports = {'framework:testing': ['factory', framework]};\r\n```\r\n\r\nand my `adapter.js` is:\r\n\r\n```\r\nvar gs;\r\n(function(window) {\r\n    window.gs = window.gs;\r\n})(window);\r\n```\r\n\r\nAll these files reside in a parent directory something like this:\r\n\r\n```\r\ntesting/\r\n    index.js\r\n    adapter.js\r\n    package.json\r\n```\r\n\r\nAnd in order to test them, I created an sample karma project. I installed the above plugin in the sample karma project like this:\r\n\r\n```\r\nnpm link ../testing\r\n```\r\n\r\nwhich does install it (could able to see under the `node_module` directory). Then in the karma `config.js`, I added `testing` as frameworks:\r\n\r\n```\r\nmodule.exports = function(config) {\r\n  config.set({\r\n    // base path, that will be used to resolve files and exclude\r\n    basePath: '',\r\n\r\n    frameworks: ['jasmine', 'dojo',\"testing\"] // <--- here\r\n```\r\n\r\nOnce done, if I run the karma like:\r\n\r\n```\r\nkarma start\r\n```\r\n\r\nI get an error like this:\r\n\r\n```\r\n/Users/user/programs/groovy/grooscript/esri-karma-tutorial/node_modules/karma/node_modules/di/lib/injector.js:9\r\n      throw error('No provider for \"' + name + '\"!');\r\n            ^\r\nError: No provider for \"framework:testing\"! (Resolving: framework:testing)\r\n    at error (/Users/user/programs/groovy/grooscript/esri-karma-tutorial/node_modules/karma/node_modules/di/lib/injector.js:22:68)\r\n    at Object.parent.get (/Users/user/programs/groovy/grooscript/esri-karma-tutorial/node_modules/karma/node_modules/di/lib/injector.js:9:13)\r\n    at get (/Users/user/programs/groovy/grooscript/esri-karma-tutorial/node_modules/karma/node_modules/di/lib/injector.js:54:19)\r\n```\r\n\r\nwhere I'm making mistake?"},"comment":{"url":"https://api.github.com/repos/karma-runner/karma/issues/comments/110247733","html_url":"https://github.com/karma-runner/karma/issues/1435#issuecomment-110247733","issue_url":"https://api.github.com/repos/karma-runner/karma/issues/1435","id":110247733,"user":{"login":"antoaravinth","id":1241511,"avatar_url":"https://avatars.githubusercontent.com/u/1241511?v=3","gravatar_id":"","url":"https://api.github.com/users/antoaravinth","html_url":"https://github.com/antoaravinth","followers_url":"https://api.github.com/users/antoaravinth/followers","following_url":"https://api.github.com/users/antoaravinth/following{/other_user}","gists_url":"https://api.github.com/users/antoaravinth/gists{/gist_id}","starred_url":"https://api.github.com/users/antoaravinth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoaravinth/subscriptions","organizations_url":"https://api.github.com/users/antoaravinth/orgs","repos_url":"https://api.github.com/users/antoaravinth/repos","events_url":"https://api.github.com/users/antoaravinth/events{/privacy}","received_events_url":"https://api.github.com/users/antoaravinth/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T06:46:18Z","updated_at":"2015-06-09T06:46:18Z","body":"@maksimr : Thanks for your help. However in the debug page, I could able to see `gs` defined. But not in the karma running context. I'm confused. \r\n\r\nAny ideas, of why does this would happen? "}}