Skip to content

[Feature]: Report beginning of everydescribe (suite) via reporter API #15735

@DmitryMakhnev

Description

@DmitryMakhnev

🚀 Feature Proposal

Now Reporter API reports beginning and the result of every test or it, but there are no events for beginning or the result of each describe (suite).

Motivation

Reporting the beginning of each describe would allow external tools (like IDEs) to provide more fine-grained support for test trees. For example, it would allow to attach suite output (e.g. produced by console.log) properly to suite nodes. Right now, we don’t have any distinction in output between different suite nodes. We apply some heuristics, but they don’t work well in certain cases.

In particular, it would allow to fix https://youtrack.jetbrains.com/issue/WEB-43974.

For example, for code:

describe('TaskMatchService', () => {
  console.log('TaskMatchService suite started');

  describe('cancelRequest', () => {
    console.log('cancelRequest suite started');

    it('test', async () => {
      console.log('test starting');
      await Promise.resolve();
    })
  })
})

Currently, it’s impossible to correctly bind the outputs TaskMatchService and cancelRequest to their corresponding nodes:
Image

Example

No response

Pitch

Looks like some changes in jest-circus and jest-reporter are needed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions