Error: You need to include some adapter that implements __karma__.start method

后端 未结 26 1341
梦谈多话
梦谈多话 2020-12-01 11:53

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

相关标签:
26条回答
  • 2020-12-01 12:06

    FWIW - sourcing the file path of karma.conf.js worked for me locally, but not on my jenkins builder. I have zero clue why this is the case, but on jenkins it was throwing this error unless the karma.conf.js file was in the root directory where the karma command was given. I'm using rails and running the js specs through a rake task. Code is below which might be helpful for some.

    https://gist.github.com/daino3/a39486ff8bfc1668e923

    0 讨论(0)
  • 2020-12-01 12:06

    The issue in my case was that karma didn't pick up any files. Fixing it in karma.conf.js solved the issue.

    0 讨论(0)
  • 2020-12-01 12:07

    I was facing this issue while running specs on the Angular.js codebase. I had to run npm install karma-jasmine -g to get this working.

    0 讨论(0)
  • 2020-12-01 12:07

    I was getting the same error because the project was using Babel 6 and I had forgotten to add the babelrc file. Just sharing in case this could help.

    0 讨论(0)
  • 2020-12-01 12:07

    In my case, it was not karma-related at all! I run karma from gulp, with ES6/babel, and there was actually a code syntax error, flagged by a babel error above my karma:

    ERROR [preprocessor.babel]: xxx.js: Unexpected token (19:83)

    I fixed that in my src and karma was happy again.

    0 讨论(0)
  • 2020-12-01 12:09

    While working on numerous vaguely described errors, I tried setting basePath: '../', After correcting other errors (like missing commas that were described as object content errors) the last change back to basePath: '', got karma to work. karma's error statements need a lot of work. It is not simple to get it going.

    0 讨论(0)
提交回复
热议问题