Created
April 18, 2017 14:10
-
-
Save just-boris/41468fac9ac81cbb5debb7eb55b13744 to your computer and use it in GitHub Desktop.
Allure grunt plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = grunt => { | |
const allure = require('allure-commandline'); | |
grunt.registerMultiTask('allure', 'Passes commands to allure-commandline', function() { | |
const done = this.async(); | |
const options = this.options(); | |
const args = []; | |
if(this.target === 'generate') { | |
args.push('generate'); | |
if(options.clean) { | |
args.push('--clean'); | |
} | |
if(options.reportDir) { | |
args.push('--report-dir'); | |
args.push(options.reportDir); | |
} | |
args.push(this.data); | |
} else if(this.target === 'open') { | |
args.push('open'); | |
args.push(options.reportDir); | |
} else { | |
throw new Error('Unknown target:', this.target); | |
} | |
const allureProcess = allure(args); | |
allureProcess.on('exit', done) | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment