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

link to string diff in test report if assertEquals of string fails #1070

Closed
drummer3333 opened this issue Oct 2, 2020 · 7 comments
Closed
Milestone

Comments

@drummer3333
Copy link

if assertEquals or similar fails the output of the test is somthing like:

org.junit.ComparisonFailure: expected:<1[
expected
]> but was:<1[
value
]>

A few of our tests export format a structure as a structured String and test this equal to a predefined String. So any diffence in structure can be seen in the Testresults.
I'm comming from Eclipse and there you get a nice diff view for such Failed Tests which makes it ease to see the failures.

Please add a link in the Test View so expected and value can be open in the standrard VSCode Diff View.

@jdneo
Copy link
Member

jdneo commented Oct 9, 2020

Hi @drummer3333, do you mean something like the SCM diff view?

@drummer3333
Copy link
Author

Yes, like that.

@maroony
Copy link

maroony commented Apr 14, 2021

I really miss this feature, too! In the meantime I'm using the extension "Partial Diff" and Copy&Paste the result and than do the diff.

@jdneo
Copy link
Member

jdneo commented Apr 14, 2021

VS Code now is designing a new set of testing API, and having the capability to show this diff view. See the point 3 in this comment: microsoft/vscode#107467 (comment)

So far, from my understanding, different assertion libs have their own format to show expected-actual message. Then I need to parse them according to the format and filling the related fields.

@jdneo jdneo added this to the 0.31.0 milestone Aug 5, 2021
@jdneo
Copy link
Member

jdneo commented Aug 6, 2021

Finally it comes in 0.31.0 with the integration of the new VS Code testing API!

image

@ocallesp
Copy link
Member

ocallesp commented Sep 9, 2024

@jdneo can you point me to the new api (documentation) that shows the diff ? It is not clear for me what is the new api.

@jdneo
Copy link
Member

jdneo commented Sep 10, 2024

If you are looking for the vscode extension api for testing, you can find it here: https://github.com/microsoft/vscode/blob/d8af24e15daeb1ad5bd0ee4858852e60ea545c66/src/vscode-dts/vscode.d.ts#L18193

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

No branches or pull requests

4 participants