Error: You need to include some adapter that implements __karma__.start method











up vote
74
down vote

favorite
6












I'm trying to add some unit tests to one of my projects.



So far I've installed and configured karma, and have installed jasmine. I've one test file in my test/ folder.



The karma server has started, the browser page is ready, but karma run fails as follows:



$ karma run karma-conf.js 
[2014-06-14 15:19:11.046] [DEBUG] config - Loading config /foo/test/karma-conf.js
Waiting for previous execution...
Chrome 35.0.1916 (Linux) ERROR
You need to include some adapter that implements __karma__.start method!


This error message doesn't Google well.



Is this something obvious, or do I need to provide more information?










share|improve this question


















  • 2




    Wanted to note I was receiving this error due to preprocessor syntax errors I hadn't noticed at first.
    – BradGreens
    Sep 18 '15 at 4:09















up vote
74
down vote

favorite
6












I'm trying to add some unit tests to one of my projects.



So far I've installed and configured karma, and have installed jasmine. I've one test file in my test/ folder.



The karma server has started, the browser page is ready, but karma run fails as follows:



$ karma run karma-conf.js 
[2014-06-14 15:19:11.046] [DEBUG] config - Loading config /foo/test/karma-conf.js
Waiting for previous execution...
Chrome 35.0.1916 (Linux) ERROR
You need to include some adapter that implements __karma__.start method!


This error message doesn't Google well.



Is this something obvious, or do I need to provide more information?










share|improve this question


















  • 2




    Wanted to note I was receiving this error due to preprocessor syntax errors I hadn't noticed at first.
    – BradGreens
    Sep 18 '15 at 4:09













up vote
74
down vote

favorite
6









up vote
74
down vote

favorite
6






6





I'm trying to add some unit tests to one of my projects.



So far I've installed and configured karma, and have installed jasmine. I've one test file in my test/ folder.



The karma server has started, the browser page is ready, but karma run fails as follows:



$ karma run karma-conf.js 
[2014-06-14 15:19:11.046] [DEBUG] config - Loading config /foo/test/karma-conf.js
Waiting for previous execution...
Chrome 35.0.1916 (Linux) ERROR
You need to include some adapter that implements __karma__.start method!


This error message doesn't Google well.



Is this something obvious, or do I need to provide more information?










share|improve this question













I'm trying to add some unit tests to one of my projects.



So far I've installed and configured karma, and have installed jasmine. I've one test file in my test/ folder.



The karma server has started, the browser page is ready, but karma run fails as follows:



$ karma run karma-conf.js 
[2014-06-14 15:19:11.046] [DEBUG] config - Loading config /foo/test/karma-conf.js
Waiting for previous execution...
Chrome 35.0.1916 (Linux) ERROR
You need to include some adapter that implements __karma__.start method!


This error message doesn't Google well.



Is this something obvious, or do I need to provide more information?







karma-runner karma-jasmine






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jun 14 '14 at 14:24









Drew Noakes

182k113519602




182k113519602








  • 2




    Wanted to note I was receiving this error due to preprocessor syntax errors I hadn't noticed at first.
    – BradGreens
    Sep 18 '15 at 4:09














  • 2




    Wanted to note I was receiving this error due to preprocessor syntax errors I hadn't noticed at first.
    – BradGreens
    Sep 18 '15 at 4:09








2




2




Wanted to note I was receiving this error due to preprocessor syntax errors I hadn't noticed at first.
– BradGreens
Sep 18 '15 at 4:09




Wanted to note I was receiving this error due to preprocessor syntax errors I hadn't noticed at first.
– BradGreens
Sep 18 '15 at 4:09












23 Answers
23






active

oldest

votes

















up vote
66
down vote



accepted










It does seem like this is a very general error, however in my case the problem was either that I didn't run karma start from the correct folder, or that I didn't restart it after changing the configuration.



I'll leave this question open and hopefully it can become a resource for others who experience this error message.






share|improve this answer

















  • 21




    Same for me - running karma start test/karma.conf.js did the trick for me. The right directory may be different for you.
    – Jason
    Oct 24 '14 at 6:56








  • 4




    Helped me too; I was in the wrong directory.
    – ericso
    Dec 1 '14 at 14:44






  • 2




    I got this error when adding preprocessors: { 'src/**/*.js': ['babel'] }, any ideas?
    – SuperUberDuper
    Nov 15 '16 at 11:50






  • 3




    For me changing test/**/*.{js,jsx} to test/**/*.+(js|jsx) fixed this error. How bizarre!
    – juniper-
    Apr 11 '17 at 20:46






  • 1




    Also such error can appear if karma config has typo
    – sergolius
    Apr 7 at 10:27


















up vote
24
down vote













If you name your karma config file karma.conf.js, you can simply type karma start.



Otherwise specify the filename karma start karmafile.js



(I was in the right directory, but was not specifying a file name.)






share|improve this answer




























    up vote
    12
    down vote













    You need to run your karma run or whatever function in the folder where karma-conf.js is in.






    share|improve this answer




























      up vote
      7
      down vote













      In my case I had to rename the file to karma.conf.js then do karma start






      share|improve this answer




























        up vote
        6
        down vote













        I was not running karma start command from the path where my karma.conf.js was. I switched to that folder and ran the same command. Thats all






        share|improve this answer




























          up vote
          5
          down vote













          I had a problem with karma.conf.js file code format:



          files: [
          // Modules
          ,"client/bower_components/angular/angular.min.js"
          ,"client/bower_components/angular-mocks/angular-mocks.js"
          // App
          ,"client/app/app.module.js"
          // Test
          // ,"test/**/*.spec.js"
          ],


          The extra comma in files array have cause this error:



          You need to include some adapter that implements __karma__.start method!





          share|improve this answer




























            up vote
            4
            down vote













            I was facing this issue while running specs on the Angular.js codebase. I had to run npm install karma-jasmine -g to get this working.






            share|improve this answer




























              up vote
              3
              down vote













              If you typing "karma start", you must have a karma.conf.js file in the current folder. or just "karma start /path/karma.conf.js"



              Try to create a new karmar.conf.js by "karma init /path/karma.conf.js"






              share|improve this answer




























                up vote
                2
                down vote













                I was getting the same error because the project was using Babel 6 and I had forgotten to add the babelrc file. Just sharing in case this could help.






                share|improve this answer




























                  up vote
                  2
                  down vote













                  In my case, the message was in fact very descriptive: I forgot to add an adapter, in my case Jasmine, into the config file. Thus:



                  module.exports = function(config) {
                  config.set({
                  browsers: ['Chrome'],
                  singleRun: true,
                  frameworks: ['jasmine'],
                  files: [
                  // ... files ...
                  ],
                  // other configs
                  });
                  };





                  share|improve this answer




























                    up vote
                    2
                    down vote













                    You need to configure your "my.conf.js" file, because it contains all the info to use to test your code.



                    All what you need to write is this:



                    The configuration file can be generated using karma init:



                    $ karma init my.conf.js


                    Which testing framework do you want to use?
                    Press tab to list possible options. Enter to move to the next question.




                    jasmine




                    Do you want to use Require.js?
                    This will add Require.js plugin.
                    Press tab to list possible options. Enter to move to the next question.




                    no




                    Do you want to capture a browser automatically?
                    Press tab to list possible options. Enter empty string to move to the next question.




                    Chrome




                    What is the location of your source and test files?
                    You can use glob patterns, eg. "js/*.js" or "test/**/*Spec.js".
                    Press Enter to move to the next question.




                    *.js
                    test/**/*.js




                    Should any of the files included by the previous patterns be excluded?
                    You can use glob patterns, eg. "**/*.swp".




                    Press Enter to move to the next question.




                    Do you want Karma to watch all the files and run the tests on change?
                    Press tab to list possible options.




                    yes




                    Config file generated at "/Users/vojta/Code/karma/my.conf.js".






                    share|improve this answer




























                      up vote
                      1
                      down vote













                      In my case, I was applying by mistake the commonjs preprocessor to the karma-* modules and the adapter.js from karma-chrome and karma-firefox was broken this way.



                      Unfortunately, this is a very generic error.






                      share|improve this answer





















                      • Could you provide more background into the fix you did? This might be getting me right now as I know I am using karma-chrome. Thanks!
                        – daniel.caspers
                        Apr 11 '16 at 15:42










                      • Do you apply the commonjs preprocessor (is it configured in karma runner)? If yes, make sure that it's not applied to the files in the karma-* modules.
                        – Adrian Ber
                        Apr 11 '16 at 18:39


















                      up vote
                      1
                      down vote













                      I must add that in my case karma was giving me the error because I had [square] brackets in the name of one of the parent folders.






                      share|improve this answer




























                        up vote
                        1
                        down vote













                        Tt's complaining about the adapter which is probably jasmine or mocha.
                        Either the adapter is missing, either is not setup correctly, either it's an outdated or buggy version of the adapter.



                        In my case I had an old version of mocha 2.5.3 which was not compatible with karma 1+.
                        I updated the mocha dependency to the latest version available 3.2.0 and the problem solved.






                        share|improve this answer




























                          up vote
                          1
                          down vote













                          While working on numerous vaguely described errors, I tried setting basePath: '../', After correcting other errors (like missing commas that were described as object content errors) the last change back to basePath: '', got karma to work. karma's error statements need a lot of work. It is not simple to get it going.






                          share|improve this answer




























                            up vote
                            0
                            down vote













                            FWIW - sourcing the file path of karma.conf.js worked for me locally, but not on my jenkins builder. I have zero clue why this is the case, but on jenkins it was throwing this error unless the karma.conf.js file was in the root directory where the karma command was given. I'm using rails and running the js specs through a rake task. Code is below which might be helpful for some.



                            https://gist.github.com/daino3/a39486ff8bfc1668e923






                            share|improve this answer




























                              up vote
                              0
                              down vote













                              The issue in my case was that karma didn't pick up any files. Fixing it in karma.conf.js solved the issue.






                              share|improve this answer




























                                up vote
                                0
                                down vote













                                Same issue happened to me, and it was due to an outdated module.



                                Running npm update solved it.






                                share|improve this answer




























                                  up vote
                                  0
                                  down vote













                                  In my case, it was not karma-related at all! I run karma from gulp, with ES6/babel, and there was actually a code syntax error, flagged by a babel error above my karma:




                                  ERROR [preprocessor.babel]: xxx.js: Unexpected token (19:83)




                                  I fixed that in my src and karma was happy again.






                                  share|improve this answer




























                                    up vote
                                    0
                                    down vote













                                    I had the same issue. My browser would open but on my terminal it threw the following error



                                    30 08 2017 11:19:28.272:INFO [Chrome 58.0.3029 (Linux 0.0.0)]: Connected `enter code here`on socket 5sSs6E5KmpUVRp6LAAAB with id 93886631
                                    Chrome 58.0.3029 (Linux 0.0.0) ERRORSome of your tests did a full page reload!


                                    I checked my karma.conf.js file. In the framework array , i had included jasmine and requirejs. But i had only installed karma-jasmine.Removing requireJS and rerunning the karma start worked!






                                    share|improve this answer




























                                      up vote
                                      0
                                      down vote













                                      I've been struggling with this too. What I came up to is that this error occurs because one of the following reasons




                                      • No test adapter installed or defined (frameworks property in karma.conf.js

                                      • No karma configuration found (ie, no karma.conf.js in current dir or no config file specified in command)


                                      My problem was that my config file was named karma.config.js instead of karma.conf.js.



                                      If you've installed the test adapter but it still doesn't work, try running karma init and go through the guided config setup.






                                      share|improve this answer




























                                        up vote
                                        0
                                        down vote













                                        In my case, the configuration file name was different. So, running the command specifying the conf file solved my issue.



                                        >> karma start unit-tests.conf.js
                                        No captured browser, open http://localhost:9876/
                                        ...


                                        And for 'PhantomJS', opening the link specified(localhost:9876) in the browser executes the test cases.



                                        Hope it helps. :)



                                        EDIT 1: My Karma Config File



                                        module.exports = function(config) {
                                        config.set({

                                        // base path that will be used to resolve all patterns (eg. files, exclude)
                                        basePath: '',


                                        // frameworks to use
                                        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
                                        frameworks: ['jasmine'],


                                        // list of files / patterns to load in the browser
                                        files: [
                                        './node_modules/angular/angular.js',
                                        './node_modules/angular-ui-router/release/angular-ui-router.js',
                                        './node_modules/angular-mocks/angular-mocks.js',
                                        './app/services/users/users.js',
                                        './app/app.js',
                                        './app/services/users/users.spec.js'
                                        ],


                                        // list of files to exclude
                                        exclude: [
                                        ],


                                        // preprocess matching files before serving them to the browser
                                        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
                                        preprocessors: {
                                        },


                                        // test results reporter to use
                                        // possible values: 'dots', 'progress'
                                        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
                                        reporters: ['spec'],


                                        // web server port
                                        port: 9876,


                                        // enable / disable colors in the output (reporters and logs)
                                        colors: true,


                                        // level of logging
                                        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
                                        logLevel: config.LOG_INFO,


                                        // enable / disable watching file and executing tests whenever any file changes
                                        autoWatch: true,


                                        // start these browsers
                                        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
                                        browsers: ['Chrome'],


                                        // Continuous Integration mode
                                        // if true, Karma captures browsers, runs the tests and exits
                                        singleRun: false,

                                        // Concurrency level
                                        // how many browser should be started simultaneous
                                        concurrency: Infinity
                                        })
                                        }





                                        share|improve this answer




























                                          up vote
                                          0
                                          down vote













                                          You will have to specify the directory of karma.config.js when you run start karma.



                                          Try



                                          karma start karma.config.js






                                          share|improve this answer





















                                            Your Answer






                                            StackExchange.ifUsing("editor", function () {
                                            StackExchange.using("externalEditor", function () {
                                            StackExchange.using("snippets", function () {
                                            StackExchange.snippets.init();
                                            });
                                            });
                                            }, "code-snippets");

                                            StackExchange.ready(function() {
                                            var channelOptions = {
                                            tags: "".split(" "),
                                            id: "1"
                                            };
                                            initTagRenderer("".split(" "), "".split(" "), channelOptions);

                                            StackExchange.using("externalEditor", function() {
                                            // Have to fire editor after snippets, if snippets enabled
                                            if (StackExchange.settings.snippets.snippetsEnabled) {
                                            StackExchange.using("snippets", function() {
                                            createEditor();
                                            });
                                            }
                                            else {
                                            createEditor();
                                            }
                                            });

                                            function createEditor() {
                                            StackExchange.prepareEditor({
                                            heartbeatType: 'answer',
                                            convertImagesToLinks: true,
                                            noModals: true,
                                            showLowRepImageUploadWarning: true,
                                            reputationToPostImages: 10,
                                            bindNavPrevention: true,
                                            postfix: "",
                                            imageUploader: {
                                            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                                            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                                            allowUrls: true
                                            },
                                            onDemand: true,
                                            discardSelector: ".discard-answer"
                                            ,immediatelyShowMarkdownHelp:true
                                            });


                                            }
                                            });














                                            draft saved

                                            draft discarded


















                                            StackExchange.ready(
                                            function () {
                                            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f24220888%2ferror-you-need-to-include-some-adapter-that-implements-karma-start-method%23new-answer', 'question_page');
                                            }
                                            );

                                            Post as a guest















                                            Required, but never shown

























                                            23 Answers
                                            23






                                            active

                                            oldest

                                            votes








                                            23 Answers
                                            23






                                            active

                                            oldest

                                            votes









                                            active

                                            oldest

                                            votes






                                            active

                                            oldest

                                            votes








                                            up vote
                                            66
                                            down vote



                                            accepted










                                            It does seem like this is a very general error, however in my case the problem was either that I didn't run karma start from the correct folder, or that I didn't restart it after changing the configuration.



                                            I'll leave this question open and hopefully it can become a resource for others who experience this error message.






                                            share|improve this answer

















                                            • 21




                                              Same for me - running karma start test/karma.conf.js did the trick for me. The right directory may be different for you.
                                              – Jason
                                              Oct 24 '14 at 6:56








                                            • 4




                                              Helped me too; I was in the wrong directory.
                                              – ericso
                                              Dec 1 '14 at 14:44






                                            • 2




                                              I got this error when adding preprocessors: { 'src/**/*.js': ['babel'] }, any ideas?
                                              – SuperUberDuper
                                              Nov 15 '16 at 11:50






                                            • 3




                                              For me changing test/**/*.{js,jsx} to test/**/*.+(js|jsx) fixed this error. How bizarre!
                                              – juniper-
                                              Apr 11 '17 at 20:46






                                            • 1




                                              Also such error can appear if karma config has typo
                                              – sergolius
                                              Apr 7 at 10:27















                                            up vote
                                            66
                                            down vote



                                            accepted










                                            It does seem like this is a very general error, however in my case the problem was either that I didn't run karma start from the correct folder, or that I didn't restart it after changing the configuration.



                                            I'll leave this question open and hopefully it can become a resource for others who experience this error message.






                                            share|improve this answer

















                                            • 21




                                              Same for me - running karma start test/karma.conf.js did the trick for me. The right directory may be different for you.
                                              – Jason
                                              Oct 24 '14 at 6:56








                                            • 4




                                              Helped me too; I was in the wrong directory.
                                              – ericso
                                              Dec 1 '14 at 14:44






                                            • 2




                                              I got this error when adding preprocessors: { 'src/**/*.js': ['babel'] }, any ideas?
                                              – SuperUberDuper
                                              Nov 15 '16 at 11:50






                                            • 3




                                              For me changing test/**/*.{js,jsx} to test/**/*.+(js|jsx) fixed this error. How bizarre!
                                              – juniper-
                                              Apr 11 '17 at 20:46






                                            • 1




                                              Also such error can appear if karma config has typo
                                              – sergolius
                                              Apr 7 at 10:27













                                            up vote
                                            66
                                            down vote



                                            accepted







                                            up vote
                                            66
                                            down vote



                                            accepted






                                            It does seem like this is a very general error, however in my case the problem was either that I didn't run karma start from the correct folder, or that I didn't restart it after changing the configuration.



                                            I'll leave this question open and hopefully it can become a resource for others who experience this error message.






                                            share|improve this answer












                                            It does seem like this is a very general error, however in my case the problem was either that I didn't run karma start from the correct folder, or that I didn't restart it after changing the configuration.



                                            I'll leave this question open and hopefully it can become a resource for others who experience this error message.







                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered Jun 14 '14 at 14:40









                                            Drew Noakes

                                            182k113519602




                                            182k113519602








                                            • 21




                                              Same for me - running karma start test/karma.conf.js did the trick for me. The right directory may be different for you.
                                              – Jason
                                              Oct 24 '14 at 6:56








                                            • 4




                                              Helped me too; I was in the wrong directory.
                                              – ericso
                                              Dec 1 '14 at 14:44






                                            • 2




                                              I got this error when adding preprocessors: { 'src/**/*.js': ['babel'] }, any ideas?
                                              – SuperUberDuper
                                              Nov 15 '16 at 11:50






                                            • 3




                                              For me changing test/**/*.{js,jsx} to test/**/*.+(js|jsx) fixed this error. How bizarre!
                                              – juniper-
                                              Apr 11 '17 at 20:46






                                            • 1




                                              Also such error can appear if karma config has typo
                                              – sergolius
                                              Apr 7 at 10:27














                                            • 21




                                              Same for me - running karma start test/karma.conf.js did the trick for me. The right directory may be different for you.
                                              – Jason
                                              Oct 24 '14 at 6:56








                                            • 4




                                              Helped me too; I was in the wrong directory.
                                              – ericso
                                              Dec 1 '14 at 14:44






                                            • 2




                                              I got this error when adding preprocessors: { 'src/**/*.js': ['babel'] }, any ideas?
                                              – SuperUberDuper
                                              Nov 15 '16 at 11:50






                                            • 3




                                              For me changing test/**/*.{js,jsx} to test/**/*.+(js|jsx) fixed this error. How bizarre!
                                              – juniper-
                                              Apr 11 '17 at 20:46






                                            • 1




                                              Also such error can appear if karma config has typo
                                              – sergolius
                                              Apr 7 at 10:27








                                            21




                                            21




                                            Same for me - running karma start test/karma.conf.js did the trick for me. The right directory may be different for you.
                                            – Jason
                                            Oct 24 '14 at 6:56






                                            Same for me - running karma start test/karma.conf.js did the trick for me. The right directory may be different for you.
                                            – Jason
                                            Oct 24 '14 at 6:56






                                            4




                                            4




                                            Helped me too; I was in the wrong directory.
                                            – ericso
                                            Dec 1 '14 at 14:44




                                            Helped me too; I was in the wrong directory.
                                            – ericso
                                            Dec 1 '14 at 14:44




                                            2




                                            2




                                            I got this error when adding preprocessors: { 'src/**/*.js': ['babel'] }, any ideas?
                                            – SuperUberDuper
                                            Nov 15 '16 at 11:50




                                            I got this error when adding preprocessors: { 'src/**/*.js': ['babel'] }, any ideas?
                                            – SuperUberDuper
                                            Nov 15 '16 at 11:50




                                            3




                                            3




                                            For me changing test/**/*.{js,jsx} to test/**/*.+(js|jsx) fixed this error. How bizarre!
                                            – juniper-
                                            Apr 11 '17 at 20:46




                                            For me changing test/**/*.{js,jsx} to test/**/*.+(js|jsx) fixed this error. How bizarre!
                                            – juniper-
                                            Apr 11 '17 at 20:46




                                            1




                                            1




                                            Also such error can appear if karma config has typo
                                            – sergolius
                                            Apr 7 at 10:27




                                            Also such error can appear if karma config has typo
                                            – sergolius
                                            Apr 7 at 10:27












                                            up vote
                                            24
                                            down vote













                                            If you name your karma config file karma.conf.js, you can simply type karma start.



                                            Otherwise specify the filename karma start karmafile.js



                                            (I was in the right directory, but was not specifying a file name.)






                                            share|improve this answer

























                                              up vote
                                              24
                                              down vote













                                              If you name your karma config file karma.conf.js, you can simply type karma start.



                                              Otherwise specify the filename karma start karmafile.js



                                              (I was in the right directory, but was not specifying a file name.)






                                              share|improve this answer























                                                up vote
                                                24
                                                down vote










                                                up vote
                                                24
                                                down vote









                                                If you name your karma config file karma.conf.js, you can simply type karma start.



                                                Otherwise specify the filename karma start karmafile.js



                                                (I was in the right directory, but was not specifying a file name.)






                                                share|improve this answer












                                                If you name your karma config file karma.conf.js, you can simply type karma start.



                                                Otherwise specify the filename karma start karmafile.js



                                                (I was in the right directory, but was not specifying a file name.)







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Jan 30 '15 at 20:53









                                                James Lawruk

                                                20.7k14105120




                                                20.7k14105120






















                                                    up vote
                                                    12
                                                    down vote













                                                    You need to run your karma run or whatever function in the folder where karma-conf.js is in.






                                                    share|improve this answer

























                                                      up vote
                                                      12
                                                      down vote













                                                      You need to run your karma run or whatever function in the folder where karma-conf.js is in.






                                                      share|improve this answer























                                                        up vote
                                                        12
                                                        down vote










                                                        up vote
                                                        12
                                                        down vote









                                                        You need to run your karma run or whatever function in the folder where karma-conf.js is in.






                                                        share|improve this answer












                                                        You need to run your karma run or whatever function in the folder where karma-conf.js is in.







                                                        share|improve this answer












                                                        share|improve this answer



                                                        share|improve this answer










                                                        answered Sep 22 '14 at 2:41









                                                        AndyX

                                                        15317




                                                        15317






















                                                            up vote
                                                            7
                                                            down vote













                                                            In my case I had to rename the file to karma.conf.js then do karma start






                                                            share|improve this answer

























                                                              up vote
                                                              7
                                                              down vote













                                                              In my case I had to rename the file to karma.conf.js then do karma start






                                                              share|improve this answer























                                                                up vote
                                                                7
                                                                down vote










                                                                up vote
                                                                7
                                                                down vote









                                                                In my case I had to rename the file to karma.conf.js then do karma start






                                                                share|improve this answer












                                                                In my case I had to rename the file to karma.conf.js then do karma start







                                                                share|improve this answer












                                                                share|improve this answer



                                                                share|improve this answer










                                                                answered Jul 7 '15 at 19:35









                                                                Rafael Fernandes

                                                                455610




                                                                455610






















                                                                    up vote
                                                                    6
                                                                    down vote













                                                                    I was not running karma start command from the path where my karma.conf.js was. I switched to that folder and ran the same command. Thats all






                                                                    share|improve this answer

























                                                                      up vote
                                                                      6
                                                                      down vote













                                                                      I was not running karma start command from the path where my karma.conf.js was. I switched to that folder and ran the same command. Thats all






                                                                      share|improve this answer























                                                                        up vote
                                                                        6
                                                                        down vote










                                                                        up vote
                                                                        6
                                                                        down vote









                                                                        I was not running karma start command from the path where my karma.conf.js was. I switched to that folder and ran the same command. Thats all






                                                                        share|improve this answer












                                                                        I was not running karma start command from the path where my karma.conf.js was. I switched to that folder and ran the same command. Thats all







                                                                        share|improve this answer












                                                                        share|improve this answer



                                                                        share|improve this answer










                                                                        answered Dec 15 '16 at 6:35









                                                                        Sunil Garg

                                                                        3,99464168




                                                                        3,99464168






















                                                                            up vote
                                                                            5
                                                                            down vote













                                                                            I had a problem with karma.conf.js file code format:



                                                                            files: [
                                                                            // Modules
                                                                            ,"client/bower_components/angular/angular.min.js"
                                                                            ,"client/bower_components/angular-mocks/angular-mocks.js"
                                                                            // App
                                                                            ,"client/app/app.module.js"
                                                                            // Test
                                                                            // ,"test/**/*.spec.js"
                                                                            ],


                                                                            The extra comma in files array have cause this error:



                                                                            You need to include some adapter that implements __karma__.start method!





                                                                            share|improve this answer

























                                                                              up vote
                                                                              5
                                                                              down vote













                                                                              I had a problem with karma.conf.js file code format:



                                                                              files: [
                                                                              // Modules
                                                                              ,"client/bower_components/angular/angular.min.js"
                                                                              ,"client/bower_components/angular-mocks/angular-mocks.js"
                                                                              // App
                                                                              ,"client/app/app.module.js"
                                                                              // Test
                                                                              // ,"test/**/*.spec.js"
                                                                              ],


                                                                              The extra comma in files array have cause this error:



                                                                              You need to include some adapter that implements __karma__.start method!





                                                                              share|improve this answer























                                                                                up vote
                                                                                5
                                                                                down vote










                                                                                up vote
                                                                                5
                                                                                down vote









                                                                                I had a problem with karma.conf.js file code format:



                                                                                files: [
                                                                                // Modules
                                                                                ,"client/bower_components/angular/angular.min.js"
                                                                                ,"client/bower_components/angular-mocks/angular-mocks.js"
                                                                                // App
                                                                                ,"client/app/app.module.js"
                                                                                // Test
                                                                                // ,"test/**/*.spec.js"
                                                                                ],


                                                                                The extra comma in files array have cause this error:



                                                                                You need to include some adapter that implements __karma__.start method!





                                                                                share|improve this answer












                                                                                I had a problem with karma.conf.js file code format:



                                                                                files: [
                                                                                // Modules
                                                                                ,"client/bower_components/angular/angular.min.js"
                                                                                ,"client/bower_components/angular-mocks/angular-mocks.js"
                                                                                // App
                                                                                ,"client/app/app.module.js"
                                                                                // Test
                                                                                // ,"test/**/*.spec.js"
                                                                                ],


                                                                                The extra comma in files array have cause this error:



                                                                                You need to include some adapter that implements __karma__.start method!






                                                                                share|improve this answer












                                                                                share|improve this answer



                                                                                share|improve this answer










                                                                                answered Jun 30 '16 at 9:43









                                                                                Jaroslav

                                                                                34928




                                                                                34928






















                                                                                    up vote
                                                                                    4
                                                                                    down vote













                                                                                    I was facing this issue while running specs on the Angular.js codebase. I had to run npm install karma-jasmine -g to get this working.






                                                                                    share|improve this answer

























                                                                                      up vote
                                                                                      4
                                                                                      down vote













                                                                                      I was facing this issue while running specs on the Angular.js codebase. I had to run npm install karma-jasmine -g to get this working.






                                                                                      share|improve this answer























                                                                                        up vote
                                                                                        4
                                                                                        down vote










                                                                                        up vote
                                                                                        4
                                                                                        down vote









                                                                                        I was facing this issue while running specs on the Angular.js codebase. I had to run npm install karma-jasmine -g to get this working.






                                                                                        share|improve this answer












                                                                                        I was facing this issue while running specs on the Angular.js codebase. I had to run npm install karma-jasmine -g to get this working.







                                                                                        share|improve this answer












                                                                                        share|improve this answer



                                                                                        share|improve this answer










                                                                                        answered Aug 29 '14 at 10:40









                                                                                        HariKrishnan

                                                                                        326211




                                                                                        326211






















                                                                                            up vote
                                                                                            3
                                                                                            down vote













                                                                                            If you typing "karma start", you must have a karma.conf.js file in the current folder. or just "karma start /path/karma.conf.js"



                                                                                            Try to create a new karmar.conf.js by "karma init /path/karma.conf.js"






                                                                                            share|improve this answer

























                                                                                              up vote
                                                                                              3
                                                                                              down vote













                                                                                              If you typing "karma start", you must have a karma.conf.js file in the current folder. or just "karma start /path/karma.conf.js"



                                                                                              Try to create a new karmar.conf.js by "karma init /path/karma.conf.js"






                                                                                              share|improve this answer























                                                                                                up vote
                                                                                                3
                                                                                                down vote










                                                                                                up vote
                                                                                                3
                                                                                                down vote









                                                                                                If you typing "karma start", you must have a karma.conf.js file in the current folder. or just "karma start /path/karma.conf.js"



                                                                                                Try to create a new karmar.conf.js by "karma init /path/karma.conf.js"






                                                                                                share|improve this answer












                                                                                                If you typing "karma start", you must have a karma.conf.js file in the current folder. or just "karma start /path/karma.conf.js"



                                                                                                Try to create a new karmar.conf.js by "karma init /path/karma.conf.js"







                                                                                                share|improve this answer












                                                                                                share|improve this answer



                                                                                                share|improve this answer










                                                                                                answered Jun 9 '15 at 14:49









                                                                                                Mike Zhang

                                                                                                8819




                                                                                                8819






















                                                                                                    up vote
                                                                                                    2
                                                                                                    down vote













                                                                                                    I was getting the same error because the project was using Babel 6 and I had forgotten to add the babelrc file. Just sharing in case this could help.






                                                                                                    share|improve this answer

























                                                                                                      up vote
                                                                                                      2
                                                                                                      down vote













                                                                                                      I was getting the same error because the project was using Babel 6 and I had forgotten to add the babelrc file. Just sharing in case this could help.






                                                                                                      share|improve this answer























                                                                                                        up vote
                                                                                                        2
                                                                                                        down vote










                                                                                                        up vote
                                                                                                        2
                                                                                                        down vote









                                                                                                        I was getting the same error because the project was using Babel 6 and I had forgotten to add the babelrc file. Just sharing in case this could help.






                                                                                                        share|improve this answer












                                                                                                        I was getting the same error because the project was using Babel 6 and I had forgotten to add the babelrc file. Just sharing in case this could help.







                                                                                                        share|improve this answer












                                                                                                        share|improve this answer



                                                                                                        share|improve this answer










                                                                                                        answered May 17 '16 at 20:41









                                                                                                        Brett

                                                                                                        96011532




                                                                                                        96011532






















                                                                                                            up vote
                                                                                                            2
                                                                                                            down vote













                                                                                                            In my case, the message was in fact very descriptive: I forgot to add an adapter, in my case Jasmine, into the config file. Thus:



                                                                                                            module.exports = function(config) {
                                                                                                            config.set({
                                                                                                            browsers: ['Chrome'],
                                                                                                            singleRun: true,
                                                                                                            frameworks: ['jasmine'],
                                                                                                            files: [
                                                                                                            // ... files ...
                                                                                                            ],
                                                                                                            // other configs
                                                                                                            });
                                                                                                            };





                                                                                                            share|improve this answer

























                                                                                                              up vote
                                                                                                              2
                                                                                                              down vote













                                                                                                              In my case, the message was in fact very descriptive: I forgot to add an adapter, in my case Jasmine, into the config file. Thus:



                                                                                                              module.exports = function(config) {
                                                                                                              config.set({
                                                                                                              browsers: ['Chrome'],
                                                                                                              singleRun: true,
                                                                                                              frameworks: ['jasmine'],
                                                                                                              files: [
                                                                                                              // ... files ...
                                                                                                              ],
                                                                                                              // other configs
                                                                                                              });
                                                                                                              };





                                                                                                              share|improve this answer























                                                                                                                up vote
                                                                                                                2
                                                                                                                down vote










                                                                                                                up vote
                                                                                                                2
                                                                                                                down vote









                                                                                                                In my case, the message was in fact very descriptive: I forgot to add an adapter, in my case Jasmine, into the config file. Thus:



                                                                                                                module.exports = function(config) {
                                                                                                                config.set({
                                                                                                                browsers: ['Chrome'],
                                                                                                                singleRun: true,
                                                                                                                frameworks: ['jasmine'],
                                                                                                                files: [
                                                                                                                // ... files ...
                                                                                                                ],
                                                                                                                // other configs
                                                                                                                });
                                                                                                                };





                                                                                                                share|improve this answer












                                                                                                                In my case, the message was in fact very descriptive: I forgot to add an adapter, in my case Jasmine, into the config file. Thus:



                                                                                                                module.exports = function(config) {
                                                                                                                config.set({
                                                                                                                browsers: ['Chrome'],
                                                                                                                singleRun: true,
                                                                                                                frameworks: ['jasmine'],
                                                                                                                files: [
                                                                                                                // ... files ...
                                                                                                                ],
                                                                                                                // other configs
                                                                                                                });
                                                                                                                };






                                                                                                                share|improve this answer












                                                                                                                share|improve this answer



                                                                                                                share|improve this answer










                                                                                                                answered Sep 30 '16 at 13:32









                                                                                                                Jan Prichystal

                                                                                                                1165




                                                                                                                1165






















                                                                                                                    up vote
                                                                                                                    2
                                                                                                                    down vote













                                                                                                                    You need to configure your "my.conf.js" file, because it contains all the info to use to test your code.



                                                                                                                    All what you need to write is this:



                                                                                                                    The configuration file can be generated using karma init:



                                                                                                                    $ karma init my.conf.js


                                                                                                                    Which testing framework do you want to use?
                                                                                                                    Press tab to list possible options. Enter to move to the next question.




                                                                                                                    jasmine




                                                                                                                    Do you want to use Require.js?
                                                                                                                    This will add Require.js plugin.
                                                                                                                    Press tab to list possible options. Enter to move to the next question.




                                                                                                                    no




                                                                                                                    Do you want to capture a browser automatically?
                                                                                                                    Press tab to list possible options. Enter empty string to move to the next question.




                                                                                                                    Chrome




                                                                                                                    What is the location of your source and test files?
                                                                                                                    You can use glob patterns, eg. "js/*.js" or "test/**/*Spec.js".
                                                                                                                    Press Enter to move to the next question.




                                                                                                                    *.js
                                                                                                                    test/**/*.js




                                                                                                                    Should any of the files included by the previous patterns be excluded?
                                                                                                                    You can use glob patterns, eg. "**/*.swp".




                                                                                                                    Press Enter to move to the next question.




                                                                                                                    Do you want Karma to watch all the files and run the tests on change?
                                                                                                                    Press tab to list possible options.




                                                                                                                    yes




                                                                                                                    Config file generated at "/Users/vojta/Code/karma/my.conf.js".






                                                                                                                    share|improve this answer

























                                                                                                                      up vote
                                                                                                                      2
                                                                                                                      down vote













                                                                                                                      You need to configure your "my.conf.js" file, because it contains all the info to use to test your code.



                                                                                                                      All what you need to write is this:



                                                                                                                      The configuration file can be generated using karma init:



                                                                                                                      $ karma init my.conf.js


                                                                                                                      Which testing framework do you want to use?
                                                                                                                      Press tab to list possible options. Enter to move to the next question.




                                                                                                                      jasmine




                                                                                                                      Do you want to use Require.js?
                                                                                                                      This will add Require.js plugin.
                                                                                                                      Press tab to list possible options. Enter to move to the next question.




                                                                                                                      no




                                                                                                                      Do you want to capture a browser automatically?
                                                                                                                      Press tab to list possible options. Enter empty string to move to the next question.




                                                                                                                      Chrome




                                                                                                                      What is the location of your source and test files?
                                                                                                                      You can use glob patterns, eg. "js/*.js" or "test/**/*Spec.js".
                                                                                                                      Press Enter to move to the next question.




                                                                                                                      *.js
                                                                                                                      test/**/*.js




                                                                                                                      Should any of the files included by the previous patterns be excluded?
                                                                                                                      You can use glob patterns, eg. "**/*.swp".




                                                                                                                      Press Enter to move to the next question.




                                                                                                                      Do you want Karma to watch all the files and run the tests on change?
                                                                                                                      Press tab to list possible options.




                                                                                                                      yes




                                                                                                                      Config file generated at "/Users/vojta/Code/karma/my.conf.js".






                                                                                                                      share|improve this answer























                                                                                                                        up vote
                                                                                                                        2
                                                                                                                        down vote










                                                                                                                        up vote
                                                                                                                        2
                                                                                                                        down vote









                                                                                                                        You need to configure your "my.conf.js" file, because it contains all the info to use to test your code.



                                                                                                                        All what you need to write is this:



                                                                                                                        The configuration file can be generated using karma init:



                                                                                                                        $ karma init my.conf.js


                                                                                                                        Which testing framework do you want to use?
                                                                                                                        Press tab to list possible options. Enter to move to the next question.




                                                                                                                        jasmine




                                                                                                                        Do you want to use Require.js?
                                                                                                                        This will add Require.js plugin.
                                                                                                                        Press tab to list possible options. Enter to move to the next question.




                                                                                                                        no




                                                                                                                        Do you want to capture a browser automatically?
                                                                                                                        Press tab to list possible options. Enter empty string to move to the next question.




                                                                                                                        Chrome




                                                                                                                        What is the location of your source and test files?
                                                                                                                        You can use glob patterns, eg. "js/*.js" or "test/**/*Spec.js".
                                                                                                                        Press Enter to move to the next question.




                                                                                                                        *.js
                                                                                                                        test/**/*.js




                                                                                                                        Should any of the files included by the previous patterns be excluded?
                                                                                                                        You can use glob patterns, eg. "**/*.swp".




                                                                                                                        Press Enter to move to the next question.




                                                                                                                        Do you want Karma to watch all the files and run the tests on change?
                                                                                                                        Press tab to list possible options.




                                                                                                                        yes




                                                                                                                        Config file generated at "/Users/vojta/Code/karma/my.conf.js".






                                                                                                                        share|improve this answer












                                                                                                                        You need to configure your "my.conf.js" file, because it contains all the info to use to test your code.



                                                                                                                        All what you need to write is this:



                                                                                                                        The configuration file can be generated using karma init:



                                                                                                                        $ karma init my.conf.js


                                                                                                                        Which testing framework do you want to use?
                                                                                                                        Press tab to list possible options. Enter to move to the next question.




                                                                                                                        jasmine




                                                                                                                        Do you want to use Require.js?
                                                                                                                        This will add Require.js plugin.
                                                                                                                        Press tab to list possible options. Enter to move to the next question.




                                                                                                                        no




                                                                                                                        Do you want to capture a browser automatically?
                                                                                                                        Press tab to list possible options. Enter empty string to move to the next question.




                                                                                                                        Chrome




                                                                                                                        What is the location of your source and test files?
                                                                                                                        You can use glob patterns, eg. "js/*.js" or "test/**/*Spec.js".
                                                                                                                        Press Enter to move to the next question.




                                                                                                                        *.js
                                                                                                                        test/**/*.js




                                                                                                                        Should any of the files included by the previous patterns be excluded?
                                                                                                                        You can use glob patterns, eg. "**/*.swp".




                                                                                                                        Press Enter to move to the next question.




                                                                                                                        Do you want Karma to watch all the files and run the tests on change?
                                                                                                                        Press tab to list possible options.




                                                                                                                        yes




                                                                                                                        Config file generated at "/Users/vojta/Code/karma/my.conf.js".







                                                                                                                        share|improve this answer












                                                                                                                        share|improve this answer



                                                                                                                        share|improve this answer










                                                                                                                        answered Nov 9 '16 at 22:53









                                                                                                                        Juan Hernández

                                                                                                                        1318




                                                                                                                        1318






















                                                                                                                            up vote
                                                                                                                            1
                                                                                                                            down vote













                                                                                                                            In my case, I was applying by mistake the commonjs preprocessor to the karma-* modules and the adapter.js from karma-chrome and karma-firefox was broken this way.



                                                                                                                            Unfortunately, this is a very generic error.






                                                                                                                            share|improve this answer





















                                                                                                                            • Could you provide more background into the fix you did? This might be getting me right now as I know I am using karma-chrome. Thanks!
                                                                                                                              – daniel.caspers
                                                                                                                              Apr 11 '16 at 15:42










                                                                                                                            • Do you apply the commonjs preprocessor (is it configured in karma runner)? If yes, make sure that it's not applied to the files in the karma-* modules.
                                                                                                                              – Adrian Ber
                                                                                                                              Apr 11 '16 at 18:39















                                                                                                                            up vote
                                                                                                                            1
                                                                                                                            down vote













                                                                                                                            In my case, I was applying by mistake the commonjs preprocessor to the karma-* modules and the adapter.js from karma-chrome and karma-firefox was broken this way.



                                                                                                                            Unfortunately, this is a very generic error.






                                                                                                                            share|improve this answer





















                                                                                                                            • Could you provide more background into the fix you did? This might be getting me right now as I know I am using karma-chrome. Thanks!
                                                                                                                              – daniel.caspers
                                                                                                                              Apr 11 '16 at 15:42










                                                                                                                            • Do you apply the commonjs preprocessor (is it configured in karma runner)? If yes, make sure that it's not applied to the files in the karma-* modules.
                                                                                                                              – Adrian Ber
                                                                                                                              Apr 11 '16 at 18:39













                                                                                                                            up vote
                                                                                                                            1
                                                                                                                            down vote










                                                                                                                            up vote
                                                                                                                            1
                                                                                                                            down vote









                                                                                                                            In my case, I was applying by mistake the commonjs preprocessor to the karma-* modules and the adapter.js from karma-chrome and karma-firefox was broken this way.



                                                                                                                            Unfortunately, this is a very generic error.






                                                                                                                            share|improve this answer












                                                                                                                            In my case, I was applying by mistake the commonjs preprocessor to the karma-* modules and the adapter.js from karma-chrome and karma-firefox was broken this way.



                                                                                                                            Unfortunately, this is a very generic error.







                                                                                                                            share|improve this answer












                                                                                                                            share|improve this answer



                                                                                                                            share|improve this answer










                                                                                                                            answered Mar 28 '16 at 9:30









                                                                                                                            Adrian Ber

                                                                                                                            9,97283974




                                                                                                                            9,97283974












                                                                                                                            • Could you provide more background into the fix you did? This might be getting me right now as I know I am using karma-chrome. Thanks!
                                                                                                                              – daniel.caspers
                                                                                                                              Apr 11 '16 at 15:42










                                                                                                                            • Do you apply the commonjs preprocessor (is it configured in karma runner)? If yes, make sure that it's not applied to the files in the karma-* modules.
                                                                                                                              – Adrian Ber
                                                                                                                              Apr 11 '16 at 18:39


















                                                                                                                            • Could you provide more background into the fix you did? This might be getting me right now as I know I am using karma-chrome. Thanks!
                                                                                                                              – daniel.caspers
                                                                                                                              Apr 11 '16 at 15:42










                                                                                                                            • Do you apply the commonjs preprocessor (is it configured in karma runner)? If yes, make sure that it's not applied to the files in the karma-* modules.
                                                                                                                              – Adrian Ber
                                                                                                                              Apr 11 '16 at 18:39
















                                                                                                                            Could you provide more background into the fix you did? This might be getting me right now as I know I am using karma-chrome. Thanks!
                                                                                                                            – daniel.caspers
                                                                                                                            Apr 11 '16 at 15:42




                                                                                                                            Could you provide more background into the fix you did? This might be getting me right now as I know I am using karma-chrome. Thanks!
                                                                                                                            – daniel.caspers
                                                                                                                            Apr 11 '16 at 15:42












                                                                                                                            Do you apply the commonjs preprocessor (is it configured in karma runner)? If yes, make sure that it's not applied to the files in the karma-* modules.
                                                                                                                            – Adrian Ber
                                                                                                                            Apr 11 '16 at 18:39




                                                                                                                            Do you apply the commonjs preprocessor (is it configured in karma runner)? If yes, make sure that it's not applied to the files in the karma-* modules.
                                                                                                                            – Adrian Ber
                                                                                                                            Apr 11 '16 at 18:39










                                                                                                                            up vote
                                                                                                                            1
                                                                                                                            down vote













                                                                                                                            I must add that in my case karma was giving me the error because I had [square] brackets in the name of one of the parent folders.






                                                                                                                            share|improve this answer

























                                                                                                                              up vote
                                                                                                                              1
                                                                                                                              down vote













                                                                                                                              I must add that in my case karma was giving me the error because I had [square] brackets in the name of one of the parent folders.






                                                                                                                              share|improve this answer























                                                                                                                                up vote
                                                                                                                                1
                                                                                                                                down vote










                                                                                                                                up vote
                                                                                                                                1
                                                                                                                                down vote









                                                                                                                                I must add that in my case karma was giving me the error because I had [square] brackets in the name of one of the parent folders.






                                                                                                                                share|improve this answer












                                                                                                                                I must add that in my case karma was giving me the error because I had [square] brackets in the name of one of the parent folders.







                                                                                                                                share|improve this answer












                                                                                                                                share|improve this answer



                                                                                                                                share|improve this answer










                                                                                                                                answered May 5 '16 at 21:41









                                                                                                                                Yura

                                                                                                                                2,1631929




                                                                                                                                2,1631929






















                                                                                                                                    up vote
                                                                                                                                    1
                                                                                                                                    down vote













                                                                                                                                    Tt's complaining about the adapter which is probably jasmine or mocha.
                                                                                                                                    Either the adapter is missing, either is not setup correctly, either it's an outdated or buggy version of the adapter.



                                                                                                                                    In my case I had an old version of mocha 2.5.3 which was not compatible with karma 1+.
                                                                                                                                    I updated the mocha dependency to the latest version available 3.2.0 and the problem solved.






                                                                                                                                    share|improve this answer

























                                                                                                                                      up vote
                                                                                                                                      1
                                                                                                                                      down vote













                                                                                                                                      Tt's complaining about the adapter which is probably jasmine or mocha.
                                                                                                                                      Either the adapter is missing, either is not setup correctly, either it's an outdated or buggy version of the adapter.



                                                                                                                                      In my case I had an old version of mocha 2.5.3 which was not compatible with karma 1+.
                                                                                                                                      I updated the mocha dependency to the latest version available 3.2.0 and the problem solved.






                                                                                                                                      share|improve this answer























                                                                                                                                        up vote
                                                                                                                                        1
                                                                                                                                        down vote










                                                                                                                                        up vote
                                                                                                                                        1
                                                                                                                                        down vote









                                                                                                                                        Tt's complaining about the adapter which is probably jasmine or mocha.
                                                                                                                                        Either the adapter is missing, either is not setup correctly, either it's an outdated or buggy version of the adapter.



                                                                                                                                        In my case I had an old version of mocha 2.5.3 which was not compatible with karma 1+.
                                                                                                                                        I updated the mocha dependency to the latest version available 3.2.0 and the problem solved.






                                                                                                                                        share|improve this answer












                                                                                                                                        Tt's complaining about the adapter which is probably jasmine or mocha.
                                                                                                                                        Either the adapter is missing, either is not setup correctly, either it's an outdated or buggy version of the adapter.



                                                                                                                                        In my case I had an old version of mocha 2.5.3 which was not compatible with karma 1+.
                                                                                                                                        I updated the mocha dependency to the latest version available 3.2.0 and the problem solved.







                                                                                                                                        share|improve this answer












                                                                                                                                        share|improve this answer



                                                                                                                                        share|improve this answer










                                                                                                                                        answered Dec 2 '16 at 18:14









                                                                                                                                        Giorgio

                                                                                                                                        7,06093458




                                                                                                                                        7,06093458






















                                                                                                                                            up vote
                                                                                                                                            1
                                                                                                                                            down vote













                                                                                                                                            While working on numerous vaguely described errors, I tried setting basePath: '../', After correcting other errors (like missing commas that were described as object content errors) the last change back to basePath: '', got karma to work. karma's error statements need a lot of work. It is not simple to get it going.






                                                                                                                                            share|improve this answer

























                                                                                                                                              up vote
                                                                                                                                              1
                                                                                                                                              down vote













                                                                                                                                              While working on numerous vaguely described errors, I tried setting basePath: '../', After correcting other errors (like missing commas that were described as object content errors) the last change back to basePath: '', got karma to work. karma's error statements need a lot of work. It is not simple to get it going.






                                                                                                                                              share|improve this answer























                                                                                                                                                up vote
                                                                                                                                                1
                                                                                                                                                down vote










                                                                                                                                                up vote
                                                                                                                                                1
                                                                                                                                                down vote









                                                                                                                                                While working on numerous vaguely described errors, I tried setting basePath: '../', After correcting other errors (like missing commas that were described as object content errors) the last change back to basePath: '', got karma to work. karma's error statements need a lot of work. It is not simple to get it going.






                                                                                                                                                share|improve this answer












                                                                                                                                                While working on numerous vaguely described errors, I tried setting basePath: '../', After correcting other errors (like missing commas that were described as object content errors) the last change back to basePath: '', got karma to work. karma's error statements need a lot of work. It is not simple to get it going.







                                                                                                                                                share|improve this answer












                                                                                                                                                share|improve this answer



                                                                                                                                                share|improve this answer










                                                                                                                                                answered Jan 12 '17 at 20:45









                                                                                                                                                Mike_Laird

                                                                                                                                                66621234




                                                                                                                                                66621234






















                                                                                                                                                    up vote
                                                                                                                                                    0
                                                                                                                                                    down vote













                                                                                                                                                    FWIW - sourcing the file path of karma.conf.js worked for me locally, but not on my jenkins builder. I have zero clue why this is the case, but on jenkins it was throwing this error unless the karma.conf.js file was in the root directory where the karma command was given. I'm using rails and running the js specs through a rake task. Code is below which might be helpful for some.



                                                                                                                                                    https://gist.github.com/daino3/a39486ff8bfc1668e923






                                                                                                                                                    share|improve this answer

























                                                                                                                                                      up vote
                                                                                                                                                      0
                                                                                                                                                      down vote













                                                                                                                                                      FWIW - sourcing the file path of karma.conf.js worked for me locally, but not on my jenkins builder. I have zero clue why this is the case, but on jenkins it was throwing this error unless the karma.conf.js file was in the root directory where the karma command was given. I'm using rails and running the js specs through a rake task. Code is below which might be helpful for some.



                                                                                                                                                      https://gist.github.com/daino3/a39486ff8bfc1668e923






                                                                                                                                                      share|improve this answer























                                                                                                                                                        up vote
                                                                                                                                                        0
                                                                                                                                                        down vote










                                                                                                                                                        up vote
                                                                                                                                                        0
                                                                                                                                                        down vote









                                                                                                                                                        FWIW - sourcing the file path of karma.conf.js worked for me locally, but not on my jenkins builder. I have zero clue why this is the case, but on jenkins it was throwing this error unless the karma.conf.js file was in the root directory where the karma command was given. I'm using rails and running the js specs through a rake task. Code is below which might be helpful for some.



                                                                                                                                                        https://gist.github.com/daino3/a39486ff8bfc1668e923






                                                                                                                                                        share|improve this answer












                                                                                                                                                        FWIW - sourcing the file path of karma.conf.js worked for me locally, but not on my jenkins builder. I have zero clue why this is the case, but on jenkins it was throwing this error unless the karma.conf.js file was in the root directory where the karma command was given. I'm using rails and running the js specs through a rake task. Code is below which might be helpful for some.



                                                                                                                                                        https://gist.github.com/daino3/a39486ff8bfc1668e923







                                                                                                                                                        share|improve this answer












                                                                                                                                                        share|improve this answer



                                                                                                                                                        share|improve this answer










                                                                                                                                                        answered Nov 3 '15 at 16:01









                                                                                                                                                        daino3

                                                                                                                                                        1,8021423




                                                                                                                                                        1,8021423






















                                                                                                                                                            up vote
                                                                                                                                                            0
                                                                                                                                                            down vote













                                                                                                                                                            The issue in my case was that karma didn't pick up any files. Fixing it in karma.conf.js solved the issue.






                                                                                                                                                            share|improve this answer

























                                                                                                                                                              up vote
                                                                                                                                                              0
                                                                                                                                                              down vote













                                                                                                                                                              The issue in my case was that karma didn't pick up any files. Fixing it in karma.conf.js solved the issue.






                                                                                                                                                              share|improve this answer























                                                                                                                                                                up vote
                                                                                                                                                                0
                                                                                                                                                                down vote










                                                                                                                                                                up vote
                                                                                                                                                                0
                                                                                                                                                                down vote









                                                                                                                                                                The issue in my case was that karma didn't pick up any files. Fixing it in karma.conf.js solved the issue.






                                                                                                                                                                share|improve this answer












                                                                                                                                                                The issue in my case was that karma didn't pick up any files. Fixing it in karma.conf.js solved the issue.







                                                                                                                                                                share|improve this answer












                                                                                                                                                                share|improve this answer



                                                                                                                                                                share|improve this answer










                                                                                                                                                                answered Jan 15 '16 at 9:22









                                                                                                                                                                Andras Hatvani

                                                                                                                                                                2,62921424




                                                                                                                                                                2,62921424






















                                                                                                                                                                    up vote
                                                                                                                                                                    0
                                                                                                                                                                    down vote













                                                                                                                                                                    Same issue happened to me, and it was due to an outdated module.



                                                                                                                                                                    Running npm update solved it.






                                                                                                                                                                    share|improve this answer

























                                                                                                                                                                      up vote
                                                                                                                                                                      0
                                                                                                                                                                      down vote













                                                                                                                                                                      Same issue happened to me, and it was due to an outdated module.



                                                                                                                                                                      Running npm update solved it.






                                                                                                                                                                      share|improve this answer























                                                                                                                                                                        up vote
                                                                                                                                                                        0
                                                                                                                                                                        down vote










                                                                                                                                                                        up vote
                                                                                                                                                                        0
                                                                                                                                                                        down vote









                                                                                                                                                                        Same issue happened to me, and it was due to an outdated module.



                                                                                                                                                                        Running npm update solved it.






                                                                                                                                                                        share|improve this answer












                                                                                                                                                                        Same issue happened to me, and it was due to an outdated module.



                                                                                                                                                                        Running npm update solved it.







                                                                                                                                                                        share|improve this answer












                                                                                                                                                                        share|improve this answer



                                                                                                                                                                        share|improve this answer










                                                                                                                                                                        answered May 31 '16 at 13:28









                                                                                                                                                                        Magicprog.fr

                                                                                                                                                                        3,58742331




                                                                                                                                                                        3,58742331






















                                                                                                                                                                            up vote
                                                                                                                                                                            0
                                                                                                                                                                            down vote













                                                                                                                                                                            In my case, it was not karma-related at all! I run karma from gulp, with ES6/babel, and there was actually a code syntax error, flagged by a babel error above my karma:




                                                                                                                                                                            ERROR [preprocessor.babel]: xxx.js: Unexpected token (19:83)




                                                                                                                                                                            I fixed that in my src and karma was happy again.






                                                                                                                                                                            share|improve this answer

























                                                                                                                                                                              up vote
                                                                                                                                                                              0
                                                                                                                                                                              down vote













                                                                                                                                                                              In my case, it was not karma-related at all! I run karma from gulp, with ES6/babel, and there was actually a code syntax error, flagged by a babel error above my karma:




                                                                                                                                                                              ERROR [preprocessor.babel]: xxx.js: Unexpected token (19:83)




                                                                                                                                                                              I fixed that in my src and karma was happy again.






                                                                                                                                                                              share|improve this answer























                                                                                                                                                                                up vote
                                                                                                                                                                                0
                                                                                                                                                                                down vote










                                                                                                                                                                                up vote
                                                                                                                                                                                0
                                                                                                                                                                                down vote









                                                                                                                                                                                In my case, it was not karma-related at all! I run karma from gulp, with ES6/babel, and there was actually a code syntax error, flagged by a babel error above my karma:




                                                                                                                                                                                ERROR [preprocessor.babel]: xxx.js: Unexpected token (19:83)




                                                                                                                                                                                I fixed that in my src and karma was happy again.






                                                                                                                                                                                share|improve this answer












                                                                                                                                                                                In my case, it was not karma-related at all! I run karma from gulp, with ES6/babel, and there was actually a code syntax error, flagged by a babel error above my karma:




                                                                                                                                                                                ERROR [preprocessor.babel]: xxx.js: Unexpected token (19:83)




                                                                                                                                                                                I fixed that in my src and karma was happy again.







                                                                                                                                                                                share|improve this answer












                                                                                                                                                                                share|improve this answer



                                                                                                                                                                                share|improve this answer










                                                                                                                                                                                answered Oct 14 '16 at 17:22









                                                                                                                                                                                Merl

                                                                                                                                                                                140129




                                                                                                                                                                                140129






















                                                                                                                                                                                    up vote
                                                                                                                                                                                    0
                                                                                                                                                                                    down vote













                                                                                                                                                                                    I had the same issue. My browser would open but on my terminal it threw the following error



                                                                                                                                                                                    30 08 2017 11:19:28.272:INFO [Chrome 58.0.3029 (Linux 0.0.0)]: Connected `enter code here`on socket 5sSs6E5KmpUVRp6LAAAB with id 93886631
                                                                                                                                                                                    Chrome 58.0.3029 (Linux 0.0.0) ERRORSome of your tests did a full page reload!


                                                                                                                                                                                    I checked my karma.conf.js file. In the framework array , i had included jasmine and requirejs. But i had only installed karma-jasmine.Removing requireJS and rerunning the karma start worked!






                                                                                                                                                                                    share|improve this answer

























                                                                                                                                                                                      up vote
                                                                                                                                                                                      0
                                                                                                                                                                                      down vote













                                                                                                                                                                                      I had the same issue. My browser would open but on my terminal it threw the following error



                                                                                                                                                                                      30 08 2017 11:19:28.272:INFO [Chrome 58.0.3029 (Linux 0.0.0)]: Connected `enter code here`on socket 5sSs6E5KmpUVRp6LAAAB with id 93886631
                                                                                                                                                                                      Chrome 58.0.3029 (Linux 0.0.0) ERRORSome of your tests did a full page reload!


                                                                                                                                                                                      I checked my karma.conf.js file. In the framework array , i had included jasmine and requirejs. But i had only installed karma-jasmine.Removing requireJS and rerunning the karma start worked!






                                                                                                                                                                                      share|improve this answer























                                                                                                                                                                                        up vote
                                                                                                                                                                                        0
                                                                                                                                                                                        down vote










                                                                                                                                                                                        up vote
                                                                                                                                                                                        0
                                                                                                                                                                                        down vote









                                                                                                                                                                                        I had the same issue. My browser would open but on my terminal it threw the following error



                                                                                                                                                                                        30 08 2017 11:19:28.272:INFO [Chrome 58.0.3029 (Linux 0.0.0)]: Connected `enter code here`on socket 5sSs6E5KmpUVRp6LAAAB with id 93886631
                                                                                                                                                                                        Chrome 58.0.3029 (Linux 0.0.0) ERRORSome of your tests did a full page reload!


                                                                                                                                                                                        I checked my karma.conf.js file. In the framework array , i had included jasmine and requirejs. But i had only installed karma-jasmine.Removing requireJS and rerunning the karma start worked!






                                                                                                                                                                                        share|improve this answer












                                                                                                                                                                                        I had the same issue. My browser would open but on my terminal it threw the following error



                                                                                                                                                                                        30 08 2017 11:19:28.272:INFO [Chrome 58.0.3029 (Linux 0.0.0)]: Connected `enter code here`on socket 5sSs6E5KmpUVRp6LAAAB with id 93886631
                                                                                                                                                                                        Chrome 58.0.3029 (Linux 0.0.0) ERRORSome of your tests did a full page reload!


                                                                                                                                                                                        I checked my karma.conf.js file. In the framework array , i had included jasmine and requirejs. But i had only installed karma-jasmine.Removing requireJS and rerunning the karma start worked!







                                                                                                                                                                                        share|improve this answer












                                                                                                                                                                                        share|improve this answer



                                                                                                                                                                                        share|improve this answer










                                                                                                                                                                                        answered Aug 30 '17 at 6:04









                                                                                                                                                                                        CoolNiks

                                                                                                                                                                                        13




                                                                                                                                                                                        13






















                                                                                                                                                                                            up vote
                                                                                                                                                                                            0
                                                                                                                                                                                            down vote













                                                                                                                                                                                            I've been struggling with this too. What I came up to is that this error occurs because one of the following reasons




                                                                                                                                                                                            • No test adapter installed or defined (frameworks property in karma.conf.js

                                                                                                                                                                                            • No karma configuration found (ie, no karma.conf.js in current dir or no config file specified in command)


                                                                                                                                                                                            My problem was that my config file was named karma.config.js instead of karma.conf.js.



                                                                                                                                                                                            If you've installed the test adapter but it still doesn't work, try running karma init and go through the guided config setup.






                                                                                                                                                                                            share|improve this answer

























                                                                                                                                                                                              up vote
                                                                                                                                                                                              0
                                                                                                                                                                                              down vote













                                                                                                                                                                                              I've been struggling with this too. What I came up to is that this error occurs because one of the following reasons




                                                                                                                                                                                              • No test adapter installed or defined (frameworks property in karma.conf.js

                                                                                                                                                                                              • No karma configuration found (ie, no karma.conf.js in current dir or no config file specified in command)


                                                                                                                                                                                              My problem was that my config file was named karma.config.js instead of karma.conf.js.



                                                                                                                                                                                              If you've installed the test adapter but it still doesn't work, try running karma init and go through the guided config setup.






                                                                                                                                                                                              share|improve this answer























                                                                                                                                                                                                up vote
                                                                                                                                                                                                0
                                                                                                                                                                                                down vote










                                                                                                                                                                                                up vote
                                                                                                                                                                                                0
                                                                                                                                                                                                down vote









                                                                                                                                                                                                I've been struggling with this too. What I came up to is that this error occurs because one of the following reasons




                                                                                                                                                                                                • No test adapter installed or defined (frameworks property in karma.conf.js

                                                                                                                                                                                                • No karma configuration found (ie, no karma.conf.js in current dir or no config file specified in command)


                                                                                                                                                                                                My problem was that my config file was named karma.config.js instead of karma.conf.js.



                                                                                                                                                                                                If you've installed the test adapter but it still doesn't work, try running karma init and go through the guided config setup.






                                                                                                                                                                                                share|improve this answer












                                                                                                                                                                                                I've been struggling with this too. What I came up to is that this error occurs because one of the following reasons




                                                                                                                                                                                                • No test adapter installed or defined (frameworks property in karma.conf.js

                                                                                                                                                                                                • No karma configuration found (ie, no karma.conf.js in current dir or no config file specified in command)


                                                                                                                                                                                                My problem was that my config file was named karma.config.js instead of karma.conf.js.



                                                                                                                                                                                                If you've installed the test adapter but it still doesn't work, try running karma init and go through the guided config setup.







                                                                                                                                                                                                share|improve this answer












                                                                                                                                                                                                share|improve this answer



                                                                                                                                                                                                share|improve this answer










                                                                                                                                                                                                answered Oct 26 '17 at 11:49









                                                                                                                                                                                                kontrollanten

                                                                                                                                                                                                1,092422




                                                                                                                                                                                                1,092422






















                                                                                                                                                                                                    up vote
                                                                                                                                                                                                    0
                                                                                                                                                                                                    down vote













                                                                                                                                                                                                    In my case, the configuration file name was different. So, running the command specifying the conf file solved my issue.



                                                                                                                                                                                                    >> karma start unit-tests.conf.js
                                                                                                                                                                                                    No captured browser, open http://localhost:9876/
                                                                                                                                                                                                    ...


                                                                                                                                                                                                    And for 'PhantomJS', opening the link specified(localhost:9876) in the browser executes the test cases.



                                                                                                                                                                                                    Hope it helps. :)



                                                                                                                                                                                                    EDIT 1: My Karma Config File



                                                                                                                                                                                                    module.exports = function(config) {
                                                                                                                                                                                                    config.set({

                                                                                                                                                                                                    // base path that will be used to resolve all patterns (eg. files, exclude)
                                                                                                                                                                                                    basePath: '',


                                                                                                                                                                                                    // frameworks to use
                                                                                                                                                                                                    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
                                                                                                                                                                                                    frameworks: ['jasmine'],


                                                                                                                                                                                                    // list of files / patterns to load in the browser
                                                                                                                                                                                                    files: [
                                                                                                                                                                                                    './node_modules/angular/angular.js',
                                                                                                                                                                                                    './node_modules/angular-ui-router/release/angular-ui-router.js',
                                                                                                                                                                                                    './node_modules/angular-mocks/angular-mocks.js',
                                                                                                                                                                                                    './app/services/users/users.js',
                                                                                                                                                                                                    './app/app.js',
                                                                                                                                                                                                    './app/services/users/users.spec.js'
                                                                                                                                                                                                    ],


                                                                                                                                                                                                    // list of files to exclude
                                                                                                                                                                                                    exclude: [
                                                                                                                                                                                                    ],


                                                                                                                                                                                                    // preprocess matching files before serving them to the browser
                                                                                                                                                                                                    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
                                                                                                                                                                                                    preprocessors: {
                                                                                                                                                                                                    },


                                                                                                                                                                                                    // test results reporter to use
                                                                                                                                                                                                    // possible values: 'dots', 'progress'
                                                                                                                                                                                                    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
                                                                                                                                                                                                    reporters: ['spec'],


                                                                                                                                                                                                    // web server port
                                                                                                                                                                                                    port: 9876,


                                                                                                                                                                                                    // enable / disable colors in the output (reporters and logs)
                                                                                                                                                                                                    colors: true,


                                                                                                                                                                                                    // level of logging
                                                                                                                                                                                                    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
                                                                                                                                                                                                    logLevel: config.LOG_INFO,


                                                                                                                                                                                                    // enable / disable watching file and executing tests whenever any file changes
                                                                                                                                                                                                    autoWatch: true,


                                                                                                                                                                                                    // start these browsers
                                                                                                                                                                                                    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
                                                                                                                                                                                                    browsers: ['Chrome'],


                                                                                                                                                                                                    // Continuous Integration mode
                                                                                                                                                                                                    // if true, Karma captures browsers, runs the tests and exits
                                                                                                                                                                                                    singleRun: false,

                                                                                                                                                                                                    // Concurrency level
                                                                                                                                                                                                    // how many browser should be started simultaneous
                                                                                                                                                                                                    concurrency: Infinity
                                                                                                                                                                                                    })
                                                                                                                                                                                                    }





                                                                                                                                                                                                    share|improve this answer

























                                                                                                                                                                                                      up vote
                                                                                                                                                                                                      0
                                                                                                                                                                                                      down vote













                                                                                                                                                                                                      In my case, the configuration file name was different. So, running the command specifying the conf file solved my issue.



                                                                                                                                                                                                      >> karma start unit-tests.conf.js
                                                                                                                                                                                                      No captured browser, open http://localhost:9876/
                                                                                                                                                                                                      ...


                                                                                                                                                                                                      And for 'PhantomJS', opening the link specified(localhost:9876) in the browser executes the test cases.



                                                                                                                                                                                                      Hope it helps. :)



                                                                                                                                                                                                      EDIT 1: My Karma Config File



                                                                                                                                                                                                      module.exports = function(config) {
                                                                                                                                                                                                      config.set({

                                                                                                                                                                                                      // base path that will be used to resolve all patterns (eg. files, exclude)
                                                                                                                                                                                                      basePath: '',


                                                                                                                                                                                                      // frameworks to use
                                                                                                                                                                                                      // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
                                                                                                                                                                                                      frameworks: ['jasmine'],


                                                                                                                                                                                                      // list of files / patterns to load in the browser
                                                                                                                                                                                                      files: [
                                                                                                                                                                                                      './node_modules/angular/angular.js',
                                                                                                                                                                                                      './node_modules/angular-ui-router/release/angular-ui-router.js',
                                                                                                                                                                                                      './node_modules/angular-mocks/angular-mocks.js',
                                                                                                                                                                                                      './app/services/users/users.js',
                                                                                                                                                                                                      './app/app.js',
                                                                                                                                                                                                      './app/services/users/users.spec.js'
                                                                                                                                                                                                      ],


                                                                                                                                                                                                      // list of files to exclude
                                                                                                                                                                                                      exclude: [
                                                                                                                                                                                                      ],


                                                                                                                                                                                                      // preprocess matching files before serving them to the browser
                                                                                                                                                                                                      // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
                                                                                                                                                                                                      preprocessors: {
                                                                                                                                                                                                      },


                                                                                                                                                                                                      // test results reporter to use
                                                                                                                                                                                                      // possible values: 'dots', 'progress'
                                                                                                                                                                                                      // available reporters: https://npmjs.org/browse/keyword/karma-reporter
                                                                                                                                                                                                      reporters: ['spec'],


                                                                                                                                                                                                      // web server port
                                                                                                                                                                                                      port: 9876,


                                                                                                                                                                                                      // enable / disable colors in the output (reporters and logs)
                                                                                                                                                                                                      colors: true,


                                                                                                                                                                                                      // level of logging
                                                                                                                                                                                                      // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
                                                                                                                                                                                                      logLevel: config.LOG_INFO,


                                                                                                                                                                                                      // enable / disable watching file and executing tests whenever any file changes
                                                                                                                                                                                                      autoWatch: true,


                                                                                                                                                                                                      // start these browsers
                                                                                                                                                                                                      // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
                                                                                                                                                                                                      browsers: ['Chrome'],


                                                                                                                                                                                                      // Continuous Integration mode
                                                                                                                                                                                                      // if true, Karma captures browsers, runs the tests and exits
                                                                                                                                                                                                      singleRun: false,

                                                                                                                                                                                                      // Concurrency level
                                                                                                                                                                                                      // how many browser should be started simultaneous
                                                                                                                                                                                                      concurrency: Infinity
                                                                                                                                                                                                      })
                                                                                                                                                                                                      }





                                                                                                                                                                                                      share|improve this answer























                                                                                                                                                                                                        up vote
                                                                                                                                                                                                        0
                                                                                                                                                                                                        down vote










                                                                                                                                                                                                        up vote
                                                                                                                                                                                                        0
                                                                                                                                                                                                        down vote









                                                                                                                                                                                                        In my case, the configuration file name was different. So, running the command specifying the conf file solved my issue.



                                                                                                                                                                                                        >> karma start unit-tests.conf.js
                                                                                                                                                                                                        No captured browser, open http://localhost:9876/
                                                                                                                                                                                                        ...


                                                                                                                                                                                                        And for 'PhantomJS', opening the link specified(localhost:9876) in the browser executes the test cases.



                                                                                                                                                                                                        Hope it helps. :)



                                                                                                                                                                                                        EDIT 1: My Karma Config File



                                                                                                                                                                                                        module.exports = function(config) {
                                                                                                                                                                                                        config.set({

                                                                                                                                                                                                        // base path that will be used to resolve all patterns (eg. files, exclude)
                                                                                                                                                                                                        basePath: '',


                                                                                                                                                                                                        // frameworks to use
                                                                                                                                                                                                        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
                                                                                                                                                                                                        frameworks: ['jasmine'],


                                                                                                                                                                                                        // list of files / patterns to load in the browser
                                                                                                                                                                                                        files: [
                                                                                                                                                                                                        './node_modules/angular/angular.js',
                                                                                                                                                                                                        './node_modules/angular-ui-router/release/angular-ui-router.js',
                                                                                                                                                                                                        './node_modules/angular-mocks/angular-mocks.js',
                                                                                                                                                                                                        './app/services/users/users.js',
                                                                                                                                                                                                        './app/app.js',
                                                                                                                                                                                                        './app/services/users/users.spec.js'
                                                                                                                                                                                                        ],


                                                                                                                                                                                                        // list of files to exclude
                                                                                                                                                                                                        exclude: [
                                                                                                                                                                                                        ],


                                                                                                                                                                                                        // preprocess matching files before serving them to the browser
                                                                                                                                                                                                        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
                                                                                                                                                                                                        preprocessors: {
                                                                                                                                                                                                        },


                                                                                                                                                                                                        // test results reporter to use
                                                                                                                                                                                                        // possible values: 'dots', 'progress'
                                                                                                                                                                                                        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
                                                                                                                                                                                                        reporters: ['spec'],


                                                                                                                                                                                                        // web server port
                                                                                                                                                                                                        port: 9876,


                                                                                                                                                                                                        // enable / disable colors in the output (reporters and logs)
                                                                                                                                                                                                        colors: true,


                                                                                                                                                                                                        // level of logging
                                                                                                                                                                                                        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
                                                                                                                                                                                                        logLevel: config.LOG_INFO,


                                                                                                                                                                                                        // enable / disable watching file and executing tests whenever any file changes
                                                                                                                                                                                                        autoWatch: true,


                                                                                                                                                                                                        // start these browsers
                                                                                                                                                                                                        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
                                                                                                                                                                                                        browsers: ['Chrome'],


                                                                                                                                                                                                        // Continuous Integration mode
                                                                                                                                                                                                        // if true, Karma captures browsers, runs the tests and exits
                                                                                                                                                                                                        singleRun: false,

                                                                                                                                                                                                        // Concurrency level
                                                                                                                                                                                                        // how many browser should be started simultaneous
                                                                                                                                                                                                        concurrency: Infinity
                                                                                                                                                                                                        })
                                                                                                                                                                                                        }





                                                                                                                                                                                                        share|improve this answer












                                                                                                                                                                                                        In my case, the configuration file name was different. So, running the command specifying the conf file solved my issue.



                                                                                                                                                                                                        >> karma start unit-tests.conf.js
                                                                                                                                                                                                        No captured browser, open http://localhost:9876/
                                                                                                                                                                                                        ...


                                                                                                                                                                                                        And for 'PhantomJS', opening the link specified(localhost:9876) in the browser executes the test cases.



                                                                                                                                                                                                        Hope it helps. :)



                                                                                                                                                                                                        EDIT 1: My Karma Config File



                                                                                                                                                                                                        module.exports = function(config) {
                                                                                                                                                                                                        config.set({

                                                                                                                                                                                                        // base path that will be used to resolve all patterns (eg. files, exclude)
                                                                                                                                                                                                        basePath: '',


                                                                                                                                                                                                        // frameworks to use
                                                                                                                                                                                                        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
                                                                                                                                                                                                        frameworks: ['jasmine'],


                                                                                                                                                                                                        // list of files / patterns to load in the browser
                                                                                                                                                                                                        files: [
                                                                                                                                                                                                        './node_modules/angular/angular.js',
                                                                                                                                                                                                        './node_modules/angular-ui-router/release/angular-ui-router.js',
                                                                                                                                                                                                        './node_modules/angular-mocks/angular-mocks.js',
                                                                                                                                                                                                        './app/services/users/users.js',
                                                                                                                                                                                                        './app/app.js',
                                                                                                                                                                                                        './app/services/users/users.spec.js'
                                                                                                                                                                                                        ],


                                                                                                                                                                                                        // list of files to exclude
                                                                                                                                                                                                        exclude: [
                                                                                                                                                                                                        ],


                                                                                                                                                                                                        // preprocess matching files before serving them to the browser
                                                                                                                                                                                                        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
                                                                                                                                                                                                        preprocessors: {
                                                                                                                                                                                                        },


                                                                                                                                                                                                        // test results reporter to use
                                                                                                                                                                                                        // possible values: 'dots', 'progress'
                                                                                                                                                                                                        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
                                                                                                                                                                                                        reporters: ['spec'],


                                                                                                                                                                                                        // web server port
                                                                                                                                                                                                        port: 9876,


                                                                                                                                                                                                        // enable / disable colors in the output (reporters and logs)
                                                                                                                                                                                                        colors: true,


                                                                                                                                                                                                        // level of logging
                                                                                                                                                                                                        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
                                                                                                                                                                                                        logLevel: config.LOG_INFO,


                                                                                                                                                                                                        // enable / disable watching file and executing tests whenever any file changes
                                                                                                                                                                                                        autoWatch: true,


                                                                                                                                                                                                        // start these browsers
                                                                                                                                                                                                        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
                                                                                                                                                                                                        browsers: ['Chrome'],


                                                                                                                                                                                                        // Continuous Integration mode
                                                                                                                                                                                                        // if true, Karma captures browsers, runs the tests and exits
                                                                                                                                                                                                        singleRun: false,

                                                                                                                                                                                                        // Concurrency level
                                                                                                                                                                                                        // how many browser should be started simultaneous
                                                                                                                                                                                                        concurrency: Infinity
                                                                                                                                                                                                        })
                                                                                                                                                                                                        }






                                                                                                                                                                                                        share|improve this answer












                                                                                                                                                                                                        share|improve this answer



                                                                                                                                                                                                        share|improve this answer










                                                                                                                                                                                                        answered Jan 30 at 11:40









                                                                                                                                                                                                        Naveen Kumar V

                                                                                                                                                                                                        484722




                                                                                                                                                                                                        484722






















                                                                                                                                                                                                            up vote
                                                                                                                                                                                                            0
                                                                                                                                                                                                            down vote













                                                                                                                                                                                                            You will have to specify the directory of karma.config.js when you run start karma.



                                                                                                                                                                                                            Try



                                                                                                                                                                                                            karma start karma.config.js






                                                                                                                                                                                                            share|improve this answer

























                                                                                                                                                                                                              up vote
                                                                                                                                                                                                              0
                                                                                                                                                                                                              down vote













                                                                                                                                                                                                              You will have to specify the directory of karma.config.js when you run start karma.



                                                                                                                                                                                                              Try



                                                                                                                                                                                                              karma start karma.config.js






                                                                                                                                                                                                              share|improve this answer























                                                                                                                                                                                                                up vote
                                                                                                                                                                                                                0
                                                                                                                                                                                                                down vote










                                                                                                                                                                                                                up vote
                                                                                                                                                                                                                0
                                                                                                                                                                                                                down vote









                                                                                                                                                                                                                You will have to specify the directory of karma.config.js when you run start karma.



                                                                                                                                                                                                                Try



                                                                                                                                                                                                                karma start karma.config.js






                                                                                                                                                                                                                share|improve this answer












                                                                                                                                                                                                                You will have to specify the directory of karma.config.js when you run start karma.



                                                                                                                                                                                                                Try



                                                                                                                                                                                                                karma start karma.config.js







                                                                                                                                                                                                                share|improve this answer












                                                                                                                                                                                                                share|improve this answer



                                                                                                                                                                                                                share|improve this answer










                                                                                                                                                                                                                answered Nov 8 at 9:21









                                                                                                                                                                                                                Paschalidis Christos

                                                                                                                                                                                                                919




                                                                                                                                                                                                                919






























                                                                                                                                                                                                                    draft saved

                                                                                                                                                                                                                    draft discarded




















































                                                                                                                                                                                                                    Thanks for contributing an answer to Stack Overflow!


                                                                                                                                                                                                                    • Please be sure to answer the question. Provide details and share your research!

                                                                                                                                                                                                                    But avoid



                                                                                                                                                                                                                    • Asking for help, clarification, or responding to other answers.

                                                                                                                                                                                                                    • Making statements based on opinion; back them up with references or personal experience.


                                                                                                                                                                                                                    To learn more, see our tips on writing great answers.





                                                                                                                                                                                                                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                                                                                                                                                                                    Please pay close attention to the following guidance:


                                                                                                                                                                                                                    • Please be sure to answer the question. Provide details and share your research!

                                                                                                                                                                                                                    But avoid



                                                                                                                                                                                                                    • Asking for help, clarification, or responding to other answers.

                                                                                                                                                                                                                    • Making statements based on opinion; back them up with references or personal experience.


                                                                                                                                                                                                                    To learn more, see our tips on writing great answers.




                                                                                                                                                                                                                    draft saved


                                                                                                                                                                                                                    draft discarded














                                                                                                                                                                                                                    StackExchange.ready(
                                                                                                                                                                                                                    function () {
                                                                                                                                                                                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f24220888%2ferror-you-need-to-include-some-adapter-that-implements-karma-start-method%23new-answer', 'question_page');
                                                                                                                                                                                                                    }
                                                                                                                                                                                                                    );

                                                                                                                                                                                                                    Post as a guest















                                                                                                                                                                                                                    Required, but never shown





















































                                                                                                                                                                                                                    Required, but never shown














                                                                                                                                                                                                                    Required, but never shown












                                                                                                                                                                                                                    Required, but never shown







                                                                                                                                                                                                                    Required, but never shown

































                                                                                                                                                                                                                    Required, but never shown














                                                                                                                                                                                                                    Required, but never shown












                                                                                                                                                                                                                    Required, but never shown







                                                                                                                                                                                                                    Required, but never shown







                                                                                                                                                                                                                    這個網誌中的熱門文章

                                                                                                                                                                                                                    Tangent Lines Diagram Along Smooth Curve

                                                                                                                                                                                                                    Yusuf al-Mu'taman ibn Hud

                                                                                                                                                                                                                    Zucchini