Karma.conf.js does not exist

gruntjs, karma-runner, yeoman

Solution

Gruntfile.js refers to karma.conf.js in the root-dir. The Angular generator puts it in the test-directory, so you'll need to update Gruntfile.js

// Test settings
karma: {
  unit: {
    configFile: 'test/karma.conf.js',
    singleRun: true
  }
}

There's also a problem when running grunt test with this generated karma.conf.js. It will say

test/karma.conf.js:63
    colors: true,
    ^^^^^^
ERROR [config]: Invalid config file!
  SyntaxError: Unexpected identifier

Reason: comma missing after 'singleRun: false'.

Problem

I just reinstalled node from scratch. I also installed `yeoman`, `generator-angular`, and `karma`. After generating a project with `yo angular`, I can successfully `grunt serve`. However, whenever I try `grunt test`, the following error is thrown: `karma.conf.js does not exist` However, `karma.conf.js` does indeed exist in the generated test directory. Why would this happen?

Original source