[pa11y-ci] Use pa11y-ci-reporter-html instead of pa11y-reporter-html #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a proposal to help fix twbs@134dc7c based on the understanding I have for the moment of the reporters and the statuses of the several pa11y* projects. Hope it will help, otherwise this PR can be closed.
Links
Summary
According to the pa11y-ci documentation it is possible to do:
Maybe I have missed or don't understand something but I tried it and nothing was generated nor displayed. So I suppose that if it doesn't work there, it is normal that it doesn't work neither with multiple reporters defined as:
So I tried to understand what's going on here.
By adding some logs in node_modules/pa11y-reporter-html/lib/reporter.js, we can see that the HTML code is well generated. But it doesn't create a file containing this HTML code nor displays this HTML code as an output.
We can find another information in https://github.com/pa11y/pa11y-reporter-html that specifies that "The reporter has been merged into pa11y/reporters.".
Tried it and indeed, I was able to do this as well that produced exactly the same non-result:
Note:
node_modules/pa11y/bin/pa11y.js -r html https://example.com
displays the HTML as an output.So let's dive into pa11y/reporters. They all create the content but never really create a file or display themselves their output.
Contrary to the reporter defined in pa11y-ci/reporters. At the end of the json.js, we can see:
IMO, for a reporter to work with pa11y-ci, it must be capable of creating the file.
With all that in mind, I would say we don't have a choice for the moment and should generate a JSON file with
['json', { 'fileName': './pa11y-ci-results.json' }]
and then usepa11y-ci-reporter-html
to generate the HTML file from this JSON file 🤷