Elixir Testing — How to run Only Specific Tests.
Stop coding if you are not writing the test cases.
This article comprises three major topics.
- How to run the specific test cases?
- How to use tags in test cases? and
- How to configure the tests?
When I first started writing the code, I spend most of the time in writing the code only. I did not even think of writing the test cases. One fine day, I read a sentence “ If you are not writing the tests , stop coding”. This quote really impressed me in writing the tests. So, I started hunting the geeks’ libraries.
I have gone through some libraries written by the great coding geeks. They really care about writing the test cases. However, don’t waste your time in writing the test cases. Keep a parallel progress in coding and testing as well.
Elixir comes with nice Testing Framework called ExUnit
. If you do not know how to write the test cases, this article really helps you.
You can run the specific tests in different ways. Let’s get into it…
A File with Specific Test Cases
You can write all the test cases inside a file and test them with command
$ mix test path_to_your_file.exs