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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose more data in reporters for IDE integrations #8840

Open
SimenB opened this issue Aug 16, 2019 · 7 comments
Open

Expose more data in reporters for IDE integrations #8840

SimenB opened this issue Aug 16, 2019 · 7 comments

Comments

@SimenB
Copy link
Member

SimenB commented Aug 16, 2019

@SimenB Great! Regarding benefits of using Jasmine reporter, I don't have a complete list unfortunately.
Some of them I could recall:

  • An implication of sending events about describe/test/it: it allows to attach output to correct node in a test tree, and, when debugging, you can see live output of console.log/process.stdout.write.
  • Failed assertions provide separate compact error messages and error stacks whereas Jest reporter provides a single merged error message+stack making it's hard to show a compact error message for a failed element in the editor. It'd be great to provide separate values: expected/actual/message/stack.

Originally posted by @segrey in #8118 (comment)

@segrey segrey mentioned this issue Jan 25, 2020
6 tasks
@G-Rath
Copy link
Contributor

G-Rath commented Jan 25, 2020

@SimenB I'm keen to scope out what this'll take implementation-wise, if you've got some time :)

@SimenB
Copy link
Member Author

SimenB commented Jan 27, 2020

That's wonderful @G-Rath, thank you!

An implication of sending events about describe/test/it: it allows to attach output to correct node in a test tree, and, when debugging, you can see live output of console.log/process.stdout.write.

This is essentially #6616, so if you wanna work on that, I'd start by taking a look at #9001 and break it up into smaller parts we can land separately.

@rogeliog has already listed the 4 things it does in the OP - I'd break them all out into separate PRs. I'd personally do it in the order 2, 1, 3, 4 since they all build upon one another. 2 and 1 are not dependent on one another, but 3 and 4 depend on both of them, and 2 is the change I think will be easiest to land. Happy to discuss these further if you want (feel free to open separate issues, or just fork #9001, rip out the parts you don't need, and open up a PR with that for discussion).

Failed assertions provide separate compact error messages and error stacks whereas Jest reporter provides a single merged error message+stack making it's hard to show a compact error message for a failed element in the editor. It'd be great to provide separate values: expected/actual/message/stack.

This should be way easier so I recommend tackling this first - it's "just" exposing more data on the AssertionResult object: https://github.com/facebook/jest/blob/084508290f4a90b28c3190021d3358ab1f753c3f/packages/jest-test-result/src/types.ts#L60-L70

failureMessages is an array of strings here, we should probably add something more structured (while avoiding a breaking change, so we need a new property)

@G-Rath
Copy link
Contributor

G-Rath commented Jan 30, 2020

@SimenB thanks for that amazing detailing - that's perfect for me to begin actioning.

I'll definitely start with adding the new property on AssertionResult, and then look to break up that PR.

@SimenB
Copy link
Member Author

SimenB commented Jul 30, 2020

@sauravhiremath @kunal-kushwaha you can probably do the first part of this at the same time as MLH-Fellowship#32 etc

@vitalii7777
Copy link

vitalii7777 commented Feb 15, 2022

@SimenB @G-Rath

WebStorm

Still have not found logs (console logs or console warns) that belong to it or test blocks (only failure messages works well). All logs are gathered to one long list and belong only to describe block.

At the same time logs works perfectly with jest-jasmine2

@SimenB
Copy link
Member Author

SimenB commented Feb 15, 2022

Happy to take PRs

@vitalii7777
Copy link

Happy to take PRs

@SimenB Great news! Let us know about the progress. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants