postmanlabs / newman

Newman is a command-line collection runner for Postman
https://www.postman.com
Apache License 2.0
6.83k stars 1.16k forks source link

Improve error output for failed reporter loading #3126

Open tillig opened 1 year ago

tillig commented 1 year ago
  1. Newman Version (can be found via newman -v): 5.3.2
  2. OS details (type, version, and architecture): node-18:alpine container
  3. Are you using Newman as a library, or via the CLI? CLI
  4. Did you encounter this recently, or has this bug always been there: Always
  5. Expected behaviour: Ability to view errors if a reporter doesn't load.
  6. Command / script used to run Newman: N/A
  7. Sample collection, and auxiliary files (minus the sensitive details): N/A
  8. Screenshots (if applicable): N/A

Right now, the run/index.js has a TODO to output errors encountered during the loading of a reporter. Without this information, problems get hidden, like if you update a reporter's dependency and the dependency doesn't load right. It's not that the reporter isn't found, it's that there was a problem with a transitive dependency.

The TODO indicates perhaps a verbose/debug mode might be a way to tap into this.

I know there's a --verbose option that enables more timings, etc. to be output - would it be OK to also do a console.warn with the full error details if --verbose is specified?

I'd be happy to submit a PR for this if that is a reasonable option, but I won't waste time on it if it's not interesting.