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

[WIP] Expand use of requireFirst to runners #530

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kkoskelin
Copy link
Contributor

@kkoskelin kkoskelin commented Aug 22, 2020

... if runner is not found

also, package updates.

Addresses #529, in part, dealing with "bad runner" scenario. broader CLI validation still needed.

@kkoskelin
Copy link
Contributor Author

Output is now:

$ node pa11y.js --runner potato https://www.nature.com

Welcome to Pa11y

 > Running Pa11y on URL https://www.nature.com
(node:13129) UnhandledPromiseRejectionWarning: Error: Runner module not found: potato
    at loadRunnerFile (/Users/kkoskelin/projects/pa11y/lib/pa11y.js:466:9)
    at loadRunnerScript (/Users/kkoskelin/projects/pa11y/lib/pa11y.js:497:23)
    at injectRunners (/Users/kkoskelin/projects/pa11y/lib/pa11y.js:350:39)
    at runPa11yTest (/Users/kkoskelin/projects/pa11y/lib/pa11y.js:144:8)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async pa11y (/Users/kkoskelin/projects/pa11y/lib/pa11y.js:39:18)
    at async runProgram (/Users/kkoskelin/projects/pa11y/bin/pa11y.js:133:19)
(node:13129) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13129) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:13129) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)

Error: Runner module not found: potato
    at loadRunnerFile (/Users/kkoskelin/projects/pa11y/lib/pa11y.js:466:9)
    at loadRunnerScript (/Users/kkoskelin/projects/pa11y/lib/pa11y.js:497:23)
    at injectRunners (/Users/kkoskelin/projects/pa11y/lib/pa11y.js:350:39)
    at runPa11yTest (/Users/kkoskelin/projects/pa11y/lib/pa11y.js:144:8)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async pa11y (/Users/kkoskelin/projects/pa11y/lib/pa11y.js:39:18)
    at async runProgram (/Users/kkoskelin/projects/pa11y/bin/pa11y.js:133:19)

Unless you would want me to export the loadRunnerFile from lib/pa11y.js to bin/pa11y.js so that we can attempt to import it there for purposes of verification, only to drop it on the floor and allow it to be required a second time by lib/pa11y.js?

@kkoskelin kkoskelin marked this pull request as draft August 23, 2020 01:51
Copy link
Member

@joeyciechanowicz joeyciechanowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all seems very sensible, nice one!

@danyalaytekin danyalaytekin changed the title 529: refactor to use "requireFirst" and throw helpful messages [WIP] Expand use of requireFirst to runners Mar 21, 2024
@danyalaytekin danyalaytekin added this to the 8.x milestone Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants