-
Notifications
You must be signed in to change notification settings - Fork 792
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
raw reporter shouldn't output DqElements #1195
Comments
Note: |
@WilcoFiers - I was unable to find any DqElement in the raw report, so I could run a |
We just hit this issue during development of https://github.com/Microsoft/axe-sarif-converter - the problematic elements are at JSON paths along the lines of One option for a low-churn fix that we tried out successfully would be updating the raw reporter to output |
@WilcoFiers so, the test at https://github.com/dequelabs/axe-core/blame/320e63380189f507a32c99fd19619f3c6a161764/test/core/utils/dq-element.js#L35 is not a valid test for your case? That may defeat the purpose of the |
This patch updates our "raw" reporter, ensuring it does not pass `DqElement`s to its callback. Instead, it serializes the `DqElement` by using the `DqElement#toJSON()` method. Unfortunately many of our tests pass non-results to the reporters, so several "guards" were added to the reporter ensuring we don't error while attempting to transform the provided results. In an ideal world, these tests would be rewritten to pass "proper" result objects to our reporters, but this felt out-of-scope for the task at hand. Closes #1195
This patch updates our "raw" reporter, ensuring it does not pass `DqElement`s to its callback. Instead, it serializes the `DqElement` by using the `DqElement#toJSON()` method. Unfortunately many of our tests pass non-results to the reporters, so several "guards" were added to the reporter ensuring we don't error while attempting to transform the provided results. In an ideal world, these tests would be rewritten to pass "proper" result objects to our reporters, but this felt out-of-scope for the task at hand. Closes #1195
While working on a new reporter I tried to run
JSON.stringify()
on the results of theraw
reporter. Turns out that this is outputting DqElements, which can't be stringified after completing a run. Because the selectors are lazily constructed, and in order to construct themaxe._selectorData
is required, they can't be constructed after cleanup ofaxe._selectorData
. To fix this we need to change theraw
reporter to not output DqElement objects.The text was updated successfully, but these errors were encountered: