dreamzmaster / gulp-pa11y

Audit accessibility of your site using Gulp
GNU General Public License v2.0
11 stars 4 forks source link

Question: passing config options #2

Closed brianhewitt closed 8 years ago

brianhewitt commented 8 years ago

How do you pass the configuration options to the gulp task (or specify the location of the configuration json file)? Would you mind providing an example task with the required url config?

I can run a task successfully with the following, but I get no output results in the console (whereas if I run pa11y via command line for the same url, I DO get results).

gulp.task('pa11y', function() {
    pa11y({ url: 'http://whatever.url'});
}):
dreamzmaster commented 8 years ago

you need to add reporter, the format where you want the output. You can refer to gulpfile.js in the root folder.

Reporter options: -r, --reporter <reporter> the reporter to use: cli (default), csv, html, json

brianhewitt commented 8 years ago

That doesn't seem to make any difference. If I run:

gulp.task('pa11y', function(){
    pa11y({
        url:'http://whatever.url,
        reporter: 'cli'
    });
});

I still get no output. No output if I specify csv, html, or json as a reporter either. Is that the right way to pass options to the task, with an object?

I don't get any errors, but are there any dependencies (like gulp-phantom or something)? I have phantomjs installed globally via npm.

dreamzmaster commented 8 years ago

It should be:

gulp.task('build', pa11y({
    url: 'http://www.google.com',
    reporter: 'console'
}));

You need to remove gulp.task('pa11y', function(){

Hope this helps.

julianpinedayyz commented 8 years ago

@dreamzmaster That solves the mystery. Thank you Sir. Should this be closed and maybe added to the documentation?

Thanks!

cjduncana commented 8 years ago

Could you please update the README.md to reflect this?