'use strict';

var mocha = require('../lib/mocha');


module.exports = function (grunt) {
    grunt.registerMultiTask('mochacli', 'Run Mocha server-side tests.', function () {
        var options = this.options();
        if (!options.files) {
            options.files = this.file.srcRaw;
        }

        mocha(options, this.async());
    });
};

'use strict';

var mocha = require('../lib/mocha');


module.exports = function (grunt) {
    grunt.registerMultiTask('mochacli', 'Run Mocha server-side tests.', function () {
        var options = this.options();
        var globs = [];
        if (!options.files) {
            this.files.forEach(function (glob) {
                globs = globs.concat(glob.orig.src);
            });
            options.files = globs;
        }

        mocha(options, this.async());
    });
};

Fix using the Grunt files format
Fix using the Grunt files format
