lundi 22 juin 2015

How to configure Grunt and Mocha to run specific testfiles

I want to have a target in my GruntFile (the first one inside my test target), such as:

if (target === 'ci') {
  return grunt.task.run([
    'env:ci',
    'coffee',
    'mochaCI',
    'etc etc'
  ]);
}

referencing:

mochaCI: {
  options: {
    reporter: 'spec'
  },
  src: ['ci/**/*.spec.js']
}

When now running grunt test:ci, grunt throws:

jit-grunt: Plugin for the "mochaCI" task not found.
If you have installed the plugin already, please setting the static mapping.
See http://ift.tt/1oBmn8Z

which is understandable since mochaCI is not a plugin. How can I achieve what I want, e.g. running a certain series of tests only when calling "grunt test:unit or grunt test:ci? Alternatively I am happy for any other approach of configuration.

Aucun commentaire:

Enregistrer un commentaire