karma-runner / grunt-karma

Grunt plugin for Karma.
MIT License
468 stars 116 forks source link

client.args doesn't pass to mocha #177

Open dKab opened 8 years ago

dKab commented 8 years ago

I have a setup with karma. When I run karma start everything is ok. Tests are passing. But if try to do the same with grunt-karma the client.args does't apply! This is how my karma config block in Gruntfile.js looks like:

...
karma: {
        watch: {
            configFile: 'karma.conf.js'
        },
        CI: {
            configFile: 'karma.conf.js',
            singleRun: true
        }
    }
...
grunt.loadNpmTasks('grunt-karma');
...
grunt.registerTask('dev', [
    'karma:watch'
]);
...

In my karma.conf.js I have this client block with arguments to be passed to mocha:

client: {
        mocha: {
            ui: 'tdd'
        }
    },

So when I run grunt dev mocha doesn't get this ui parameter and that's why 'ReferenceError: Can't find variable: suite happens. I know that because if I comment client block in karma.conf.js and run karma start I get the same error. So why does this happen?

You can see my setup here: https://github.com/dKab/todo/tree/karma