DCzajkowski

DCzajkowski

Hello everyone!

I have created a simple library for creating snapshot-tests :camera_with_flash:
Please let me know what you think :wink:

The repository is available here.
If you are curious what snapshot testing is, you can check a simple explanation here.
If you want to see how it’s used, here is a project I am using it in (it’s a college-work, so nothing too serious) here.

Have a nice day everyone :sun:
Darek

Showing Posts 1 to 3

OvermindDL1

OvermindDL1

This looks interesting. :slight_smile:

Careful! There can only be one match_snapshot call per test macro call.

Why is this?


How does it compare to other libraries like AssertValue or so?

DCzajkowski

DCzajkowski OP

This is because the name of the file is created from the test name. Adding support for multiple calls is absolutely the next step!

I was not aware of AssertValue. It looks really cool, to be honest. The difference I can see is that the assertion value is stored in the test itself, not in a separate file. It has its benefits and drawbacks. Another difference would be that AssertValue is interactive, whereas Snapshy is not. It’s not a good/bad thing, but a difference for sure.

I will explore AssertValue more. Thanks for sharing!

OvermindDL1

OvermindDL1

It can also be stored in a separate file with AssertValue, that’s just not the default method so as to make it obvious when looking at the test what value it should be, so it’s generally only recommended to use it for super larger values. :slight_smile:

This is also optional. If interactivity is disabled (great for CI runners, via the environment) then on conflicts it reports and fails like a normal failing test.

Don’t stop yours though, there’s a lot of unexplored test-related space still! :slight_smile:

— All posts loaded —

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews