Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Paths to exclude files #31

Closed
dmaslov opened this issue Jun 20, 2014 · 2 comments
Closed

Paths to exclude files #31

dmaslov opened this issue Jun 20, 2014 · 2 comments

Comments

@dmaslov
Copy link

dmaslov commented Jun 20, 2014

Hi! From your Readme:

options.*

Any Karma option can be passed as part of the options object. See [Karma Configuration] for a complete list of options. Note: It's best practice to put options in your Karma config file.

I'm trying to pass paths for exclude files from tests(karma.config.js has exclude property). It doesn't work. Files are not excluded. If i keep exclude paths in karma.conf.js all works fine, but i want to keep all paths (files for testing and for excluding) in one place (gulpfile.js)

What the best practice to do that with gulp-karma plugin?

The part of my gulpfile.js below:

...
var paths = {
    tests: {
        frontend: [
            srcPath + '/js/**/*.js',
            testsPath + '/helpers.js',
            testsUnitPath + '/**/*.js'
         ],
        exclude: [
            srcPath + '/js/*.min.js',
            testsUnitPath + '/server.js'
        ]
    }
};

gulp.task('run-tests', function() {
    return gulp
            .src(paths.tests.frontend)
            .pipe(karma({
                configFile: testsPath + '/karma.config.js',
                action: 'run',
                exclude: paths.tests.exclude
            }))
            .on('error', function(err) {
                throw err;
            });
});
...
@lazd
Copy link
Owner

lazd commented Jun 20, 2014

Please see karma-runner/karma#1037, when it's closed, this plugin can be re-tooled or deprecated.

@lazd
Copy link
Owner

lazd commented Oct 1, 2015

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

@lazd lazd closed this as completed Oct 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants