You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When launching pa11y from the command line with an invalid runner as an argument, pa11y crashes instead of returning a helpful error message.
$ pa11y --runner potato https://www.nature.com
Welcome to Pa11y
> Running Pa11y on URL https://www.nature.com
(node:4782) UnhandledPromiseRejectionWarning: Error: Cannot find module 'potato'
Require stack:
- /Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js
- /Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/bin/pa11y.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at loadRunnerFile (/Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js:445:9)
at loadRunnerScript (/Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js:474:23)
at injectRunners (/Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js:330:39)
at runPa11yTest (/Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js:124:8)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async pa11y (/Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js:39:18)
(node:4782) 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:4782) [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:4782) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
Error: Cannot find module 'potato'
Require stack:
- /Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js
- /Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/bin/pa11y.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at loadRunnerFile (/Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js:445:9)
at loadRunnerScript (/Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js:474:23)
at injectRunners (/Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js:330:39)
at runPa11yTest (/Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js:124:8)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async pa11y (/Users/jose.bolos/.nvm/versions/node/v12.18.3/lib/node_modules/pa11y/lib/pa11y.js:39:18)
Expected behaviour
Pa11y should validate all arguments and return a helpful error message if the arguments are invalid before attempting to do anything else.
When launching pa11y from the command line with an invalid runner as an argument, pa11y crashes instead of returning a helpful error message.
Expected behaviour
Pa11y should validate all arguments and return a helpful error message if the arguments are invalid before attempting to do anything else.
Actual behaviour
Crash + stack.
Steps to reproduce
npm install pa11y@next
pa11y --runner potato https://www.nature.com
Environment
The text was updated successfully, but these errors were encountered: