pa11y / pa11y-ci

Pa11y CI is a CI-centric accessibility test runner, built using Pa11y
https://pa11y.org
GNU Lesser General Public License v3.0
525 stars 63 forks source link

TypeError while printing out accessibility violations #50

Closed adams0619 closed 6 years ago

adams0619 commented 6 years ago

Since upgrading to the latest 2.0.0 release of pa11y-ci I get the following error whenever pa11y-ci is run using a standard other than WCAG2AA (the default). While pa11y-ci runs through the tests just fine, the issue seems to come from one of the dependencies when printing out errors from the test run as seen below.

Note: This errors does not seem to occur when I run the regular non-ci centric pa11y

Environment:

Pa11y:      5.0.3
Node.js:    8.9.4
npm:        5.6.0
OS:         16.7.0 (darwin)
> pa11y-ci -V
2.0.0

Error: --

> pa11y-ci --config tests/pa11y/pa11y.json

Running Pa11y on 1 URLs:
 > http://localhost:9090/services - 2 errors

Errors in http://localhost:9090/services:

 • The heading structure is not logically nested. This h2 element appears to be the primary document heading, so should be an h1 element.

   (#burger-menu-container > div:nth-child(2) > ul > div > h2)

   <h2><a href="javascript:void();">Pr...</h2>

/Users/macbookpro/work/project-tr12/node_modules/pa11y-ci/node_modules/async/asyncify.js:108
    throw error;
    ^

TypeError: Cannot read property 'replace' of null
    at report.results.(anonymous function).forEach.result (/Users/macbookpro/work/project-tr12/node_modules/pa11y-ci/lib/pa11y-ci.js:136:40)
    at Array.forEach (native)
    at Object.keys.forEach.url (/Users/macbookpro/work/project-tr12/node_modules/pa11y-ci/lib/pa11y-ci.js:125:27)
    at Array.forEach (native)
    at Object.testRunComplete [as drain] (/Users/macbookpro/work/project-tr12/node_modules/pa11y-ci/lib/pa11y-ci.js:122:33)
    at /Users/macbookpro/work/project-tr12/node_modules/pa11y-ci/node_modules/async/internal/queue.js:113:19
    at /Users/macbookpro/work/project-tr12/node_modules/pa11y-ci/node_modules/async/internal/onlyOnce.js:12:16
    at invokeCallback (/Users/macbookpro/work/project-tr12/node_modules/pa11y-ci/node_modules/async/asyncify.js:101:9)
    at /Users/macbookpro/work/project-tr12/node_modules/pa11y-ci/node_modules/async/asyncify.js:89:17
    at process._tickCallback (internal/process/next_tick.js:109:7)
rowanmanning commented 6 years ago

Hmm, that's not great. Taking a look now :)

rowanmanning commented 6 years ago

Hey @adams0619. I think this should be fixed, I just released version 2.0.1. Could you try it out and confirm, please?

adams0619 commented 6 years ago

@rowanmanning Just updated and it's fixed. Thank you so much for looking at this and for the awesome testing library.

rowanmanning commented 6 years ago

No worries :) glad to help