mr_smith
What is a good workflow for doing TDD with Elixir?
Hello there.
I’m wondering if people have any tips for doing TDD with Elixir.
I am specifically wondering if it is possible to configure mix test to only show which tests failed. I find the output to be very noisy (lots of warnings, also shows skipped tests, etc.).
Note that I am accustomed to JavaScript’s Vitest test runner which comes with a TUI that puts test results at the top of the window so you don’t have to search for it. See screenshot at top of https://vitest.dev/
Wonder if there is something similar for Elixir / mix test.
Marked As Solved
frankdugan3
Both of these are good options, the first being closer to what you described:
Also Liked
jdiago
Nothing fancy. When working on a file, mix test that/file_test.exs. Only run mix test once I’ve reached a good stopping point.
If I’m looking at a specific failure, mix test that/file_test.exs:5.
When I’m using vim, I dynamically map a leader key to write the current file and run a test. If I’m on vs code or zed, I use the integrated terminal because they recognize the FILE:LINE format to quickly open test locations or stack traces.
edit:
options like --no-all-warnings , --failed and more can be found here:
Popular in Questions
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
- #code-sync
- #javascript
- #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








