karma-runner / grunt-karma

Grunt plugin for Karma.
MIT License
468 stars 116 forks source link

grunt-karma ^2.0.0 installs karma@1.0.0 and tests don't work #192

Closed gugol2 closed 6 years ago

gugol2 commented 8 years ago

When installing grunt-karma npm install grunt-karma --save-dev it install karma^1.0.0 with it. And that breaks the tests:

Warning: .then() only accepts functions but was passed: [object Undefined], [object Undefined]...

More info here.

dignifiedquire commented 8 years ago

Can you provide a repro project? My tests run fine with karma@1.0

gugol2 commented 8 years ago

Create an angular project with yeoman (using grunt, not gulp) and try running the tests.

dignifiedquire commented 8 years ago

Does not reproduce it for me: This project works fine for me: https://github.com/dignifiedquire/grunt-karma-192

gugol2 commented 8 years ago

Sorry for my delay.

It's quite strange, I get it when running grunt on windows but not in linux. I tested your repo in W7 and Ubuntu14.04 and it only fails in W7.

It also happens just the same with my repo.

gugol2 commented 8 years ago

So in W7 I sorted out by installing the the version that grunt-karma needs according to the docs:

This current version uses karma`@0.13.x ...

npm install karma@0.13.22 --save-dev

Although it the tables it seems to depend of different versions of karma for devDependencies(1.x || ^0.13.0) and peerDependencies(^0.13.0 || >= 0.14.0-rc.0)

Krinkle commented 6 years ago

With currently supported versions of Node.js and npm (Node 6+, npm 3+) peerDependencie are not automatically downloaded (unlike regular dependencies). Instead, it is up to the project to decide what and which version to install.

As such, any version of karma and any version of grunt-karma can be used together. The peerDependencies only prints a soft warning if they don't match what we recommend and support.

The karma 1.x support has been been added and released, so closing this report. See https://github.com/karma-runner/grunt-karma/issues/267 for a similar issue with karma 3.x, which we're fixing next.

Thanks!