Phoenix comes with a few handy ways to test its components. For example, it has
Phoenix.ControllerTest
module, which helps us make a request that goes through
the application endpoint all the way up to the controller. Phoenix also
generates a ConnCase
module along with the project to better use
Phoenix.ControllerTest
during testing, with a dedicated setup
block.
Useful Terminal Shortcuts
This mini-post contains some key shortcuts to help with terminal navigation.
Git Post-Commit Formatter
Working in languages like Elixir and Rust is fun for many reasons. But one of
my favorite features is the formatter. Elixir (after 1.4) comes with a
formatter which is well integrated with mix
and can be called using
mix format
. At first, the idea of a machine changing the code that I wrote
for my project didn’t sound very exciting to me. But working in a team
environment and being able to configure the formatter based on what best
practices a project follows, made it all worth it. Moreover, the ability to
run it (mix format --check-formatted
or cargo fmt --check
) as part of the
CI to see if any new code is formatted, was a great added bonus.