From: Iskren Chernev Date: Wed, 8 Jul 2015 13:24:15 +0000 (+0800) Subject: Support grunt test --only=moment/duration,locale/ru X-Git-Tag: 2.10.5~19^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37fd56928e628c2ec0bd7ce4f65184d4a3e3958b;p=thirdparty%2Fmoment.git Support grunt test --only=moment/duration,locale/ru --- diff --git a/tasks/qtest.js b/tasks/qtest.js index dc942a12a..a212087fb 100644 --- a/tasks/qtest.js +++ b/tasks/qtest.js @@ -10,10 +10,26 @@ module.exports = function (grunt) { testrunner.options.log.testing = false; testrunner.options.maxBlockDuration = 120000; + var tests; + + if (grunt.option("only") != null) { + tests = grunt.file.expand.apply(null, grunt.option('only').split(',').map(function (file) { + if (file === 'moment') { + return 'build/umd/test/moment/*.js'; + } else if (file === 'locale') { + return 'build/umd/test/locale/*.js'; + } else { + return 'build/umd/test/' + file + '.js'; + } + })); + } else { + tests = grunt.file.expand('build/umd/test/moment/*.js', + 'build/umd/test/locale/*.js'); + } + testrunner.run({ code: 'build/umd/moment.js', - tests: grunt.file.expand('build/umd/test/moment/*.js', - 'build/umd/test/locale/*.js') + tests: tests }, function (err, report) { if (err) { console.log('woot', err, report);