Skip to content

Instantly share code, notes, and snippets.

@exodist
Created August 10, 2016 15:46
Show Gist options
  • Save exodist/6d28ef1725f66f887fc34303c5fe99e1 to your computer and use it in GitHub Desktop.
Save exodist/6d28ef1725f66f887fc34303c5fe99e1 to your computer and use it in GitHub Desktop.
Plugin you can preload to hide diagnostics messages
package Test2::Plugin::NoDiag;
use strict;
use warnings;
use Test2::API qw/test2_stack test2_add_callback_post_load/;
test2_add_callback_post_load(sub {
test2_stack->top->filter(
sub {
my ($hub, $event) = @_;
return if $event->diagnostics;
return $event;
},
inherit => 1,
);
});
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment