5 ms·
What's missing from Hurl is snapshot testing. After using `insta` for testing APIs, I cannot go back.
by laerus 1y ago
What's missing from Hurl is snapshot testing. After using `insta` for testing APIs, I cannot go back.
- porker 1y agoIs this https://insta.rs/ https://insta.rs/? What are the benefits you've found with snapshot testing?
- laerus 1y agoGreatly reduced boilerplate. Diffing snapshots and providing previews to accept or reject changes is also more robust and user friendly.
- whilenot-dev 1y agoWhat's your value proposition for snapshots and why can't that already be fulfilled with full body checks? https://github.com/Orange-OpenSource/hurl?tab=readme-ov-file#checking-full-body https://github.com/Orange-OpenSource/hurl?tab=readme-ov-file...
- laerus 1y agoSnapshots diff current with previous output and I only have to accept or reject the diff. I don't have to write the expected response myself. Snapshots can also stub out parts of the response that are not determistic.
- adelineJoOs 1y ago> Snapshots can also stub out parts of the response that are not determistic. TIL! The way I knew to do it was to have a mock implementation that behaved like the real thing, expect for data/time/uuids/..., where there was just a placeholder. Snapshot tests being able to "mask" those non-deterministic parts sounds cool!
- adelineJoOs 1y agotbh, that seems pretty close to what I would call snapshot testing already. What people usually do with it is using it for more broadly compared to API testing (for example, I currently use it to test snapshots of a TUI application I am developing) - i.e. you can use it whenever your test is of the form "I have something that I can print in some way and that should look the same until I explicitely want it to look differently in the future". There are a bit more bells and wizzles - For example, it is nice that one does not have to write the initial snapshots oneself. You write the test, execute, it creates the resulting file, then you review and commit that - handy little workflow!
- CommonGuy 1y agoWe are working on snapshot testing for Kreya, expected to come in August. You might want to check it out :)