Skip to content

Instantly share code, notes, and snippets.

@Kintull
Last active April 1, 2020 08:20
Show Gist options
  • Save Kintull/7239014c46c84c69a855d776e3e39d87 to your computer and use it in GitHub Desktop.
Save Kintull/7239014c46c84c69a855d776e3e39d87 to your computer and use it in GitHub Desktop.
Start Elixir ExUnit test from console
# You can use it to build eflame graph.
#
# First: iex console should be started with `iex -S mix test /test/suite/feature_test.exs`
#
# I would be glad if you can help me with test compilation part from console
# so we don't have to autocompile the test with `mix test`
#
# Then in promtp you can enter to run the ex_unit test:
test_modules = [YourProject.Suite.FeatureTest]
ExUnit.configure([after_suite: []])
{:ok, _} = Application.ensure_all_started(:ex_unit)
Enum.each(test_modules, &ExUnit.Server.add_sync_module/1)
time = ExUnit.Server.modules_loaded()
ExUnit.configuration() |> Keyword.take([:max_cases, :seed, :trace]) |> ExUnit.configure()
options = ExUnit.configuration()
ExUnit.Runner.run(options, time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment