lazd / gulp-karma

Karma plugin for gulp
MIT License
75 stars 36 forks source link

Pulling file list from karma.conf.js #9

Closed nathasm closed 9 years ago

nathasm commented 10 years ago

I've been trying to figure out a way to use my existing karma.conf.js file that already has a list of the test files.

Is there a way to pull the files property from the karma.conf.js file without having to put the file list in my gulp.js file?

drkibitz commented 10 years ago

This is needed as the file list in a karma config supports objects such as {pattern: '*.png', include: false, serve: true}

shapeshed commented 10 years ago

Same.

One workaround is pass a valid glob pattern for a directory that doesn't exist

gulp.task('karma', function () {
  return gulp.src('./idontexist')
    .pipe(karma({
      configFile: 'karma.conf.js',
      action: 'run'
    }));
});
lazd commented 10 years ago

Given the overlap between karma and gulp (watching, file globs), this plugin needs a serious refactoring to be useful. @alexgorbatchev will be looking into this and working on a strategy to go forward with.

geddski commented 10 years ago

@lazd feel free to borrow some of the ideas we did in grunt-karma

alexgorbatchev commented 10 years ago

Comparing the two, they seem to pretty much do the same thing at the moment. I'm not really clear on why karma server is started in a separate node process though. Does anyone have any insights?

evgenyneu commented 10 years ago

Great plugin. It would be nice to keep the list of files by default in karma.conf.js instead of gulpfile.js. Otherwise it is a bit confusing to me.

lazd commented 10 years ago

Finally getting back to addressing these issues, and it's become clear that gulp-karma should not exist.

Please take a look at https://github.com/lazd/gulp-karma/issues/21#issuecomment-40786028 a start at a simple, clean solution that works great with gulp.

broekema41 commented 9 years ago

Hello drkibitz and lazd, I was struggling with the fixtures issue mentioned above. As a quick fix I decided to add them to the options object image Then included them later in the gulp-karma index.js "endStream" function image

Hoping this prevent others searching for a way to include non js files

lazd commented 9 years ago

gulp-karma is deprecated (#43). Please use Karma directly: https://github.com/karma-runner/gulp-karma