I\'m trying to add some unit tests to one of my projects.
So far I\'ve installed and configured karma, and have installed jasmine. I\'ve one test file in my te
In my case I had to rename the file to karma.conf.js then do karma start
Same issue happened to me, and it was due to an outdated module.
Running npm update
solved it.
Tt's complaining about the adapter which is probably jasmine or mocha. Either the adapter is missing, either is not setup correctly, either it's an outdated or buggy version of the adapter.
In my case I had an old version of mocha 2.5.3 which was not compatible with karma 1+. I updated the mocha dependency to the latest version available 3.2.0 and the problem solved.
I had a bad 'files' configuration in my karma.conf.js
files: ['**/*.js'],
this caught up all the files in node_modules/ including those of the karma-jasmine plugin, as it was seen as sourde files it wasn't loaded on startup. Changing to
files: [
'src/*.js',
'spec/*.js'
],
solved the problem in my case
If you name your karma config file karma.conf.js
, you can simply type karma start
.
Otherwise specify the filename karma start karmafile.js
(I was in the right directory, but was not specifying a file name.)
It does seem like this is a very general error, however in my case the problem was either that I didn't run karma start
from the correct folder, or that I didn't restart it after changing the configuration.
I'll leave this question open and hopefully it can become a resource for others who experience this error message.