We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could be there option to display notification only when tests fail? Right now it spams me with every running, even if tests are not failing.
The text was updated successfully, but these errors were encountered:
I don't use notification myself, but I'm guessing people use notification to know "if tests finished".
But it seems useful to opt out.
I don't know what notification backend you're using (depends on your OS and settings), but I think this could be a generic feature.
If you like, you can quickly hack a solution yourself and then send a PR if it works.
I'm not sure what kind of API/configuration would be best, but let's say it's:
notification(:tmux, { ignored_notifications: [:success] # < ---- maybe an option like this? success: 'colour150', failure: 'colour174', pending: 'colour179', }) if ENV['TMUX']
And then in:
https://github.com/guard/notiffany/blob/fc138bb63ed94d754a0091a3813d3938db3c41a5/lib/notiffany/notifier/base.rb#L72
You'd skip the _perform_notify if the current notification type is in the "ignored" list.
_perform_notify
Sorry, something went wrong.
As I use minitest-reporter gem, I made a monkey patch in my test_helper.rb file.
minitest-reporter
module NofityFailureTest def record(test) super if test.error? || test.failure e = test.failure TerminalNotifier::Guard.notify(e.message, title: File.basename(e.location)) end end end module Minitest module Reporters class BaseReporter include NofityFailureTest if RUBY_PLATFORM =~ /darwin/ && `which terminal-notifier`.present? end end end
You can monkey patch minitest gem If you like. It's in Minitest::Reporters::BaseReporter.
Minitest::Reporters::BaseReporter
No branches or pull requests
Could be there option to display notification only when tests fail?
Right now it spams me with every running, even if tests are not failing.
The text was updated successfully, but these errors were encountered: