• brian
    link
    fedilink
    arrow-up
    1
    ·
    8 days ago

    I’m not sure if I understand why. I like snapshot testing, but I’m not sure what you gain from using this dsl approach instead of a snapshot library and a more typical test framework, but there are some notable downsides:

    • you have to write typical tests in a different place from your snapshot tests. some things are more complex than “this value never changes”, you might just care about a property holding, it produces the same value for several different inputs, etc. properly capturing a big for a regression test is more than a snapshot
    • you lose editor tooling, I can’t just send tests to the repl from my editor, I don’t have autocomplete, etc
    • need edn serializers for all values you care about. seems easy enough to return a host language object without a proper representation
    • may just be me but I’m not a fan of the added levels of nesting