axe-core
Version:
Accessibility engine for automated Web UI testing
24 lines (22 loc) • 664 B
JavaScript
/*eslint-env node */
;
module.exports = function (grunt) {
grunt.registerMultiTask('update-help',
'Task for updating Deque University helpUrls based on rule JSON files',
function () {
var options = this.options({
version: '1.0.0'
});
var v = options.version.split('.');
v.pop();
var baseUrl = 'https://dequeuniversity.com/rules/axe/' + v.join('.') + '/';
this.files.forEach(function(f) {
f.src.forEach(function (filepath) {
var config = grunt.file.readJSON(filepath);
config.metadata.helpUrl = baseUrl + config.id;
grunt.file.write(filepath, JSON.stringify(config, null, ' '));
});
});
}
);
};