Skip to content

API for registering custom reporters #2583

@tymfear

Description

@tymfear

@novemberborn , what do you think about creating an API for custom reporters (not only reporters, probably)?
Something like an array of objects in settings, each object implements some set of functions called for each hook.

Like

class Reporter {
  onBeforeStart(t: Context);
  onBeforeEnd(t: Context);

  onBeforeEachStart(t: Context);
  onBeforeEachEnd(t: Context);

  onAssertionFailure(t: Context);
  
  onTestStart(t: Context);
  onTestEnd(t: Context);

  onAfterEachStart(t: Context);
  onAfterEachEnd(t: Context);

  onAfterStart(t: Context);
  onAfterEnd(t: Context);
}

ANd then in config file something like

const customReporter = new Reporter();

export default {
  plugins: [customReporter]
}

That would allow creating different plugins/reporters easily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions