Anatomy of a Test 0 ▲ Jonathan's Blog 1 day ago · 16 min read3281 words · Tech · hide · 0 comments Sometimes when talking about testing, I think we have a tendency to resort to broad ideas and jargon without sufficiently explaining what these things might look like in practice. Or worse, we do provide examples, but these are toy examples that look nothing like our real life code, and thus give weird impressions of what tests should actually look like. To try and counteract this a bit, let’s look at a test case that I wrote recently, and I’ll try and break it down and explain why I wrote it the way I did. This is a fairly arbitrary test from a side project I’ve been playing around with recently, so I’m not expecting it to hold up perfectly here, but hopefully it’ll be interesting enough to talk about. This is a test for the file src/bookmarker/store.gleam. Some context: the project is a bookmark app written in Gleam, where I can send a link to the app and it’ll asynchronously scrape the details of the link, automatically tag it, index the content for later full text search, archive… No comments yet. Log in to reply on the Fediverse. Comments will appear here.