grunt-karma not running the spec file when using shared config

I created a basic project to try and get Gruntjs, Karma and Jasmine to play together. When I setup the karma.conf.js file with all of the neccesary files, everything works and the tests pass.

When I try to split them up in Grunt though, I get problems.


    pkg: grunt.file.readJSON('package.json'),

    karma: {
        options: {
            configFile: 'karma.conf.js'
        basicController: {
            files: ['/basicController/scBasicControllerCtrl.js', '/basicController/test/ControllersSpec.js']
        overworkedController: {
            src: ['overworkedController/scOverworkedControllerCtrl.js', 'overworkedController/test/ControllersSpec.js']


The documentation at grunt-karma show to use "files:" when splitting up the modules. I did that under the basicController module and when I try to run $ grunt karma:basicController --verbose, I get an error saying

Warning: Cannot use 'in' operator to search for 'src' in /basicController/scBasicControllerCtrl.js Use --force to continue 

Aborted due to warnings.

When I run $ grunt karma:overworkedControllers --verbose (using "src" instead of "files", it looks like everything is going to work and the Chrome browser launches but then is says it executed 0 of 0 ERROR.

There should be 3 tests.

Let me know if there's any more info I could post.


My understanding of grunt-karma was incorrect.

I thought I could have the base and source files in the karma.conf.js file. Then in each module, I'd just add the specific files needed for that module and test.

The way it actually works is that the files declared in each module completely overwrite the files property in the karma.conf.js file. Not append to them.

I ended up creating an array in Gruntfile.js that contains all of the source .js files and just concat the necessary files to it in each module.

Need Your Help

Would it make sense to use Git for this project?

database svn git version-control

We have a project where 99% of the code is PL/SQL, including the front end (Oracle forms). All 10 developers use the same DB instance for developement. The project is big (thousands of DB objects) so

sum function not working

python list sum list-comprehension

I am trying to write a program that sums the integers in the odd columns of a list