Skip to content

Instantly share code, notes, and snippets.

@michaelsbradleyjr
Created August 15, 2011 21:32
Show Gist options
  • Save michaelsbradleyjr/1147919 to your computer and use it in GitHub Desktop.
Save michaelsbradleyjr/1147919 to your computer and use it in GitHub Desktop.
use Modern::Perl;
use Term::ANSIColor qw( :constants );
use IPC::Run3;
use Capture::Tiny qw( tee );
my @cmd = qw( node t/index.js );
my ($stdout, $stderr) = tee {
run3 \@cmd;
};
if ($stdout =~ m/\s-.+fail/) {
print STDERR RED, "one or more tests failed!";
die RESET, "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment