From 2ba4dca95bbaa176c0b8626488209ee64571fec7 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Tue, 7 Apr 2015 19:19:56 -0700 Subject: [PATCH] Allow tests to be restricted from the command line --- Gruntfile.coffee | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index d04516b10..70f355005 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -6,6 +6,7 @@ ### fs = require 'fs' +util = require 'util' ######################################################################################################################## @@ -103,7 +104,7 @@ module.exports = (grunt)-> './test/test_helper.coffee' ] verbose: true - src: './test/**/*.test.coffee' + src: ['./test/**/*.test.coffee'] rsync: static: @@ -168,3 +169,12 @@ module.exports = (grunt)-> fs.symlinkSync '../../crafting-guide-common/', './node_modules/crafting-guide-common' grunt.registerTask 'test', ['mochaTest'] + + args = process.argv[..] + while args.length > 0 + switch args[0] + when '--grep' + args.shift() + grunt.config.merge mochaTest:options:grep:args[0] + + args.shift()