3

Im getting Executed 0 of 0 ERROR error when trying to run unit test cases. I followed few solutions that was mentioned for this problem, but still i get the same error.

Tried:

  1. Removing the angular-scenario file
  2. Added angular-scenario in exclusion list.

But nothing worked. I still get the same error. My karma.conf.js file is

module.exports = function(config){
    config.set({
    basePath : '../',

    files : [      
      'app/lib/angular/angular.js',      
      'test/lib/angular/angular-mocks.js',
      'app/js/*.js',
      'test/unit/*.js'
    ],
    exclude : ['test/lib/angular/angular-scenario.js'],
    autoWatch : true,

    frameworks: ['jasmine'],

    browsers : ['Chrome'],

    plugins : [
            'karma-junit-reporter',
            'karma-chrome-launcher',
            'karma-firefox-launcher',
            'karma-jasmine'       
            ],

    junitReporter : {
      outputFile: 'test_out/unit.xml',
      suite: 'unit'
    }

})}
Rajkamal Subramanian
  • 6,884
  • 4
  • 52
  • 69

2 Answers2

2

Make sure you path to angular-scenario.js is correct.
I used the big hammer:

// list of files to exclude                                        
exclude: [                                                         
  '**/angular-scenario.js'                                         
],

This fixed the problem for me because angular-scenario.js was being picked up the by 'js/**/*.js' in my files section.

olore
  • 4,687
  • 3
  • 28
  • 40
0

Angular-scenario.js is deprecated. Use Protractor for your e2e (end to end) testing, and remove all references to angular-scenario.js from the config file, above.

Protractor has some great getting started docs to help you along too.

I also suggest using the grunt/protractor plug in if you're using yeoman.

Protactor Setup
https://angular.github.io/protractor/#/

Grunt Protractor Runner - NPM (node package manager)
https://www.npmjs.com/package/grunt-protractor-runner

Shawesome
  • 55
  • 11
  • Here are some other ways to experience/work around this error: Karma Tests Not Running - Github https://github.com/DaftMonk/generator-angular-fullstack/issues/251#issuecomment-108562009 – Shawesome Jun 03 '15 at 20:57