mercredi 6 avril 2016

How Do I Run a Subset of Unit Tests Gulp-Angular with Karma?

I'm working on an AngularJS 1.4 project that was created from the Gulp-Angular yeoman generator. It has karma and gulp already configured so that when I run gulp test from the command line karma runs all of my *.spec.js files. My problem is that it always run ALL of my spec.js files in the entire project. I would like to just run one or two spec.js files- even better to be able to specify a folder and have it find all spec.js files recursively.

  • I've tried just cd'ing down to a folder, but it still runs all tests.

  • I've also tried editing this line in karma.conf.js: path.join(conf.paths.src, '/**/*.spec.js'),

  • and this line in the gulp directory's unit-tests.js file: path.join(conf.paths.src, '/**/!(*.spec).js')

However, when I edit them I still get all the test suites in the whole entire project running! Ahh!

There must be a way to do what I'm trying to do. Can anyone help me out with the correct approach here?

Aucun commentaire:

Enregistrer un commentaire