Closed TimothyMakkison closed 11 months ago
You are on fire :fire: I've never worked with snapshot tests before, what's the workflow like when these are added? If we make a change to the generated output (that we want), how do you update the snapshots?
I've never worked with snapshot tests before, what's the workflow like when these are added? If we make a change to the generated output (that we want), how do you update the snapshots?
Verify will compare the generated files to the equivalent verified.cs
file in the _snapshots
folder. Any differences will result in the test failing and causes a difftool to run. Accepting or rejecting the changes has the workflow same as using git. In my case a new window pops up using either the VSCode or Rider difftool.
Try chaging Mediator.sbn-cs
and running the tests to see how it works on your machine.
what's the workflow like when these are added?
Imo it makes playing around with code generation a lot easier 😄. I've used this in a separate branch to remove unneeded blank space. I personally check the difftool and the use an extension to accept all changes.
I considered combining this with the SamplesTests
WDYT?
Finally tested this out, yep I love it, really useful and simple to use aswell. Thanks! :pray:
I considered combining this with the SamplesTests WDYT?
Yes I think thats a good idea, so that when we add new samples we get both snapshot testing and diagnostics checking in one go.
I'll merge this for now, but feel free follow up with that if you have the time
Added snapshot tests to detect changes in logic and formatting.