Show desktop notifications for ExUnit runs. Works very well with automatic test runners such as mix-test.watch. (Yes, TDD is awesome!)
Currently notifications on OS X and Linux are supported.
First, add ExUnitNotifier
to your mix.exs
dependencies:
def deps do
[{:ex_unit_notifier, "~> 1.0", only: :test}]
end
Then, update your dependencies:
$ mix deps.get
Ensure terminal-notifier is installed and available through the users PATH
.
Install notify-send
:
sudo apt install libnotify-bin
Add ExUnitNotifier
to your ExUnit
configuration in test/test_helper.exs
file.
ExUnit.configure formatters: [ExUnit.CLIFormatter, ExUnitNotifier]
ExUnit.start
Now run mix test
and you'll see notifications popping up :)
Notifications will be sent from the first available notifier that is deemed available in the order specified below:
- terminal-notifier
- notify-send
- Terminal Title if non of the above match
To force a specific type of notifier to be used, specify the notifier using the following configuration:
config :ex_unit_notifier, notifier: ExUnitNotifier.Notifiers.TerminalNotifier
You can use one of the available notifiers found in lib/ex_unit_notifier/notifiers, or you can write your own.
The MIT License
Copyright (c) 2016-present Navin Peiris
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.