Build/Test Issues

How to accept changes detected by VerifyTests?

Started by MaxRonin on 2,158 views

I'm using VerifyTests (formerly knows as ApprovalTests).

When I have a failure - the .verified and the .received files mismatch - and I run the test manually, my diff tool (WinMerge) opens and shows me the differences correctly.

However, I got no way of accepting that changes in the received file. WinMerge only offers me to copy from verified to received, not the other way round.

I suspect the reason is that the verified file copied into NCrunches workspace is readonly.

But even if that was not the case, copying from received to verified wouldn't help me because it would copy into the verified file in NCrunch's workspace, not into the verfied file in my actual test project.

I tried to use DiffEngineTray (a tool from VerifyTests) and when I say "accept" there, it seems to succeed, but there are no changes to the verified file in my test-project - so I think that confirms my theory from the paragraph above.

Now I don't see any good workflow here - what I'm currently doing is copy the received side from WinMerge and then paste it over the verified file in VS. But, apart from being cumbersome, this has two disadvantages:
a) I cannot easily just accept some of the changes in received
b) pasting into a file in VS changes whitespace (tabs, spaces, maybe because the files are generated code files, I'm working on a source generator) which I then need to manually fix

Am I missing some configuration option here that might help me?

Many thanks,
MR

Edited

Max

Can you try version 18.1.1
Yes, that solves it completely - very cool, thank you!
I just want to add here that Simon saw this problem, implemented a change and released it in a few hours specifically to provide a solution for this.

Thanks Simon.

Post a reply

Log in to reply.