Using IO.puts and IO.inspect in ExUnit tests

By default in the test env, Phoenix doesn't show IO.puts/IO.inspect outputs in the console.

Debugging without access to these two functions may be a pain in the neck. Fortunately, there is a simple solution, you can apply in just a few seconds.

Go to your config/test.exs file and you'll probably see:

# Print only warnings and errors during test
config :logger, level: :warn

The only thing you have to do is change it to:

config :logger,
  backends: [:console],
  compile_time_purge_level: :debug

After your work, I would recommend you to revert changes.

A girl receiving new message

Sign to our Newsletter

We're committed to your privacy. Curiosum uses the information you provide to us to contact you about our relevant content. You may unsubscribe from these communications at any time. For more information, check out our privacy policy.

Oskar Legner
Oskar Legner

Read more
on #curiosum blog

Phoenix LiveView Tutorial: Adding Phoenix PubSub and Pow Authentication to Messenger
  • Elixir

Phoenix LiveView Tutorial: Adding Phoenix PubSub and Pow Authentication to Messenger

We've already bootstrapped our Phoenix LiveView-based Messenger app's database structure and a first LiveView page.

This time, we're going to improve real-time communication between the app's users using Phoenix PubSub, and use the Pow library to add secure user authentication.

As of November 2020, the latest Phoenix LiveView version is 0.14.8 - and the series has been updated to match it!

5 top-tier companies that use Elixir
  • Elixir

5 top-tier companies that use Elixir

Elixir is a pretty capable language - and it consistently ranks near the top of most loved and wanted languages rankings. It has a large following and some very persuasive preachers as well. But that would not be enough to make me like it – what I need as real proof of its strengths is real businesses that strive with Elixir.

That’s what this list is all about – a bunch of stories from top companies that chose Elixir and never looked back. Let us show you how its power and versatility shows in practice.