An Elixir module for exporting private functions in tests.
To export private functions when in :test
environment:
-
Add this to your dependencies:
{:export_private, ">= 0.0.0"}
-
use
it in your modules:defmodule MyModule do use ExportPrivate # This function will be exported when Mix.env() == :test. defp private_func, do: :test end
And yeah, that’s it.