marick

marick

Some testing packages: flow_assertions, ecto_flow_assertions, ecto_test_data_builder

In my ElixirConf talk, I showed two testing packages I wrote, one I didn’t, and one I promised to extract from my code. I’ve finished that last, so here are those packages:

  • flow_assertions: Assertions tailored for use in pipelines. Common assertions extracted for easy reuse. Uses the ExUnit mechanisms to get good failure messages.

  • ecto_flow_assertions: Common Ecto schema and changeset assertions, written to be easily used in pipelines.

  • ecto_test_data_builder: Code that uses Ecto needs to be tested. Such tests need the database to be populated. It pays to write a test data builder for that purpose. This package makes writing that builder easier. Contains an example of using the package to write a test data builder for an animal reservation system.

I also showed @boydm’s phoenix_integration, which I think is useful for more than just integration testing. I wrote up my basis for that claim in Using phoenix_integration for unit tests of templates and rendering

While I’m here, I’ll also mention ex_machina, faker, and mockery. I use them all, and they make me happy.

First Post!

marick

marick

I’ve written up the first part of my ElixirConf talk, which justifies these two libraries. https://marick.gitbook.io/idiosyncratic-elixir/testing-in-general/flowstyle

Where Next?

Popular in Announcing Top

michalmuskala
Hello everybody. I have just released Jason - a new JSON library. You might be wondering, why do we need a new library? The primary foc...
New
wfgilman
I’ve cleaned up and open sourced three financial libraries I was using for my company. They are bindings for the APIs of these three comp...
New
mspanc
I am pleased to announce an initial release of the Membrane Framework - an Elixir-based framework with special focus on processing multim...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
144 10847 141
New
tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: GitHub - tmbb/phoenix_ws: Websockets implemented over Phoenix Ch...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
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

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement