mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
749 B
749 B
Run ExUnit Tests In A Deterministic Order
When running a file of
ExUnit tests,
they will be executed in a pseudo-random order based on a seed value. In
general, ExUnit will pick a random seed each time you run your tests. If
you'd like to add some determinism to the order that your tests run in, you
can specify the seed in the ExUnit configuration.
ExUnit.configure seed: 42
ExUnit.start
defmodule AssertionTest do
use ExUnit.Case, async: true
test "the truth" do
assert true
end
test "more truth" do
assert 2 + 2 = 4
end
end
h/t Chris Erin