Writing your tests in EDN files
I've previously written about my latest approach to unit tests (which I have been informed is called "snapshot testing"): [Y]ou define only the input data for your function, and then the expected return value is generated by calling your function. The expected value is saved to an EDN file and checked into source, at which point you ensure the expected value is, in fact, what you expect. Then going forward, the unit test simply checks that what the function returns still matches what’s in the EDN file. If i
评论
?
参与讨论