3 ms·
Table driven tests are a lot better than a bunch of imperative tests but they rapidly become unwieldy to debug, maintain, and evolve. Their readability often is
by vvern 3y ago
Table driven tests are a lot better than a bunch of imperative tests but they rapidly become unwieldy to debug, maintain, and evolve. Their readability often isn’t great.
If you’re using go, check out https://github.com/cockroachdb/datadriven https://github.com/cockroachdb/datadriven. It takes a little bit of effort to craft a testing dsl, but it is so worth it.
Also, snapshot style testing where the test writes out its expectations and you just inspect it and save it (part of datadriven) is wonderful.
I’ve been using insta in rust lately and it’s some of what I want but not quite datadriven.
- malablaster 3y agoI also can’t stand when I want to debug a single table test with VSCode debugger+dlv and I have to comment out hundreds of lines of table tests.