Skip to content

Commit

Permalink
# Watching Tests
Browse files Browse the repository at this point in the history
Out of the box, Elixir comes with a fantastic [unit testing
framework](http://elixir-lang.org/docs/stable/ex_unit/ExUnit.html).
ExUnit can be run against our current project by running the `mix test`
command. Unfortunately, this runs the test once and quits. It doesn't
watch our project and rerun our suite when it detects changes.

Thankfully, the `mix_test_watch` dependency does exactly that. We can
add it to our project, and run the `mix test.watch` command, and our
suite will rerun on every file change.

Now that our test suite is up and running, we'll remove the example test
Elixir provided for us.
  • Loading branch information
pcorey committed Aug 17, 2016
1 parent 4cb1209 commit f6eea76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 3 additions & 1 deletion mix.exs
Expand Up @@ -27,6 +27,8 @@ defmodule AdventOfCode01.Mixfile do
#
# Type "mix help deps" for more examples and options
defp deps do
[]
[
{:mix_test_watch, "~> 0.2", only: :dev}
]
end
end
4 changes: 0 additions & 4 deletions test/advent_of_code_01_test.exs
@@ -1,8 +1,4 @@
defmodule AdventOfCode01Test do
use ExUnit.Case
doctest AdventOfCode01

test "the truth" do
assert 1 + 1 == 2
end
end

0 comments on commit f6eea76

Please sign in to comment.