@ctietze The Swift version is pretty new, so it's pretty unknown to most folks. I want to get the word out!
If the expected/actual objects are simple values, normal XCTest assertions are the way to go. So when would I use #ApprovalTests? Here are some examples:
- Comparing complex objects (structs, JSON)
- Running the same test with a list of different inputs
- Combinations of multiple inputs
- Any data that is easier to understand (and compare) when visualized instead of just printed out
- Changes in state over time
- Using "data scrubbers" to replace test-unfriendly data like date/time before comparing
Look through the "approved" files in this directory and subdirectories for examples: https://github.com/approvals/ApprovalTests.Swift/tree/master/ApprovalTests_SwiftTests
@qcoding Hi Jon! I know, of course :) I just never saw anyone in my vicinity use these. And since your advice help up really well over the years, I am indeed wondering if I'm missing out on something!
So questions I have to fellow app devs would be:
- when did you figure that they solve a problem you have?
- which kind of tests did you transform into #ApprovalTests? Why these, why not others?
https://github.com/approvals/ApprovalTests.Swift
Is anyone here using #ApprovalTests in #Swift / #Xcode?
I don't quite get it and would like to learn more.
https://github.com/approvals/ApprovalTests.Swift
Is anyone here using #ApprovalTests in #Swift / #Xcode?
I don't quite get it and would like to learn more.
Familiar with #JUnit? You might see some uses for https://touca.io. Know your way around #ApprovalTests? Touca is similar, but with some useful twists.
Watch Pejman Ghorbanzade explain and demonstrate for #jcjug: https://youtu.be/Nn5We6yQ8Kg
Announcing next month’s Jersey City #Java User Group: Emily Bache with a hands-on-code session using #ApprovalTests with #LegacyCode.
#java #approvaltests #legacycode
#codingtour Day 3 at @MATHEMA123 / Redheads:
- Fascinating results giving #MobProgramming head start on Gilded Rose with #ApprovalTests
- Intro to #TDD with MSUnit, designing an API and debugging serial comms to pass
- Walked, ate Schweinebraten, watched Hrvatska
- Passt schon
#codingtour #approvaltests #mobprogramming #tdd