Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to start karma #1245

Closed
diegofss11 opened this issue Nov 15, 2014 · 11 comments
Closed

Not able to start karma #1245

diegofss11 opened this issue Nov 15, 2014 · 11 comments

Comments

@diegofss11
Copy link

I'm not able to start karma in my project - which is a really simple one btw.

Find attached the img with the error and below my karma.conf

module.exports = function(config){
    config.set({
        basePath : '',
        background: true,
        autoWatch : true,
        colors: true,
        singleRun: false,
        frameworks: ['jasmine'], 
        reporters: ['progress'],
        files : [
          '../bower_components/angular/angular.min.js',
          '../source/js/**/*.js',
          'unit/controllers/*.js'
        ],
        plugins : [
           'karma-jasmine',
           'karma-chrome-launcher',            
           'karma-junit-reporter',
           'karma-phantomjs-launcher'
        ],
        junitReporter : {
            outputFile: 'test_out/unit.xml',
            suite: 'unit'
        }
    });
};

GruntFile

karma: { 
            unit: { 
                configFile: 'test/karma.conf.js', 
                runnerPort: 9876,
                browsers: ['PhantomJS'],
                //browsers: [ 'Chrome' ]
            }
        } 

plugins added on package.json

 "grunt-karma": "^0.9.0",
"karma-chrome-launcher": "^0.1.5",
 "karma-jasmine": "^0.2.3",
 "karma-junit-reporter": "^0.2.2",
 "karma-phantomjs-launcher": "^0.1.4",
 "karma": "^0.12.24"

Does anybody know what is happening?

Thanks!
karmanotstarting

@pkozlowski-opensource
Copy link
Member

It looks like some pb with PhantomJs. Did you try with a real browser?

@diegofss11
Copy link
Author

Yes. The same result for Chrome.

@maksimr
Copy link
Contributor

maksimr commented Nov 17, 2014

@diegofss11 what does mean background: true, in your config?
What Windows you use?

@diegofss11
Copy link
Author

Actually this is my application I'm trying to bootstrap Angular with.

https://github.com/diegofss11/myAngularSeed

I'm running the karma.conf on the root folder as karma start karma.conf so the other file is ignored. Some how I'm not able to. I didn't figure it out what is happenning.

@maksimr
Copy link
Contributor

maksimr commented Nov 19, 2014

@diegofss11 Thanks! For me karma start --single-run work inside your project.

In package.json you should change it
on karma start and karma start --single-run. Karma catch karma.conf.js by default. Also you should add bower folder to karma.conf.js

@maksimr
Copy link
Contributor

maksimr commented Nov 19, 2014

Related issues about problem with capturing browsers:

#1206
#783

@maksimr maksimr closed this as completed Nov 19, 2014
@diegofss11
Copy link
Author

I still not able to execute it.

I removed the other file so I just have this karma.conf.js

https://github.com/diegofss11/myAngularSeed/blob/master/config/karma.conf.js

I'm trying running karma start config/karma.conf.js still not working. Not even through grunt test

@maksimr
Copy link
Contributor

maksimr commented Nov 19, 2014

@diegofss11 on Ubuntu14 all work fine

Seems that problem with phantomjs(launcher).
What OS you are use?

@diegofss11
Copy link
Author

hmm really weird. I'm using WIn7

@maksimr
Copy link
Contributor

maksimr commented Nov 19, 2014

@diegofss11 I checked on Win7 in VirtualBox also all work

Try open in browser http://localhost:9876 (where run karma server). Maybe you have wrong hosts file or network settings.

@diegofss11
Copy link
Author

hmmm thank you so much @maksimr. The problem was my hosts file. :)

Thanks!

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

No branches or pull requests

3 participants