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
ExUnitmechanisms 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
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
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








