Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where do you set the options? #5

Closed
martinwrightgithub opened this issue Jun 12, 2015 · 2 comments
Closed

Where do you set the options? #5

martinwrightgithub opened this issue Jun 12, 2015 · 2 comments

Comments

@martinwrightgithub
Copy link

I want to set the options to only output WCAG2AA errors using the CLI. But I didn't understand from your documentation which file I set these?

options: {
    accessibilityLevel: 'WCAG2A'
  }
options: {
    reportLevels: {
      notice: true,
      warning: true,
      error: true
    }
  }

Kind Regards, Martin

@yargalot
Copy link
Owner

Hey mate, the options get set through the command line, so it would be sniff test/**/*.html -r json -l reports, it wont refer to a file unless you have a .accessibilityrc file (I think, it should pick it up automatically depending on if you run it from the same folder)

I could make an option for the cli to reference a file directly if you pass the flag, something like sniff test/**/*.html -optionFile .accessibilityrc or something like that?

@martinwrightgithub
Copy link
Author

I couldn't get it to pick up and my .accessibilityrc no matter where I put it.

What I did in the end was to install the access-sniff package locally then create a javascript file called wcag-test.js so I could set the options there. I then ran nodejs wcag-test.js to do my test. That seemed to work quite well.

var accessSniff = require('access-sniff');
var files = [

  'http://www.exampleurl.com/page1.html',
  'http://www.exampleurl.com/page2.html'
            ];
var options = { accessibilityLevel: 'WCAG2AA', reportType: 'json', reportLevels: {
  notice: false,
  warning: false,
  error: true
} };

accessSniff.start(files, options);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants