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?
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'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With