karma-runner / grunt-karma

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

Unit files not included #197

Closed FrancescoBorzi closed 6 years ago

FrancescoBorzi commented 8 years ago

From documentation:

The files option can be extended "per-target" in the typical way Grunt handles files:

karma: {
  options: {
    files: ['lib/**/*.js']
  },
  unit: {
    files: [
      { src: ['test/**/*.js'] }
    ]
  }
}

in my case I have:

karma: {
  options: {
    files: ['FileA.js', 'FileB.js']
  },
  myUnit: {
    files: [
      { src: ['FileC.js'] }
    ]
  }
}

and it is working. The problem is that the FileB.js should be only included in myUnit so I tried to move it, this way:

karma: {
  options: {
    files: ['FileA.js']
  },
  myUnit: {
    files: [
      { src: ['FileC.js'] },
      { src: ['FileB.js'] }
    ]
  }
}

but it does not work.

For some reasons unknown to me, the FileB.js is actually included only if I put it in the main configuration, if I place it under the myUnit configuration it is not included at all.

Using:

grunt-cli v1.2.0
grunt v1.0.1
grunt-karma": "^2.0.0
jasmine-core": "^2.5
karma": "^1.1.2
karma-babel-preprocessor": "^6.0.1
karma-chrome-launcher": "^1.0.1
karma-cli": "^1.0.1
karma-jasmine": "^1.0.2
karma-junit-reporter": "^1.1.0
karma-phantomjs-launcher": "^1.0.2
karma-sourcemap-loader": "^0.3.7
karma-webpack": "^1.8.0
Krinkle commented 6 years ago

@ShinDarth I am unable to reproduce this issue with the current versions of grunt-karma and karma. Could you try this again on a current version?

FrancescoBorzi commented 6 years ago

sorry, it was two years ago and I don't have that source code anymore