←back to thread

460 points flykespice | 2 comments | | HN request time: 0.447s | source
Show context
laerus ◴[] No.44324825[source]
What's missing from Hurl is snapshot testing. After using `insta` for testing APIs, I cannot go back.
replies(3): >>44324885 #>>44325117 #>>44325279 #
whilenot-dev ◴[] No.44325117[source]
What'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...
replies(2): >>44325237 #>>44327029 #
1. laerus ◴[] No.44325237[source]
Snapshots 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.
replies(1): >>44325621 #
2. adelineJoOs ◴[] No.44325621[source]
> 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!