Module usage doesn't appear to work with localhost
Using a localhost address in https://github.com/cfpb/node-wcag#module-usage always passes and returns an empty array for errors and potentialProblems.
AChecker will not check localhost. The workaround is using localtunnel. Localtunnel however is only triggered in cli.js. We'll need to move this into index.js.
@zrrrzzt Do we want to bake localtunnel into this module? I kind of feel like it defeats the 'do one thing and only one thing' principle.
If you're testing localhost you can import localtunnel on your own:
var localtunnel = require('localtunnel');
localtunnel(port, function(err, tunnel) {
wcag({uri: tunnel.url, id: 'xxxxxxxx'}, function(err, resp) {
...
});
});
We should add better error handling, though, instead of returning no errors.
I do agree @contolini. Moving localtunnel into index seemed like a good idea for a few seconds. We should consider having an example like the one you just gave in the README