runner icon indicating copy to clipboard operation
runner copied to clipboard

New API for `configure.reporters` and `--reporters` argument

Open Julien-R44 opened this issue 2 years ago • 0 comments

Linked to #23

Refactor

  • Moved what is related to CLI parsing into its own file
  • Moved what is related to configuration and configuration normalization to its own file

What has been added

  • a --reporters arguments
  • New API for configure.reporters property, but backward compatible. the configure.reporters.defaults property is typesafe and and based on what configure.reporters.list contains.

To keep the API retro-compatible, but also to keep the code simple, I made some functions to "normalize" the configuration. So even if the old API is used, then this function will convert that into the same format as the new one. ( with the defaults and list properties. )

If the old API is used, then all reporters are activated by default

The --reporters flag overrides the reporters.defaults property

To merge this PR it will be necessary in priority to merge this one: https://github.com/japa/core/pull/65 Then update @japa/core

Let me know if anything seems unclear or if anything needs to be changed

Julien-R44 avatar Sep 10 '22 19:09 Julien-R44