From ac677e3c430acc9a93f9cda374a26a47c19d1661 Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Wed, 8 Jun 2016 17:31:19 +0200 Subject: [PATCH] improvement: run single test with bash file completion --- Gruntfile.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 831a968934..d3b09ad5e7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -494,6 +494,7 @@ var _ = require('lodash'), // `grunt test:unit/apps_spec.js` will run just the tests inside the apps_spec.js file // // It works for any path relative to the core/test folder. It will also run all the tests in a single directory + // You can also run a test with grunt test:core/test/unit/... to get bash autocompletion // // `grunt test:integration/api` - runs the api integration tests // `grunt test:integration` - runs the integration tests in the root folder and excludes all api & model tests @@ -502,7 +503,9 @@ var _ = require('lodash'), grunt.fail.fatal('No test provided. `grunt test` expects a filename. e.g.: `grunt test:unit/apps_spec.js`. Did you mean `npm test` or `grunt validate`?'); } - test = 'core/test/' + test; + if (!test.match(/core\/test/)) { + test = 'core/test/' + test; + } // CASE: execute folder if (!test.match(/.js/)) {