nicoburns / blessed-rs

A community guide to the Rust ecosystem
https://blessed.rs
1.17k stars 66 forks source link

Mention the `insta` snapshot testing library #112

Closed ilyagr closed 3 months ago

ilyagr commented 3 months ago

I believe this is one that everybody should know about.

djc commented 3 months ago

At 1.1M recent downloads, I agree that this library merits a mention. I'm not sure "Golden testing" is an obvious way to describe it, though?

epage commented 3 months ago

I nomally see this style of testing called "golden state" or "snapshot" testing. I prefer the latter term.

Other libs in this area are expect test (on mobile and don't remember how they join the words) and snapbox. I say this for completenes and not to say one should be picked over another.

djc commented 3 months ago

expect-test has 918k recent downloads, so maybe if we mention insta we should mention it, too?

snapbox has 180k recent downloads, so it's definitely in a different league.

epage commented 3 months ago

expect-test mentions k9 but that only has 247k, downloads. expect-test makes it sound like it includes other things as well, so no idea how that might affect things.

Though snapbox is low on download counts, it is slightly different in that it targets snapshot testing of Command and Path. Again, not saying it should be listed but just including all relevant information.

ilyagr commented 3 months ago

Thanks! I haven't heard of expect-test, but I find insta with its inline snapshots very pleasant. For example, all the diffs in the tests (all but one file) in https://github.com/martinvonz/jj/commit/5e407982b19793a7e240b2010e837e3b148a973f were auto-generated by cargo insta accept.