Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: report beginning of every test or it via reporter API #13112

Closed
segrey opened this issue Aug 10, 2022 · 6 comments 路 Fixed by #14174
Closed

[Feature]: report beginning of every test or it via reporter API #13112

segrey opened this issue Aug 10, 2022 · 6 comments 路 Fixed by #14174

Comments

@segrey
Copy link

segrey commented Aug 10, 2022

馃殌 Feature Proposal

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

Related discussion in #6616

Motivation

Reporting the beginning of each test/it would allow external tools (like IDEs) to provide more fine-grained support for test trees. For example, it would allow to attach test output (e.g. produced by console.log) properly to test nodes. Right now all the output wrongly goes to an ancestor node corresponing to the test file containing test/it.
In particular, it would allow to fix https://youtrack.jetbrains.com/issue/WEB-53839.

For example, here is how it looks when running with jest@28 the following test file

it('foo', function () {
    console.log('foo');
});
it('bar', function () {
    console.log('bar');
});

when foo or bar test nodes are selected, no output is shown:
wrong2

Here is how it's expected to work (captured with jest@27 and "testRunner": "jasmine2"):
right

Example

No response

Pitch

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

@segrey
Copy link
Author

segrey commented Aug 10, 2022

@SimenB What do you think?

@github-actions
Copy link

github-actions bot commented Sep 9, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Sep 9, 2022
@Ariane-B
Copy link

Ariane-B commented Sep 9, 2022

Bad robot.

@github-actions github-actions bot removed the Stale label Sep 9, 2022
@SimenB SimenB added the Pinned label Sep 9, 2022
@SimenB
Copy link
Member

SimenB commented Sep 9, 2022

Happy to take a PR adding this! 馃檪

@DmitryMakhnev
Copy link
Contributor

DmitryMakhnev commented May 31, 2023

Hey @SimenB,

I have made a pull request to implement this feature request. Could you please suggest who I should ask for a review?

Thanks 馃檹

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants