###by Antwan Wimberly###
I had this config setup (remainder of config left out for brevity...am using grunt-contrib-watch just like in the README):
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
karma:
unit:
configFile: 'karma.config.coffee'
background: true
I actually spelled the name of the configFile
wrong. It's supposed to be karma.conf.coffee
. After seeing karma do absolutely nothing, grunt repeatedly tell me "Done, without errors" and giving me a false sense of success, and about 50 face palms, I was curious as to what would happen when I ran the task without background:true
. Finally I saw the light:
ERROR [config]: File /Users/antwanwimberly/SourceCode/auth-demo/karma.config.coffee does not exist!
So the only sane way to debug your karma setup is to defer setting the background:true
key until you've managed to stabilize your configuration and witness your tests being run successfully.
Also this wishful bit of thinking does not work:
grunt.registerTask 'default', ['karma:unit:start watch'];
With the above setup, I expected to be able to simply type
grunt
from the command line and all would be well. Well....NO! You literally have to type outgrunt karma:unit:start watch
from your terminal in order for everything to work as desired.UPDATE: Just found a way to get this to work without explicitly invoking from the command line. All done via grunt task now.