Description
Product: CLI
Expectation:
When I use the CLI with the -r
option to specify which rules to run, and provide an invalid rule ID, I’d expect the CLI to exit early with a relevant error message.
Actual:
When providing an invalid rule ID, the CLI takes much longer to report a failure, and the failure message is a very generic "An error occurred while testing this page.".
Motivation:
Here’s a comparison of three scenarios:
# Takes 2-3s to run, returns results for all rules as expected.
time axe https://www.example.com/
# Takes about the same time to run, returns results for just the one rule.
time axe -r html-lang-valid https://www.example.com/
# With an invalid rule name, this takes 22s to run:
time axe -r html-valid-lang https://www.example.com/
I imagine there is a 20s timeout here. It feels unexpected to me that the CLI (or Axe core itself?) would have to wait for such a timeout when it’s not provided with any valid rules to run. Even if there was no early validation of the rule IDs provided, when the CLI runs, it should fail right away, with either a generic "there are no rules to run" or specific "invalid rule ID".
axe-core version: 4.4.3
@axe-core/cli: 4.4.4
- Node version: v16.16.0
- Platform: Mac