diff --git a/Gruntfile.js b/Gruntfile.js index dafb8fc..f776236 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,10 +9,28 @@ module.exports = function (grunt) { } }, cucumberjs: { - files: 'features', - options: { - steps: 'features/step_definitions', - format: 'pretty' + test1: { + files: 'features', + options: { + steps: 'features/step_definitions', + format: 'pretty' + } + }, + test2: { + files: 'features', + options: { + steps: 'features/step_definitions', + format: 'pretty', + tags: '@tag' + } + }, + test3: { + files: 'features', + options: { + steps: 'features/step_definitions', + format: 'pretty', + tags: ['~@wip', '@tag'] + } } } }); @@ -21,5 +39,7 @@ module.exports = function (grunt) { grunt.loadTasks('tasks'); - grunt.registerTask('default', ['jshint', 'cucumberjs']); + grunt.registerTask('default', ['jshint', 'cucumberjs:test1']); + + grunt.registerTask('tag-tests', ['cucumberjs:test2', 'cucumberjs:test3']) }; diff --git a/README.md b/README.md index c0b0691..4c505ba 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,9 @@ this represents boolean NOT. Example: by a comma, which represents logical OR. Example: `tags: '@dev,@wip'` -To represent a logcal AND, use an array. +To represent a logical AND, use an array. This is useful if you want to skip certain features -and run other specific (tagged) features. Example: +and run other specific features. Example: `tags: ['~@wip', '@dev']` #### format diff --git a/tasks/cucumber-js-task.js b/tasks/cucumber-js-task.js index 28ac904..d36e4c9 100644 --- a/tasks/cucumber-js-task.js +++ b/tasks/cucumber-js-task.js @@ -53,7 +53,7 @@ module.exports = function (grunt) { } if (! _.isEmpty(tags)) { - if (typeof tags == "string") { + if (typeof tags === "string") { tags = [tags]; } for (var i=0; i < tags.length; i++) {