Packages
charon
2.1.1
4.3.0
4.3.0-beta1
4.2.0
4.2.0-beta3
4.2.0-beta2
4.2.0-beta1
4.1.0
4.0.1
4.0.0
4.0.0-beta3
4.0.0-beta2
4.0.0-beta1
3.4.1
3.4.0
3.3.0
3.2.0
3.1.1
3.1.0
3.0.3
3.0.2
3.0.1
3.0.0
3.0.0-beta1
2.8.0
2.8.0-beta1
2.7.3
2.7.2
2.7.1
2.7.0
2.6.1
2.6.0
2.5.0
2.4.0
2.3.0
2.2.0
2.2.0-beta
2.1.3
2.1.2
2.1.2-beta
2.1.1
2.1.0
2.0.0
1.3.4
1.3.3
1.3.2-beta
1.3.1-beta
1.3.0-beta
1.2.0-beta
1.1.0-beta
1.0.1-beta
1.0.0-beta1
0.0.4-alpha
0.0.3-alpha
0.0.2-alpha
0.0.1-alpha
Authentication & sessions for API's.
Current section
Files
Jump to
Current section
Files
lib/charon/test_helpers.ex
defmodule Charon.TestHelpers do
@moduledoc """
Utility functions for writing tests.
"""
alias Charon.Config
use Charon.Internal.Constants
@doc """
Override configuration for an optional module.
"""
@spec override_opt_mod_conf(Config.t(), atom | binary(), map | keyword()) ::
Config.t()
def override_opt_mod_conf(config, module, overrides) do
opt_mods = config.optional_modules
mod_conf = opt_mods |> Map.get(module, %{}) |> Map.merge(Map.new(overrides))
opt_mods = Map.merge(opt_mods, %{module => mod_conf})
%{config | optional_modules: opt_mods}
end
end