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

reporter-earl: reporter type is not compatible with axe-core #944

Closed
straker opened this issue Nov 21, 2023 · 1 comment
Closed

reporter-earl: reporter type is not compatible with axe-core #944

straker opened this issue Nov 21, 2023 · 1 comment
Labels
PACKAGE: reporter-earl QA: required This ticket requires QA signoff TYPE: prod bug Bug that was found internally in prod (not affecting customer currently)

Comments

@straker
Copy link
Contributor

straker commented Nov 21, 2023

In TypeScript, trying to assign the reporter to axe.configure fails as the RawResult type that the reporter uses is not the same as the RawResult that axe-core uses.

I was surprised this wasn't caught in a test but then I discovered that the one test where we try to use the reporter assigns it as any so it's never type checked.

import reporter from '@axe-core/reporter-earl';
axe.configure({ reporter });

/*
error TS2322: Type '(rawResults: RawResult[], {}: {}, callback: Function) => void' is not assignable to type 'string | AxeReporter<unknown>'.
  Type '(rawResults: RawResult[], {}: {}, callback: Function) => void' is not assignable to type 'AxeReporter<unknown>'.
    Types of parameters 'rawResults' and 'rawResults' are incompatible.
      Type 'import("/node_modules/axe-core/axe").RawResult[]' is not assignable to type 'RawResult[]'.
        Type 'import("/node_modules/axe-core/axe").RawResult' is not assignable to type 'RawResult'.
          Types of property 'violations' are incompatible.
            Type 'RawNodeResult<"failed">[]' is not assignable to type 'RawNodeResult[]'.
              Property 'node' is missing in type 'RawNodeResult<"failed">' but required in type 'RawNodeResult'.

2 axe.configure({ reporter });
*/
@straker straker added TYPE: prod bug Bug that was found internally in prod (not affecting customer currently) PACKAGE: reporter-earl QA: required This ticket requires QA signoff labels Nov 21, 2023
@straker straker changed the title reporter-earl: reporter is not compatible with axe-core reporter-earl: reporter type is not compatible with axe-core Nov 22, 2023
@straker straker closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2023
@padmavemulapati
Copy link

we have a ticket related to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PACKAGE: reporter-earl QA: required This ticket requires QA signoff TYPE: prod bug Bug that was found internally in prod (not affecting customer currently)
Projects
None yet
Development

No branches or pull requests

2 participants